As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
http://localhost:8080/alfresco/wcs/test/startWorkflow?nodeid=d8d0a561-093d-4492-a124-9fb63369fae2
Executing script /test/startWorkflow.get.js (in classpath store file:C:/Alfresco/tomcat/shared/classes/alfresco/extension/templates/webscripts)nodeId = d8d0a561-093d-4492-a124-9fb63369fae2theDocument = Node Type: {http://www.alfresco.org/model/content/1.0}content, Node Aspects: [{http://www.alfresco.org/model/content/1.0}auditable, {http://www.alfresco.org/model/system/1.0}referenceable, {http://www.alfresco.org/model/application/1.0}inlineeditable, {http://www.alfresco.org/model/content/1.0}titled, {http://www.alfresco.org/model/content/1.0}author]theDocument nodeRef = workspace:/ /SpacesStore/d8d0a561-093d-4492-a124-9fb63369fae2Attached JBPM Context to transaction 4d7d09fc-2917-407c-8373-157e14646314Caught exception; decorating with appropriate status template : org.alfresco.scripts.ScriptException: 04170028 Failed to execute script '/test/startWorkflow.get.js (in classpath store file:C:/Alfresco/tomcat/shared/classes/alfresco/extension/templates/webscripts)': NodeRef must be supplied.
var nodeId = args.nodeid; logger.log("nodeId = " + nodeId); // var document = utils.getNodeFromString("workspace://SpacesStore/" + nodeId); var theDocument = search.findNode("workspace://SpacesStore/" + nodeId); logger.log("theDocument = " + theDocument); logger.log("theDocument nodeRef = " + theDocument.nodeRef); var workflowAction = actions.create("start-workflow"); workflowAction.parameters.workflowName = "jbpm$nmwf:MyWorkflow"; workflowAction.parameters["bpm:workflowDescription"] = "Please edit: " + theDocument.name; workflowAction.parameters["bpm:assignees"] = [people.getPerson("admin"), people.getPerson("joebloe")]; var futureDate = new Date(); futureDate.setDate(futureDate.getDate() + 7); workflowAction.parameters["bpm:workflowDueDate"] = futureDate; workflowAction.parameters["bpm:dueDate"] = futureDate; // workflowAction.execute(theDocument); workflowAction.execute(theDocument.nodeRef); workflowAction.signal();
var nodeId = args.nodeid; var theDocument = search.findNode("workspace://SpacesStore/" + nodeId); var workflowDefinition = workflow.getDefinitionByName("jbpm$nmwf:myWorkflow"); var workflowPackage = workflow.createPackage(); workflowPackage.addNode(theDocument); var workflowParameters = []; workflowParameters["bpm:workflowDescription"] = "Please edit: " + theDocument.name; workflowParameters["bpm:assignees"] = [people.getPerson("admin"), people.getPerson("joebloe")]; var futureDate = new Date(); futureDate.setDate(futureDate.getDate() + 7); workflowParameters["bpm:workflowDueDate"] = futureDate; workflowParameters["bpm:dueDate"] = futureDate; workflowParameters["bpm:workflowPriority"] = 1; var workflowPath = workflowDefinition.startWorkflow(workflowPackage, workflowParameters); // This does *not* work, I get "bpm_assignees is not defined" // workflowPath.signal(null); // End the start task var tasks = workflowPath.getTasks(); for (task in tasks) { tasks[task].endTask(null); }
Just a little up to know if someone has make progress on this problem ?