Versions Compared

Key

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

...

This is done simply by typing the variable name (or comma-separated list of names) in the OutParams property of the source shape:

Example of Share Variables between Objects in a workflowImage Modified


Step 2. Instruct the target shape to receive this new variable as input.

...

Code Block
EXPR#:param_TASK_shared_var_test_1_variableA: 

Example of Shared Variables between Objects in a WorkflowImage Modified


Step 3. In the source shape, make the variable visible to the whole workflow.

...

Expand
titleIn case of streaming translator (click to expand):

Drop the Code shape from left panel in ADVANCED group and set value of the Code shape as 

Code Block
:varTaskParams: := :varTaskParams: + 'variableA;' + :variableA: + '!'

If you need to share more variables you can add them to the Code shape using syntax variable_name;variable_value!. For example, if we have another variable count to share, the Code shape value is set like this:

Code Block
:varTaskParams: := :varTaskParams: + 'variableA;' + :variableA: + '!' + 'count;' + :count: + '!'


Your final picture should look like this


Example of Shared Variables and Objects in WorkflowImage Modified


Expand
titleIn case of transform translator (click to expand):

Step A:  Drop a Variable shape onto the worksheet. It represents the variable you are going to share. Drop a Call Include shape from the left panel in ADVANCED group and click the Browse button next to the File property in the right panel

Variable in WorkflowImage Modified

Step B: Drop a Call Include shape from the Advanced section of the toolbox, and type the following text in its File property:

../eagle_ml-2-0_cm/w_config.inc

File Properties screenImage Modified

Or, click the "ellipsis" button to select the file from the open dialog.

Browse windowImage Modified


Step C: Drop the Code shape from left panel in group ADVANCED after the variable box and set value of the Code shape as

Code Block
languagetext
:CorrelationId: := SubString(:FILE_NAME:, Find(:FILE_NAME:, '-', 0, 2) + 1); :CorrelationId: := SubString(:CorrelationId:, 0, Find(:CorrelationId:, '_'));

Example of Shared Variables between Objects in WorkflowImage Modified


Step D: Drop a Call Include shape from the Advanced section of the toolbox, and type the following text in its File property:

../eagle_ml-2-0_cm/get_w_state.inc

Properties dialogImage Modified

Or, click the "ellipsis" button to select the file from the open dialog.

Browse windowImage Modified


Step E: Drop another Code shape and set its value as:


Info

If you need to share more variables you can add them to the Code shape using variable_name;variable_value! syntax. For example, if we have another variable count to share, then the Code shape value will be as follows

Code Block
languagetext
IF (find(:varTaskParams:, 'variableA;') = -1) then :varTaskParams: := :varTaskParams: + 'variableA;' + :variableA: + '!';



Step F: Drop the second Call Include shape and type or select  file ../eagle_ml-2-0_cm/upd_w_state.inc


Browse windowImage Modified

after all these additions you should have something similar to this:


Example of Shared Variable between Objects in WorkflowImage Modified



To verify that new variables are passed to the target shape, run your workflow and check the Control Message tab in the Monitoring Tool.

You should be able to see your new variables as input parameters in the RTR:

Task Details Control MessageImage Modified