cancel
Showing results for 
Search instead for 
Did you mean: 

How to access input java objects with Groovy, Javascript?

ryu
Champ in-the-making
Champ in-the-making
Hi all,

We can use JUEL to call method from an input Java object, for example ${user.id}. But we can only save the result back to one variable per script task (by using att resultVariableName)

So I want to find a way in Groovy or Javascript to access and manipulate input java objects in Script Task.

Please give me a hint. Thank you 😃
1 REPLY 1

frederikherema1
Star Contributor
Star Contributor
Hi,

In a script-task, you can just declare a variable and it will be stored as process-variable, eg:

<scriptTask id="theScriptTask" name="Execute script" scriptFormat="js">
  <script>
    var myVariable = 'this is a value';
  </script>
</scriptTask>
After the script-task ran, the variable will be set on the execution/process-instance. The resultVariableName you are referring to is on a ServiceTask instead of a ScriptTask.