cancel
Showing results for 
Search instead for 
Did you mean: 

assign workflow custom properties from script

adit_patel
Confirmed Champ
Confirmed Champ
Hi,

I am starting a custom workflow from script. We assign parameter like workflow.parameters["bpm:description"] = document.properties.name, but how to assign my tasks property like workflow.parameters["MY_CUSTOM_WF:card_type"] = "C1". Is it possible this way. I am getting no result this way. Below is what I execute in my script.

         var workflow = actions.create("start-workflow");
         workflow.parameters.workflowName = "jbpm$MY_CUSTOM_WF:TimecardDocument";
         workflow.parameters["bpm:description"] = document.properties.name;
         workflow.parameters["bpm:assignee"] = people.getPerson("tsolorza");

         workflow.parameters["MY_CUSTOM_WF:timecard_type"] = "C1";

         workflow.parameters.startTaskTransition="";
         workflow.execute(document);
2 REPLIES 2

adit_patel
Confirmed Champ
Confirmed Champ
I found that naming MY_CUSTOM_WF as prefix was not letting it set. I made it back to MYCUSTOMWF and it worked

So does it mean that we cannot have prefix with _ (underscores)….is it a bug  :?:

poptarts
Champ in-the-making
Champ in-the-making
So does it mean that we cannot have prefix with _ (underscores)….is it a bug  :?:

It's a good idea to avoid underscores, because in the workflow javascript sometimes variables of a "modelNameSmiley TongueropertyName" are represented as "modelName_propertyName". Just use a dash or just useNamesLikeThis to sidestep the issue.