public class Jbpm extends Object implements BPMS, Initialisable, Disposable
BPMS
interface for JBoss jBPM.Modifier and Type | Field and Description |
---|---|
protected boolean |
containerManaged
Indicates whether jBPM has been instantiated by Mule (false) or was
passed in from somewhere else (true).
|
protected static Logger |
log |
static int |
PROCESS_CREATION_WAIT
Given the multi-threaded nature of Mule, sometimes a response message will arrive to advance the
process before the creation of the process has fully terminated (e.g., during in-memory unit tests).
|
static String |
PROCESS_ENDED |
protected org.jbpm.api.ProcessEngine |
processEngine
The initialized jBPM ProcessEngine.
|
PHASE_NAME
PHASE_NAME
Constructor and Description |
---|
Jbpm()
Creates the Mule wrapper for jBPM
|
Jbpm(org.jbpm.api.ProcessEngine processEngine,
Properties processDefinitions)
Creates the Mule wrapper for jBPM
|
Jbpm(String configurationResource,
Properties processDefinitions)
Creates the Mule wrapper for jBPM
|
Modifier and Type | Method and Description |
---|---|
void |
abortProcess(Object processInstanceId)
Delete a process instance.
|
Object |
advanceProcess(Object executionId)
Advance a process instance one step.
|
Object |
advanceProcess(Object executionId,
Object signalName,
Map variables)
Advance a process instance one step.
|
void |
completeTask(org.jbpm.api.task.Task task) |
void |
completeTask(org.jbpm.api.task.Task task,
String outcome,
Map variables) |
void |
deployProcess(String processDefinitionFile)
Deploy (not start) a process to the BPMS based on a process definition file.
|
void |
deployProcessFromStream(String resourceName,
InputStream processDefinition) |
void |
dispose()
A lifecycle method where implementor should free up any resources.
|
String |
getConfigurationResource() |
Object |
getId(Object process) |
String |
getName()
Gets the name of the object
|
Properties |
getProcessDefinitions() |
org.jbpm.api.ProcessEngine |
getProcessEngine() |
Object |
getState(Object process) |
static String |
getState(org.jbpm.api.ProcessInstance processInstance) |
boolean |
hasEnded(Object process) |
void |
initialise()
Method used to perform any initialisation work.
|
boolean |
isProcess(Object obj) |
Object |
lookupProcess(Object processId)
Look up an already-running process instance.
|
void |
setConfigurationResource(String configurationResource) |
void |
setMessageService(MessageService msgService)
MessageService contains a callback method used to generate Mule messages from your process. |
void |
setName(String name)
Sets the name of the object
|
void |
setProcessDefinitions(Properties processDefinitions) |
void |
setProcessEngine(org.jbpm.api.ProcessEngine processEngine) |
Object |
startProcess(Object processDefinitionKey)
Start a new process.
|
Object |
startProcess(Object processDefinitionKey,
Object signalName,
Map variables)
Start a new process.
|
void |
undeployProcess(String resource)
Undeploy a process from the BPMS.
|
Object |
updateProcess(Object executionId,
Map variables)
Update the variables for an execution.
|
protected org.jbpm.api.ProcessEngine processEngine
protected boolean containerManaged
public static final String PROCESS_ENDED
public static final int PROCESS_CREATION_WAIT
protected static final Logger log
public Jbpm()
public Jbpm(String configurationResource, Properties processDefinitions)
configurationResource
- - The configuration file for jBPM, default is "jbpm.cfg.xml" if not specified.processDefinitions
- - A list of process definitions to load into jBPM upon initialization.public Jbpm(org.jbpm.api.ProcessEngine processEngine, Properties processDefinitions)
processEngine
- The already-initialized jBPM ProcessEngine. This is
useful if you use Spring to configure your jBPM instance.public void initialise()
Initialisable
InitialisationException
should be thrown,
causing the Mule instance to shutdown. If the error is recoverable, say by
retrying to connect, a RecoverableException
should be thrown.
There is no guarantee that by throwing a Recoverable exception that the Mule
instance will not shut down.initialise
in interface Initialisable
public void dispose()
Disposable
dispose
in interface Disposable
public void setMessageService(MessageService msgService)
BPMS
MessageService
contains a callback method used to generate Mule messages from your process.
This method is REQUIRED.setMessageService
in interface BPMS
msgService
- An interface within Mule which the BPMS may call to generate
Mule messages.public Object startProcess(Object processDefinitionKey) throws Exception
Exception
public Object startProcess(Object processDefinitionKey, Object signalName, Map variables) throws Exception
startProcess
in interface BPMS
processDefinitionKey
- - the type of process to startvariables
- - optional process variables/parameters to setException
public Object advanceProcess(Object executionId) throws Exception
Exception
public Object advanceProcess(Object executionId, Object signalName, Map variables) throws Exception
advanceProcess
in interface BPMS
variables
- - optional process variables/parameters to setexecutionId
- - an ID which identifies the running processsignalName
- - optionally specify which transition to take from the
current stateException
public Object updateProcess(Object executionId, Map variables) throws Exception
updateProcess
in interface BPMS
executionId
- - an ID which identifies the running processvariables
- - process variables/parameters to setException
public void abortProcess(Object processInstanceId) throws Exception
abortProcess
in interface BPMS
processInstanceId
- - an ID which identifies the running processException
public static String getState(org.jbpm.api.ProcessInstance processInstance) throws Exception
Exception
public Object lookupProcess(Object processId) throws Exception
lookupProcess
in interface BPMS
Exception
public void deployProcess(String processDefinitionFile) throws IOException
BPMS
deployProcess
in interface BPMS
processDefinitionFile
- - process definition fileIOException
public void deployProcessFromStream(String resourceName, InputStream processDefinition) throws IOException
IOException
public void undeployProcess(String resource) throws Exception
BPMS
undeployProcess
in interface BPMS
resource
- - process definition fileException
public void completeTask(org.jbpm.api.task.Task task)
public org.jbpm.api.ProcessEngine getProcessEngine()
public void setProcessEngine(org.jbpm.api.ProcessEngine processEngine)
public String getConfigurationResource()
public void setConfigurationResource(String configurationResource)
public Properties getProcessDefinitions()
public void setProcessDefinitions(Properties processDefinitions)
public void setName(String name)
NameableObject
setName
in interface NameableObject
name
- the name of the objectpublic String getName()
NamedObject
getName
in interface NamedObject
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.