cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass strings to a subprocess

bigp
Champ in-the-making
Champ in-the-making
I tried to include a subprocess via CallActivity according to http://www.activiti.org/userguide/index.html#bpmnCallActivity
The chapter says that I can pass variables to the subprocess.
My problem is, that I don't have a variable in the main process, but I want only to pass a static string to the subprocess.
How can this be done without defining a variable (e.g. with a scripttask)?
3 REPLIES 3

atifelkhachine
Champ in-the-making
Champ in-the-making
Hi,

You may use the dataInputAssociation like this :


    <callActivity id="callSubProcess" name="Call activity" calledElement="SubProcess">
      <extensionElements>
        <activiti:in sourceExpression="Hello" target="myVar"></activiti:in>
      </extensionElements>
    </callActivity>

As you can see, the static string here is : Hello

And in the called activity you can print out the content in a ScriptTask like this :


    <scriptTask id="scripttask1" name="Script Task" scriptFormat="groovy">
      <script><![CDATA[System.out.println("myVar is : "+myVar);]]></script>
    </scriptTask>

This will print => myVar is : Hello

Hop this helps.

Best Regards,
Atif

bigp
Champ in-the-making
Champ in-the-making
Hi,
okay so far.
The trick seems the difference between

<activiti:in sourceExpression="REVIEWER" target="taskAssignees"></activiti:in>

and

<activiti:in source="REVIEWER" target="taskAssignees"></activiti:in>.

The first line will transfer the value in the Variable taskAssignees, the second not.

How can I describe this difference in the Activiti Designer (Eclipse) without modifying the the …bpmn20.xml file every time?

Best,
phil

atifelkhachine
Champ in-the-making
Champ in-the-making
Hi,

It seems that the Designer doesn't implement this future. You may report a Jira issue for this (http://jira.codehaus.org/browse/ACT) ….

Best regards,
Atif