JBoss Community

Re: kcontext.setVariable("variable",value) for begin used by following tasks?

created by knevik in jBPM Development - View the full discussion

if you do want to set a variable in the workflow use the following code

 

kcontext.setVariable("userId", "user");    //where userId is the variable name and user is the name of the user

 

this can be put in either a script task of its own, or in the on-entry or on-exit event of another task

 

<userTask id="_5" name="Human Task" >

      <extensionElements>

       <tns:onEntry-script scriptFormat="http://www.java.com/java">

        <script>

         kcontext.setVariable("userId", "user");

        </script>

       </tns:onEntry-script>

      </extensionElements>

      <ioSpecification>

          ...

</userTask>

Reply to this message by going to Community

Start a new discussion in jBPM Development at Community