Workflow API, JavaScript, Web Scripts
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2007 10:17 AM
Hi
I am trying to initiate a workflow by Workflow JavaScript API, it is called in a Web Script.
Here is the code snippet… It is pretty much exactly same as the examples provided in various Alfresco Wiki pages…
It fails saying "Internal Server Error".
However, I tried to debug it by the JavaScript Debugger. It throws a NullPointerException at line
workflow.execute(objectSpace);
Not sure what is the issue.
Is there any documentation what exactly workflow.execute does? And what should be the parameter passed into this?
Thanks,
Snig.
I am trying to initiate a workflow by Workflow JavaScript API, it is called in a Web Script.
Here is the code snippet… It is pretty much exactly same as the examples provided in various Alfresco Wiki pages…
var workflow = actions.create("start-workflow"); workflow.parameters.workflowName = "jbpm$wf:job"; workflow.parameters["bpm:workflowDescription"] = desc; workflow.parameters["bpm:context"] = objectSpace; //workflow.parameters["bpm:assignee"] = person; var futureDate = new Date(); futureDate.setDate(futureDate.getDate() + 7); workflow.parameters["bpm:workflowDueDate"] = futureDate; workflow.execute(objectSpace);
It fails saying "Internal Server Error".
However, I tried to debug it by the JavaScript Debugger. It throws a NullPointerException at line
workflow.execute(objectSpace);
Not sure what is the issue.
Is there any documentation what exactly workflow.execute does? And what should be the parameter passed into this?
Thanks,
Snig.
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2007 11:08 AM
Any Replies please… :?
Counting on you guys…
Counting on you guys…

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2007 10:20 AM
objectSpace is not defined anywhere.
For the 'start-workflow' action, the parameter to execute() is the node (e.g. document) you want to route through the workflow.
So, as long as you have a handle onto a document you can pass that. Within a web script, that may be driven by a url parameter, search etc.
For the 'start-workflow' action, the parameter to execute() is the node (e.g. document) you want to route through the workflow.
So, as long as you have a handle onto a document you can pass that. Within a web script, that may be driven by a url parameter, search etc.
