Using junctions

Hi,
I’m new in teneo and I’m trying to create a subflow that makes a question to the user, and depending on the answer, it shows differents responses. I have 3 options:

  1. The answer of the user conteins the word “maniobra”.
  2. The answer of the user conteins the word “puerta”.
  3. It doesn’t much none of them.
    So, I have generated an ENTITY (DEFECTO.ENTITY):
    defecto_entidad
    I know that I need a variable (I don’t know if global or flow variable… I have to use these variable in other subflows) to save the answer of the user… for that in the transition I have the next condition:
    %DEFECTO.ENTITY^{defecto = _USED_WORDS}
    I’m not sure I this is correct… so after that, how can extract the words I need (maniobra, puerta) to know what path I have to choose?

Hi Miriam! I really like your question, because this is exactly the use case that Teneo is designed for. I hope I’ll be able to help you.

The entity looks like just what you’ll need. I assume you’ve placed it in the transition leaving the prompt.

The variable defecto:

Regarding defecto, I would assign it this way, to acquire the normalized values that you set up in the entity:

%DEFECTO.ENTITY^{defecto = lob.TipoDefecto}

If you assign used words, you may wind up with any number of variants of the words, including with typos, etc.

Regarding the scope of the variable defecto, there are two approaches:

  1. global variable: so that it can be accessed everywhere that it is needed. Here you should be sure that old values of defecto can’t cause any problems.

  2. flow variable: as flow vars are local to the flow they are defined in, if the calling flow needs to know about the variable you have to pick it up from the subflow, and pass it on to other subflows that need it. So you will have to define a flow var at all the locations needing it. Note also that once the main flow is dropped, the flow variable vanishes as well. If other flows need it later, you should go with option 1)

This screenshot shows where you can pick up and send values. This is what you see when you click the link to the subflow in the calling flow. If you click on the transitions, you should have these options set for transitions 1 & 2. You can check that design in the Longberry Baristas solution in the flow “User wants to know if we have a store in city”

Transitions after the junction:

The transition leaving the prompt is set to use input. After the junction you have to switch all transitions to “continues without input”. Like you have with transition 3.

image

You will need to assign a condition to the transitions to make surre Teneo takes the right paths. Here you also have two options:

  1. repeat the condition you have in the entity, e.g. %PUERTA.NN.LEX, etc.
    –or better -
  2. use script conditions based on the variable you just assigned: {defecto == “puerta”}, etc.

The third transition can be a fallback - you won’t need an associated condition there.

Revisitable prompt

What do you want to happen in case the user doesn’t enter one of the expected options? I think it is set to “not revisitable” at the moment. If the user doesn’t enter one of the options, the flow will be dropped. If you switch to revisit, then the user will stay in the flow and be re-prompted. You have an option to decide how often to re-prompt. Sometimes users may ask some other question before continuing. This allows them to resume.

Hi Fred!
Thank you very much for your answer. I have done what you say and I have the solution.
Know I have to continue doing the next subflows for “maniobra”, “puerta” and others.
What I don’t understand is why I’m getting an error in the script condition… Is that an error? I have the same in “puerta”
error maniobra
Thank you again.
Miriam

I’m happy I was able to help! The highlighting you noticed indeed looks like an error, but it’s not. It’s just an idiosyncrasy of the condition editor. It would be better if a different color had been chosen here. I’ll pass on the feedback to our dev team.

Note: the condition editor does not evaluate the validity of scripts. If there is indeed a script error, it will be flagged in tryout.

1 Like