Post Processing Tool - start new process with variable from form
Confluence User - 25 Mar, 2016
Hi Experts,
In the form I have Select box with 3 different options (Created, Inprogress, Closed) - it's variable workflow "status". .
I'm using Post Processing Tool option after create/update form to run "process1" based on Bean Shell
Programming Guide#UseasProcessTool. - below piece of code.
Unfortunately variable workflow "status" from the form is not visible and is not taken into consideration in the process, which causing process end already at the route point.
- How can I modify existing java code to take as variable field from test_send_email.status ?
- Any other option to make it? I don't want to add form to the below process - as this is only example and will be used for different purposes.
The goal is to call a new process after form creation/update which will be sending email based on variable from that form.
APP_test_email-1-20160324232122.jwa
importjava.util.Map;importjavax.servlet.http.HttpServletRequest;importorg.joget.apps.app.model.AppDefinition;importorg.joget.apps.app.service.AppService;importorg.joget.apps.app.service.AppUtil;importorg.joget.workflow.model.service.WorkflowManager;importorg.joget.workflow.model.WorkflowAssignment;importorg.joget.workflow.model.WorkflowProcess;publicObject execute(WorkflowAssignment assignment, AppDefinition appDef, HttpServletRequest request) {AppService appService = (AppService) AppUtil.getApplicationContext().getBean("appService");WorkflowManager workflowManager = (WorkflowManager) AppUtil.getApplicationContext().getBean("workflowManager");//get current record idString recordId = appService.getOriginProcessId(assignment.getProcessId());//get processWorkflowProcess process = appService.getWorkflowProcessForApp(appDef.getAppId(), appDef.getVersion().toString(),"process1");//start processworkflowManager.processStart(process.getId(),null,null,null, recordId,false);returnnull;}//call execute method with injected variablereturnexecute(workflowAssignment, appDef, request);
email;javascript


