java 代码
- configuration of one jBPM instance
- During process execution, jBPM might need to use some services.
- A JbpmConfiguration contains the knowledge on how to create those services.
- A JbpmConfiguration is a thread safe object and serves as a factory for
- {@link org.jbpm.JbpmContext}s, which means one JbpmConfiguration
- can be used to create {@link org.jbpm.JbpmContext}s for all threads.
- The single JbpmConfiguration can be maintained in a static member or
- in the JNDI tree if that is available.
- A JbpmConfiguration can be obtained in following ways:
- from a resource (by default
jbpm.cfg.xml
is used): - JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
- or
- String myXmlResource = "...";
- JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance(myXmlResource);
- from an XML string:
- JbpmConfiguration jbpmConfiguration = JbpmConfiguration.parseXmlString(
- "<jbpm-configuration></jbpm-configuration>" +
- ...
- ""
- By specifying a custom implementation of an object factory. This can be
- used to specify a JbpmConfiguration in other bean-style notations such as
- used by JBoss Microcontainer or Spring.
- ObjectFactory of = new MyCustomObjectFactory();
- JbpmConfiguration.Configs.setDefaultObjectFactory(of);
- JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
- jbpmConfigurations can be configured using a spring-like XML notation
- (in relax ng compact notation):
- main method:
- ========>createSchema()
- ========>dropSchema()
- ========>createJbpmContext()
- ========>getCurrentJbpmContext()