java 代码
- JbpmContext
- is used to surround persistent operations to processes.
- Obtain JbpmContext's via {@link org.jbpm.JbpmConfiguration#createJbpmContext()}
- and put it in a try-finally block like this:
- JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
- * try {
- * TaskInstance taskInstance = ...
- *
- * ...do your process operations...
- *
- * // in case you update a process object that was not fetched
- * // with a ...ForUpdate method, you have to save it.
- * jbpmContext.save(processInstance);
- * finally {
- * jbpmContext.close();
- * }
- A JbpmContext separates jBPM from a sprecific environment.
- For each service that jBPM uses, there is an interface specified in the jBPM codebase.
- jBPM also includes implementations that implement these services by using services in a
- specific environment. e.g. a hibernate session, a JMS asynchronous messaging system, ...
- A JbpmContext can demarcate a transaction. When a PersistenceService is fetched from
- the JbpmContext, the default implementation for the persistence service will create
- a hibernate session and start a transaction. So that transactions can be configured
- in the hibernate configuration.
- A JbpmContext allows the user to overwrite (or make complete) the configuration
- by injecting objects programmatically. like e.g. a hibernate session factory or
- a hibernate session or any other resource that can be fetched or created from the
- configuration.
- Last but not least, JbpmContext provides convenient access to the most common
- operations such as {@link #getTaskList(String)}, {@link #newProcessInstance(String)}
- {@link #loadTaskInstanceForUpdate(long)} and {@link #save(ProcessInstance)}
- All the
...ForUpdate(...)
methods will automatically save the loaded - objects at
jbpmContext.close();
- main method:
- =======>getTaskList()
- =======>getCurrentJbpmContext()
- =======>getTaskList(String actorId)
- =======>getGroupTaskList(List actorIds)
- =======>getTaskInstance(long taskInstanceId)
- =======>getToken(long tokenId)
- =======>getProcessInstance(long processInstanceId)
- =======>newProcessInstance(String processDefinitionName)
- =======> save(ProcessInstance processInstance)
- =======>save(Token token)
- =======>save(TaskInstance taskInstance)
- =======>getTaskMgmtSession()
- =======>getActorId()
- =======>getContextSession()
- =======>getLoggingSession()
- =======>getJobSession()
- =======>getGraphSession()
- =======>getTaskMgmtSession()