07-12-2019 05:00 AM
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 !
07-12-2019 05:21 AM
You should put your .js file in Repository->Data dictionary->Script folder.
It would be visible.
Regards,
Kintu
07-12-2019 06:35 AM
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.
07-16-2019 01:15 AM
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
07-16-2019 01:43 AM
hi vidhi,
thank you for your response, i have got script.
Explore our Alfresco products with the links below. Use labels to filter content by product module.