A.2. Environment Properties

As opposed to system properties, environment properties are passed to an individual KieSession, allowing you to control its behaviour independently on the rest of the deployment.

The properties available to you are the constants of the class org.kie.api.runtime.EnvironmentName.

A.2.1. Configuration

To set the environment properties on a KieSession, you can create a new session with an instance of the Environment or RuntimeEnvironment interface:

Setting Environment Property using Environment interface

Environment env = EnvironmentFactory.newEnvironment();
env.set(EnvironmentName.SAMPLE_PROPERTY, true);
kbase.newKieSession(null, env);

Setting Environment Property using RuntimeEnvironment interface

RuntimeEnvironment environment = RuntimeEnvironmentBuilder.Factory.get()
.newDefaultBuilder()
....

environment.getEnvironment().set(EnvironmentName.SAMPLE_PROPERTY, true);
singletonManager = RuntimeManagerFactory.Factory.get().newSingletonRuntimeManager(environment);

A.2.2. List of Environment Properties

This section contains the alphabetically sorted list of all recognized environment properties in Red Hat JBoss BPM Suite 6.3.

Red Hat JBoss BPM Suite Environment Properties

APP_SCOPED_ENTITY_MANAGER

The entity manager used for persistence of SessionInfo. You can specify it when using Spring with local transactions and a shared entity manager.

ValuesDefault

An instance of EntityManager

Automatically created from the provided EntityManagerFactory

CALENDARS
This property is not used.
CMD_SCOPED_ENTITY_MANAGER

The entity manager used for persistence of entities (process instances, tasks, work items). You can specify it when using Spring with local transactions and a shared entity manager.

ValuesDefault

An instance of EntityManager

Automatically created from the provided EntityManagerFactory

DATE_FORMATS
This property is not used.
ENTITY_MANAGER_FACTORY

The EntityManagerFactory used in the Red Hat JBoss BPM Suite engine.

ValuesDefault

An instance of EntityManagerFactory

N/A

GLOBALS
ValuesDefault

Any object declared in DRL or BPMN

N/A

OBJECT_MARSHALLING_STRATEGIES

Enable use of pluggable variable persistence strategies. Allows storing variables in different data stores.

ValuesDefault

An instance of org.kie.api.marshalling.ObjectMarshallingStrategy

Dependent on the engine configuration. If no other strategy is available, org.drools.core.marshalling.impl.SerializablePlaceholderResolvingStrategy is used.

PERSISTENCE_CONTEXT_MANAGER

The ProcessPersistenceContextManager instance used for process persistence.

ValuesDefault

An instance of org.jbpm.persistence.ProcessPersistenceContextManager

An instance of org.jbpm.persistence.JpaProcessPersistenceContextManager

TASK_PERSISTENCE_CONTEXT_MANAGER

The TaskPersistenceContextManager instance used for task persistence.

ValuesDefault

An instance of org.kie.internal.task.api.TaskPersistenceContextManager

An instance of org.jbpm.services.task.persistence.JPATaskPersistenceContextManager

TASK_USER_GROUP_CALLBACK

Get the UserGroupCallback instance from the environment or context. For example:

callback = context.get(EnvironmentName.TASK_USER_GROUP_CALLBACK)
ValuesDefault

Configured by Red Hat JBoss BPM Suite

An instance of org.kie.internal.task.api.UserGroupCallback

TASK_USER_INFO

Get the UserInfo instance from the environment or context. For example:

info = context.get(EnvironmentName.TASK_USER_INFO)
ValuesDefault

Configured by Red Hat JBoss BPM Suite

An instance of org.kie.internal.task.api.UserInfo

TRANSACTION

Optional property if UserTransaction can not be obtained using JNDI lookup.

ValuesDefault

An instance of UserTransaction

null

TRANSACTION_MANAGER

Get the TransactionManager instance from the environment or context. For example:

info = context.get(EnvironmentName.TRANSACTION_MANAGER)
ValuesDefault

An instance of TransactionManager

Depends on your configuration

TRANSACTION_SYNCHRONIZATION_REGISTRY

Allows access to and control of the active transaction. Used by Red Hat JBoss BPM Suite to efficiently manage persistence.

ValuesDefault

An instance of TransactionSynchronizationRegistry

Taken from the environment—​usually JNDI lookup in JTA environments

USE_LOCAL_TRANSACTIONS

When enabled, Red Hat JBoss BPM Suite uses local transactions as opposed to JTA.

ValuesDefault

true or false

false

USE_PESSIMISTIC_LOCKING

When enabled, a database resource can only be accessed by one transaction at a time.

ValuesDefault

true or false

false