cancel
Showing results for 
Search instead for 
Did you mean: 

Rule for Excute Script option

aishu
Champ on-the-rise
Champ on-the-rise

Dear Team,

I have to set automatic workflow,if any file uploaded to respective folder my workflow should start and send mail to appropriate person for approval. 

i m trying to set Rule with Perform action->Execute script-> but when i create script then it is not showing in dropping

can u suggest me how to write script for workflow? and why script option not showing in drop down?

Please refer attachment.

please suggest !

4 REPLIES 4

kintu_barot
Star Collaborator
Star Collaborator

You should put your .js file in Repository->Data dictionary->Script folder.

It would be visible.

Regards,

Kintu

ContCentric

Regards,
Kintu

aishu
Champ on-the-rise
Champ on-the-rise

Thanks I understand how to add script . i have attached the .js file  but it doesn't work ..please refer below script.

function startWorkflow()
{
var workflowAction = workflow.getDefinitionByName("activiti$test_wf");
var package= workflow.createPackage();

var wfparams = new Array();
wfparams["model_prefix:req_props_name"] = value2;

wfparams["bpm:assignee"] = people.getPerson("ADMIN");
workflowAction.startWorkflow(package, wfparams);
}

}

startWorkflow();

here activiti$test_wf is custom id of workflow , as i m getting this script from net..how should i get my custom workflow ID.

Hi Aishwarya,

In this line, you need to add property of custom workflow model insted of "model_prefix:req_props_name". Or you can use OOTB properties like "bpm:comment", "bpm:startDate", "bpm_priority" etc.

wfparams["model_prefix:req_props_name"] = value2;

Did you register your custom workflow?

Regards,

Vidhi

ContCentric

Regards,
Vidhi

hi vidhi,

thank you for your response, i have got script.