Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

All agents handling UDRs forward UDR references on all outgoing links from the agent, that is, the same instance of the UDR is referred to from all agents in a workflow. This is accepted if all agents only  read the UDR content. If an agent alters the content, it effectively alters the content for all other agents that receive the UDR. To avoid this behavior, the UDR must be cloned. Refer to the following examples for more information.

Note

Note!

Cloning is a costly operation in terms of performance, therefore it must be used with care.

Info

Example - Analysis agent assignment and cloning, case 1


Image Added

Assignment case 1

In this example, you want to alter the UDR in the Analysis agent and send it to Encoder_1, while still sending its original value to Encoder_2. To achieve this, the UDR must be cloned. The following code creates, alters, and routes a cloned UDR on r_2 and leaves the original UDR unchanged.

Code Block
languagetext
themeEclipse
input=udrClone(input);
input.MyNumber=54;
udrRoute(input);

Note that input is a built-in variable in APL, and must be used for all UDRs entering the agent.


Info

Example - Analysis agent assignment and cloning, case 2

An alternative solution to the one presented in the previous example is to clone the UDRs in an Analysis agent and then route the UDRs to another Analysis agent in which amendment is performed.


Image Added

Assignment case 2

Configurations in the Analysis_1 agent:

Code Block
languagetext
themeEclipse
udrRoute(input,"r_3",clone);
input.MyNumber=54;
udrRoute(input,"r_2");

The incoming UDR is cloned and the clone is routed on to r_3. After that the original UDR can be altered and routed to r_2.