Attach/Get Attached Call Data - usage in CFD

Status
Not open for further replies.

flexserve

Bronze Partner
Joined
Feb 20, 2013
Messages
16
Reaction score
2
I was looking for a way to pass variables between CFD apps (exits Main/CFD1 to call queue/VM, returns into a different CFD app). It lloks like Attach/Get Attached Call Data is a possible method, I *think* I understand the "Attach Call Data" portion - declare _public_variable in Project, then assign value via "Attach Call Data". What I am not sure about is how to retrieve the data in the subsequent project. Do I again declare the variable, leave it blank, then use "Get Attached Call Data" to assign the value to the _public_variable? What am I missing?

TIA

Clyde Parliament
 
Hello @flexserve,

Actually, defining a project or callflow variable is not mandatory. You can use the Attach Call Data component configuring the value as a constant string for example, or the output of another component, like a database query result. You can also take the value from a variable, but that's just one of the options you have. When you attach data to a call, you must use the prefix "public_". This is to avoid overriding a system value by accident. So all your data will be identified by a key having this prefix.

Once you get the call in a second CFD app, you can use the Get Attached Call Data component to read this value. Here again, you can assign the value read to a variable if you want, but that's not mandatory. You can just pass the output property to another component for further processing, like evaluating a condition for example, and decide what to do based on that.
 
  • Like
Reactions: Evolute IT
Thank you for the reply, edossantos. Where I lack understanding is how to implement the value passed on to the 2nd app. Is there any examples of this use in the included examples with CFD or on Github? Or could you explain further on the use of "Get . . ."?

TIA

Clyde Parliament
 
Thank you for the reply, edossantos. Where I lack understanding is how to implement the value passed on to the 2nd app. Is there any examples of this use in the included examples with CFD or on Github? Or could you explain further on the use of "Get . . ."?

TIA

Clyde Parliament
There are no samples for this component, but the logic is the same than for any other component. This component exposes the DataValue property after execution. You can use that property in an expression in a Conditional component to make a decision.
 
For example, if you want to check if the value attached to the call is equal to "123", you can use the expression:
EQUAL(MyGetAttachedCallData.DataValue,"123")
 
Never mind, created test, work successfully. To fill in the gaps for anyone else seeking the same information:

1. As @edossantos indicated, declaring a global variable is not necessary. And as stated, the variable must be prefaced with "public_". Since it was not declared, the finished variable name will need to be quoted "oublic_my-variable"
2. In the target/receiving app, again, not necessary to declare the variable, and again, it does need to be quoted when input into the "Get Attached Call Data" element.
3. After it is declared in "Get Attached Call Data", it will then be available in any item that has the Expression Editor under "Variables". Drag the data element for the variable (DataValue) to the expression field, sve, and it is then available.

Hope this helps.
 
Status
Not open for further replies.

Forum statistics

Threads
112,285
Messages
591,704
Members
165,406
Latest member
ARKC