AnsweredAssumed Answered

[SOLVED] Automatically launch a WF

Question asked by notherien on Nov 19, 2009
Latest reply on Nov 20, 2009 by jayjayecl
Hello;

I created an advanced workflow "scwf: OT —— Achat" and it works well, and I start it manually. but I would really like this workflow starts automatically when the arrival of a Order file to a directory named "Orders", which is why I thought to add a rule that runs a script that launches my workflow "scwf: OT —— Achat" when I add a order (file) to "Order" (directory ), but when i add a document in that directory, Alfresco generate this error message:
Please correct the errors below then click OK.
A system error happened during the operation: 10190020 Failed to execute script 'workspace://SpacesStore/1bad3d0c-7b70-4f33-b959-c7b6c445687e': 10190019 Invalid Global Id 'scwf:Achat——OT'

the script that I added is as follows:
var workflow = actions.create("start-workflow");
workflow.parameters.workflowName = "scwf:Achat——OT";
workflow.parameters["bpm:workflowDescription"] = document.name;
workflow.parameters["bpm:assignee"] = person;
workflow.execute(document);

thank you for helping me to find the solution to this error, or to find another way to automatically launch my workflow
(I'm sorry for the bad language, I am not a native English speaker)

Outcomes