|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.diversit.jbpm.spring.JbpmProcessBean
public class JbpmProcessBean
Spring bean instance of a JBPM4 process.
This bean automatically connects to a ProcessEngine.
The process is automatically deployed when the bean is initialized and it undeploys the process before it is destroyed.
It provides convinience methods to JBPM4 resources like ProcessEngine, ExecutionService and RepositoryService.
It provides convinience methods to start an instances of the process. Multiple process instances can be running at the same time.
This bean does not maintain a list or state of started processes. That is the responsibility of JBPM.
This bean does hold the process deployment id so it is not necessary to provide this when starting an process instance.
It is the responsibility of the calling code to do something with the ProcessInstance if it's necessary.
If needed a ProcessInstance can be looked by querying JBPM via a service.
| Constructor Summary | |
|---|---|
JbpmProcessBean()
|
|
| Method Summary | |
|---|---|
void |
destroy()
Unregister process when bean is destroyed. |
java.lang.String |
getDeploymentId()
|
java.lang.String |
getProcessKey()
|
java.lang.String |
getResourceName()
|
java.lang.Object |
getVariable(java.lang.String processExecutionId,
java.lang.String variableName)
|
java.util.Set<java.lang.String> |
getVariableNames(java.lang.String processExecutionId)
|
java.util.Map<java.lang.String,java.lang.Object> |
getVariables(java.lang.String processExecutionId,
java.util.Set<java.lang.String> variableNames)
|
void |
initialize()
Deploy process when bean is initialized. |
void |
setProcessKey(java.lang.String processKey)
|
void |
setResourceName(java.lang.String resourceName)
|
org.jbpm.api.ProcessInstance |
startProcessInstance()
Start a new process. If a processKey was provided in the Spring configuration, the key will be used to create a process. |
org.jbpm.api.ProcessInstance |
startProcessInstanceWithKey(java.lang.String businessKey)
Start a new process instance using a business key. If a processKey was provided in the Spring configuration, the key will be used to create a process. |
org.jbpm.api.ProcessInstance |
startProcessInstanceWithKeyAndVariables(java.lang.String businessKey,
java.util.Map<java.lang.String,java.lang.Object> variables)
Start a new process instance using a business key and variables. If a processKey was provided in the Spring configuration, the key will be used to create a process. |
org.jbpm.api.ProcessInstance |
startProcessInstanceWithVariables(java.util.Map<java.lang.String,java.lang.Object> variables)
Start a new process instance using variables. If a processKey was provided in the Spring configuration, the key will be used to create a process. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JbpmProcessBean()
| Method Detail |
|---|
@PostConstruct @Transactional public void initialize()
@PreDestroy public void destroy()
public org.jbpm.api.ProcessInstance startProcessInstance()
ProcessInstancepublic org.jbpm.api.ProcessInstance startProcessInstanceWithKey(java.lang.String businessKey)
businessKey - Custom key by which this process can be tracked
ProcessInstancepublic org.jbpm.api.ProcessInstance startProcessInstanceWithVariables(java.util.Map<java.lang.String,java.lang.Object> variables)
variables - Custom variables necessary for the process.
ProcessInstancealso {@link #startProcessInstanceWithKeyAndVariables(String, Map)}
public org.jbpm.api.ProcessInstance startProcessInstanceWithKeyAndVariables(java.lang.String businessKey,
java.util.Map<java.lang.String,java.lang.Object> variables)
NOTE: Because the process is running in a Spring environment, the process is able to lookup Spring managed beans. It is therefore not necessary to pass Spring components as variables to the process. It can be done however to override a Spring component since the variables Map is searched before the Spring environement.
businessKey - Custom key by which this process can be trackedvariables - Custom variables necessary for the process.
ProcessInstance
public java.lang.Object getVariable(java.lang.String processExecutionId,
java.lang.String variableName)
processExecutionId - Execution id of a processvariableName - name of variable for which to lookup the value
ExecutionService.getVariable(String, String)public java.util.Set<java.lang.String> getVariableNames(java.lang.String processExecutionId)
processExecutionId -
ExecutionService.getVariableNames(String)
public java.util.Map<java.lang.String,java.lang.Object> getVariables(java.lang.String processExecutionId,
java.util.Set<java.lang.String> variableNames)
processExecutionId - variableNames -
ExecutionService.getVariables(String, Set)public java.lang.String getResourceName()
public void setResourceName(java.lang.String resourceName)
public java.lang.String getProcessKey()
public void setProcessKey(java.lang.String processKey)
public java.lang.String getDeploymentId()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||