Author Message
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
When creating a workflow I see how you create variables. What I am wondering is how to set initial values in the variables?

I create "myvars" with A and B as string fields. But I want to set the initial value of A. Sort of like

String A = "123";

Do I have to use an assign?
AnuragAggarwal
Joined: Jun 1, 2014
Messages: 150
Offline
you can do output mapping in start event to A

and if you want to hard code value, you can double click on mapping, it would open an expression builder, you can type in the string you want
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
I am using the GA build but not seeing where I would double click on "mapping" to get an expression builder.
AnuragAggarwal
Joined: Jun 1, 2014
Messages: 150
Offline
When inside mapping dialog, double click on the connection line connecting schemas on left side to right side to get to expression builder
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
That is good to know.

The only way I see to do this is to add an assign. That seems inefficient as if I has many variables that I wanted initialized when the flow starts, that would take a node for each variable. Am I missing something?
Vishal-Avaya
Joined: Jul 24, 2014
Messages: 45
Offline
In one data mapper you can map multiple static values for multiple variables by double clicking on each line.
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
Yes I understand that in the input / output mapping a single item can have a one to many. But the "variables" (the thing that looks like a disc drive) only allows you to specify a schema and not initial values. When I go to the start event I can map input event values to my variables, BUT, I am not seeing how to a variable to an initial constant value other than an assign.
AnuragAggarwal
Joined: Jun 1, 2014
Messages: 150
Offline
Double click on start event
click on output mapping button
map some field to A, this would show up as a line
double click on that line, another dialog would open
in top text box of that dialog, delete previous content and type "123"
save all the dialogs
now A would have constant value of "123"
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
That works, but it does not seem that intuitive, taking an arbitrary field in the input event and mapping it to variables to initialize them. I would hope that something better is done in future releases.

Also, when I do that I get a warning "Warning: startschema.<variable> is not used within the expression! Do you still want to save?" This would imply to the average user that they may be doing something wrong, when in fact this is the recommended way to initialize a variable.

Well at least I know how to accomplish my goal with out a ton of assigns. Still seems awkward though.
Go to:   
Mobile view