cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti Task Script not working?

chrisx_212
Champ in-the-making
Champ in-the-making
Hello. Can anyone tell me where did I get things wrong that this script will not work?



<startEvent id="sid-8DEDA21B-F1B5-4E15-83C8-52150B796B04"><extensionElements><activiti:formProperty id="new_var" name="NEW VARR" type="string"/></extensionElements></startEvent><sequenceFlow id="sid-4C4E0B41-70C8-48D1-9596-896E7A772F5E" sourceRef="sid-8DEDA21B-F1B5-4E15-83C8-52150B796B04" targetRef="sid-3E30078B-93B9-418F-99F0-1C66F805EEB0"/><scriptTask id="sid-3E30078B-93B9-418F-99F0-1C66F805EEB0" name="Set Script" activiti:autoStoreVariables="false"><script>console.log("CONSOLE LOG ON SCRIPT TASK");
var ed = "iiiooo";
console.log(ed);
execution.setVariable("new_var", ed);</script></scriptTask><userTask id="sid-D31BBBCC-0CBF-465F-BAD9-A68C2A5085C6" name="Show" activiti:assignee="kermit"><extensionElements><activiti:formProperty id="new_var" name="New Var" type="string"/></extensionElements></userTask>



In here, I wanted it that during the userTask part, the new_var will be changed to "iiiooo" as opposed to whatever was inputted during the startEvent. But it won't budge. Not even the console.log command was carried out. Where did I go wrong here?
4 REPLIES 4

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Chris,

Working examples can be found here: org.activiti.examples.bpmn.scripttask.ScriptTaskTest (activiti source)
(may be you are missing script format e.g. scriptFormat="juel"). Stack trace would help.

Regards
Martin

chrisx_212
Champ in-the-making
Champ in-the-making
Uh I meant to say to be used in the Activiti Model Editor…

I don't know, the stack trace shows nothing. Where do I find this scriptFormat thing?

vasile_dirla
Star Contributor
Star Contributor

chrisx_212
Champ in-the-making
Champ in-the-making
All right found the scriptFormat part. Now it works. Thank you.

I'll open up a new topic for my problem.