Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
Hi I need information about how can I launch a workflow from a JSP file.
Thanks
Use below API;s to start workflow process from JSP
Use below API;s to start workflow process from JSP
- wt.fc.ReferenceFactory rf = new wt.fc.ReferenceFactory();
// getObjectID from URL/HTTP Request
wt.fc.WTReference ref = rf.getReference(request.getParameter("oid"));
wt.part.WTPart part = (wt.part.WTPart) ref.getObject();
out.println(wt.workflow.definer.WfDefinerHelper.service.getProcessDefinition("My WorkflowProcess",part.getContainerReference(),true));
wt.workflow.engine.WfProcess aWfProcess = wt.workflow.engine.WfEngineHelper.service.createProcess(wt.workflow.definer.WfDefinerHelper.service.getProcessDefinition("Order More Parts",part.getContainerReference(),true), null);
aWfProcess.setName("My Process");
aWfProcess.setTeamTemplateId(part.getTeamTemplateId());
wt.workflow.engine.ProcessData aProcessData = aWfProcess.getContext();
aProcessData.setValue("primaryBusinessObject", part);
out.println("-------" + aProcessData.getNames().length);
aWfProcess = (wt.workflow.engine.WfProcess) wt.fc.PersistenceHelper.manager.save(aWfProcess);
aWfProcess = wt.workflow.engine.WfEngineHelper.service.startProcess(aWfProcess,
aProcessData, 3);
hope it helps !!!
Thanks
Shreyas