Script task execution
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2016 08:54 AM
Hello everyone
I am executing a script task. I wrote the following code in script :
var scriptVar = 3;
var resultVar=" ";
var resultVarYes="yes";
var resultVarNo="no";
if(scriptVar>0)
{
scriptVar=scriptVar-1;
execution.setVariable("resultVar", resultVarYes)
}
else
{
execution.setVariable("resultVar", resultVarNo)
}
I want to put the value of "resultVarYes" in "resultVar". How to set this value. So i can use value of resultVar.
Any help is appreciated. Thanks in advance.
I am executing a script task. I wrote the following code in script :
var scriptVar = 3;
var resultVar=" ";
var resultVarYes="yes";
var resultVarNo="no";
if(scriptVar>0)
{
scriptVar=scriptVar-1;
execution.setVariable("resultVar", resultVarYes)
}
else
{
execution.setVariable("resultVar", resultVarNo)
}
I want to put the value of "resultVarYes" in "resultVar". How to set this value. So i can use value of resultVar.
Any help is appreciated. Thanks in advance.
Labels:
- Labels:
-
Archive
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2016 09:44 AM
Hi Seema,
have a look on the following test in activiti source please
Regards
Martin
have a look on the following test in activiti source please
org.activiti.examples.bpmn.scripttask.ScriptTaskTest#testDynamicScript
Regards
Martin
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2016 01:02 AM
Hii Martin
Thank you for reply… I am able to put the value of "resultVarYes" in "resultVar". But now i want that it also store the value of scriptVar after performing scriptVar=scriptVar-1. How to store the value of scriptVar.
Thank you for reply… I am able to put the value of "resultVarYes" in "resultVar". But now i want that it also store the value of scriptVar after performing scriptVar=scriptVar-1. How to store the value of scriptVar.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2016 02:07 AM
Hi Seema,
http://activiti.org/userguide/index.html#bpmnScriptTaskVariables
Regards
Martin
http://activiti.org/userguide/index.html#bpmnScriptTaskVariables
autoStoreVariables
Regards
Martin
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2016 02:57 AM
Hii Martin
I tried this but it is not storing the value of resultVar after performing resultVar=resultVar-1.
I tried this but it is not storing the value of resultVar after performing resultVar=resultVar-1.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2016 10:22 AM
I'm not sure I'm following here … but why can't you set it using the setVariable() method?
