public String toString() { return "sub-process["+subProcessInstance.getId()+"]"; }
public String toString() { return "sub-process["+subProcessInstance.getId()+"]"; }
private void flushToProcessInstance(org.jbpm.graph.exe.ProcessInstance processInstance) { log.debug( "flushing to process instance: " + processInstance.getId() ); ContextInstance contextInstance = processInstance.getContextInstance(); for ( Map.Entry<String, Object> entry: additions.entrySet() ) { contextInstance.setVariable( entry.getKey(), entry.getValue() ); } for ( String name: removals ) { contextInstance.deleteVariable(name); } }
public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof ProcessInstance)) return false; ProcessInstance other = (ProcessInstance) o; if (id != 0 && id == other.getId()) return true; return key != null && key.equals(other.getKey()) && processDefinition.equals(other.getProcessDefinition()); }
public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof ProcessInstance)) return false; ProcessInstance other = (ProcessInstance) o; if (id != 0 && id == other.getId()) return true; return key != null && key.equals(other.getKey()) && processDefinition.equals(other.getProcessDefinition()); }
protected ProcessInstance saveAndReload(ProcessInstance pi) { jbpmContext.save(pi); newTransaction(); return graphSession.loadProcessInstance(pi.getId()); }
protected ProcessInstance saveAndReload(ProcessInstance pi) { jbpmContext.save(pi); newTransaction(); return graphSession.loadProcessInstance(pi.getId()); }
private static void initProcessAndTask(TaskInstance task) { BusinessProcess businessProcess = BusinessProcess.instance(); businessProcess.setProcessId( task.getProcessInstance().getId() ); businessProcess.setTaskId( task.getId() ); }
protected void cancelProcess(long processIdToCancel) { ProcessInstance pi = jbpmContext.getGraphSession().loadProcessInstance(processIdToCancel); log.info("cancel process instance " + pi.getId()); // Record a standardized variable that we can use to determine that this // process has been 'canceled' and not just ended. pi.getContextInstance().createVariable(CANCELLATION_INDICATOR_VARIABLE_NAME, Clock.getCurrentTime()); try { // End the process instance and any open tokens // TODO: Think about maybe canceling sub processes? cancelToken(pi.getRootToken()); pi.end(); log.info("finished process cancellation"); } catch (RuntimeException ex) { log.error("problems while cancel process", ex); throw ex; } }
protected void cancelProcess(long processIdToCancel) { ProcessInstance pi = jbpmContext.getGraphSession().loadProcessInstance(processIdToCancel); log.info("cancel process instance " + pi.getId()); // Record a standardized variable that we can use to determine that this // process has been 'canceled' and not just ended. pi.getContextInstance().createVariable(CANCELLATION_INDICATOR_VARIABLE_NAME, Clock.getCurrentTime()); try { // End the process instance and any open tokens // TODO: Think about maybe canceling sub processes? cancelToken(pi.getRootToken()); pi.end(); log.info("finished process cancellation"); } catch (RuntimeException ex) { log.error("problems while cancel process", ex); throw ex; } }
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); }
new Long(arrivingToken.getProcessInstance().getId()), lockMode);
new Long(arrivingToken.getProcessInstance().getId()), lockMode);
/** * 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; } }