Value Store Loading
Introduction
When the Process Engine updates a Process Instance, its Value Store is loaded when a Token is moved from one Process element to another. This happens because new scopes that define new variables and other elements must be created. Therefore, loading the Value Store while the Token is moving within the Process is a necessity and cannot be prevented.
However, there are cases where the Value Store is loaded, even though no Token is modified or moved. These cases should be prevented, because loading the Value Stores is expensive in terms of memory use. Note that, generally, Value Stores are loaded each time a script (such as $a or any other script of arbitrary complexity) is executed.
For Tokens that are located on elements listed in the following sections, the Value Store is loaded in all the cases where the properties of the described element are defined, even though the Token may not be moved.
Conditional Intermediate Event / Activity with Attached Conditional Event
- Condition expression
Every time the Process Engine updates a Process Instance, the Value Store is accessed to evaluate the condition.
- Suggestion/Workaround: Avoid using conditional events whenever possible.
Message Receive Intermediate Event / Activity with Attached Message Receive Event
- Dynamic queue name: Every time the Process Engine updates a Process Instance, the Value Store is accessed to evaluate the queue name.
- Suggestion/Workaround: Use static queue names.
- Filter expression: Every time the Process Engine updates a Process Instance and there is a "new" message in the queue, the Value Store is loaded to evaluate the filter expression. A "new" message is a message that has arrived since the last time the Process Instance was checked.
- Suggestion/Workaround: Avoid using filter expressions if possible. Use messages directed to a specific Process Instance instead. Avoid using a single queue for many purposes, for example, do not use only the default queue for all types of (unrelated) messages in a solution. Use a dedicated queue for each case.
Signal Receive Intermediate Event / Activity with Attached Signal Receive Event
- Dynamic signal name: Every time when the Process Engine updates the Process Instance and a "new" signal has been sent since the last check of the Process Instance, the Value Store is loaded to evaluate the signal name.
- Suggestion/Workaround: Use static signal names.
Complex Gateways
- Join expression: Every time when the Process Engine updates the Process Instance and there is already at least one Token “waiting to pass” the complex gateway, the Value Store is accessed to evaluate the join expression. Note that in this case, as opposed to the previous cases, the Token is not located on the complex gateway, but on an incoming connection.
See Complex Gateways.
- Suggestion/Workaround: Avoid the use of complex gateways to join multiple Process flows. Use a combination of other simple gateways to build the same logic.