cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Launch a workflow from a JSP File

cbarboza
1-Visitor

Launch a workflow from a JSP File

Hi I need information about how can I launch a workflow from a JSP file.

Thanks

1 REPLY 1
satre-2
12-Amethyst
(To:cbarboza)

Use below API;s to start workflow process from JSP

Use below API;s to start workflow process from JSP

  1. 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

Announcements

Top Tags