Rule for Excute Script option

cancel
Showing results for 
Search instead for 
Did you mean: 
aishu
Active Member

Rule for Excute Script option

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
kintu_barot
Senior Member

Re: Rule for Excute Script option

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

It would be visible.

Regards,

Kintu

ContCentric

Regards,
Kintu
aishu
Active Member

Re: Rule for Excute Script option

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.

vidhipanchal
Established Member

Re: Rule for Excute Script option

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
aishu
Active Member

Re: Rule for Excute Script option

hi vidhi,

thank you for your response, i have got script.