cancel
Showing results for 
Search instead for 
Did you mean: 

Start Advanced Workflow from JAVA code

kparuchuri
Champ in-the-making
Champ in-the-making
I want to start work flow on a particular node from a webscript triggred by an external client.

As I get request from a client, I start the work flow from webscript and in my action class I have to check out a node

How should I pass the nodeRef(which has to be checked out) from webscript(JAVA) to WorkFlow Action class?

And How should I pass XML from webScript(JAVA) to Workflow Action class?
1 REPLY 1

kparuchuri
Champ in-the-making
Champ in-the-making
I have this code and ctx.getVariable("bpm_package") is returning null. Am I missing something here

public void executeAction(ExecutionContext ctx) throws Exception {
      JBPMNode jbpmNode = (JBPMNode) ctx.getVariable("bpm_package");
      NodeRef packageNodeRef = jbpmNode.getNodeRef();

This is how I am triggering my workflow from JAVA code

NodeRef propNode = this.getHotelMasterRepositoryService().findNode("1");
Map<QName, Serializable> workflowProps = new HashMap<QName, Serializable>();
workflowProps.put(WorkflowModel.ASSOC_PACKAGE, propNode);
workflowProps.put(WorkflowModel.ASSOC_ASSIGNEE, getServiceRegistry().getPersonService().getPerson("admin"));
WorkflowPath wfPath = workflowService.startWorkflow(wfid, workflowProps);