How to access input java objects with Groovy, Javascript?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2011 12:04 PM
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 😃
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 😃
Labels:
- Labels:
-
Archive
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2011 03:46 PM
Hi,
In a script-task, you can just declare a variable and it will be stored as process-variable, eg:
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.
