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

Launch a workflow from a JSP File

Highlighted
Newbie

Launch a workflow from a JSP File

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

Thanks

Tags (1)
1 REPLY 1

Re: Launch a workflow from a JSP File

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

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum! ______________________________ Check out the Windchill Tips Board! We're talking about Whirlpool's use of digital twin, augmented reality, and data-driven design!

The NAVIGATE WORKING GROUP is here! Come innovate with PTC!

Sign up for a Working Group