/** * Associate the process instance with the given id with the * current conversation. * * @param processId the jBPM process instance id * @return true if the process was found and was not ended */ public boolean resumeProcess(Long processId) { setProcessId(processId); ProcessInstance process = org.jboss.seam.bpm.ProcessInstance.instance(); return afterResumeProcess(processId, process); }
private static void initProcessAndTask(TaskInstance task) { BusinessProcess businessProcess = BusinessProcess.instance(); businessProcess.setProcessId( task.getProcessInstance().getId() ); businessProcess.setTaskId( task.getId() ); }
private void afterCreateProcess(String processDefinitionName, ProcessInstance process, boolean shouldSignalProcess) { setProcessId( process.getId() ); // need to set process variables before the signal Contexts.getBusinessProcessContext().flush(); if (shouldSignalProcess) { process.signal(); } Events.instance().raiseEvent("org.jboss.seam.createProcess." + processDefinitionName); }
private static void initProcessAndTask(ExecutionContext context) { BusinessProcess businessProcess = BusinessProcess.instance(); businessProcess.setProcessId( context.getProcessInstance().getId() ); TaskInstance taskInstance = context.getTaskInstance(); if (taskInstance!=null) { businessProcess.setTaskId( taskInstance.getId() ); } }
/** * Associate the process instance with the given business key * with the current conversation. * * @param processDefinition the jBPM process definition name * @param key the jBPM process instance key * @return true if the process was found and was not ended */ public boolean resumeProcess(String processDefinition, String key) { ProcessDefinition definition = ManagedJbpmContext.instance().getGraphSession().findLatestProcessDefinition(processDefinition); ProcessInstance process = definition==null ? null : ManagedJbpmContext.instance().getProcessInstanceForUpdate(definition, key); if (process!=null) setProcessId( process.getId() ); return afterResumeProcess(key, process); }
/** * Associate the task instance with the given id with the current * conversation. * * @param taskId the jBPM task instance id * @return true if the task was found and was not ended */ public boolean resumeTask(Long taskId) { setTaskId(taskId); TaskInstance task = org.jboss.seam.bpm.TaskInstance.instance(); if (task==null) { taskNotFound(taskId); return false; } else if ( task.hasEnded() ) { taskEnded(taskId); return false; } else { setProcessId( task.getTaskMgmtInstance().getProcessInstance().getId() ); Events.instance().raiseEvent("org.jboss.seam.initTask." + task.getTask().getName()); return true; } }