Used for handling process-related events in simple standard cases without writing Java code. It allows you to flexibly restrict process-editing rules and automatically executed operations in the configuration. Implemented by one or more rules in the process type configuration with the following structure:
onProcessEvent.{@inc:cnt}.events=<EVENTS>
onProcessEvent.{@cnt}.eventsExclude=<EVENTS_EXCLUDE>
# if the class if defined, then the rest of keys is not used
onProcessEvent.{@cnt}.class=<CLASS_NAME>
onProcessEvent.{@cnt}.doExpression=<DO_EXPRESSION>
# optional
onProcessEvent.{@cnt}.ifExpression=<IF_EXPRESSION>
onProcessEvent.{@cnt}.checkExpression=<CHECK_EXPRESSION>
onProcessEvent.{@cnt}.checkErrorMessage=<CHECK_ERROR_MESSAGE>
Where:
<EVENTS> - events handled by the rule, separated by semicolons; if the key is omitted, all events related to the given process type are processed;
<EVENTS_EXCLUDE> - events excluded from rule processing, separated by semicolons; if the key is omitted, no events are excluded;
<CLASS_NAME> - a Custom class implementing org.bgerp.app.event.iface.EventListener and performing all the logic;
<IF_EXPRESSION> - a JEXL condition expression that runs the <DO_EXPRESSION> when satisfied;
<CHECK_EXPRESSION> - a JEXL condition expression; if it evaluates to false, an error <CHECK_ERROR_MESSAGE> is generated and used only together with checkErrorMessage;
<CHECK_ERROR_MESSAGE> - the error text reported when the <CHECK_EXPRESSION> condition fails;
<DO_EXPRESSION> - the executed JEXL script.
| The previously used key commands is no longer supported and must be replaced with doExpression. |
The following events are supported in <EVENTS>:
| Event | Description | event class |
|---|---|---|
|
statusChanging:<STATUS_IDS> |
The process status is changing to one of the values whose IDs are specified as a comma-separated list in <STATUS_IDS> |
|
|
descriptionAdding |
Text is being added to the process description. |
|
|
descriptionChanging |
The process description is being changed in full. |
|
|
executorsChanging |
Process executors are being changed. |
|
|
linkAdding |
A link is being added to the process. |
|
|
linkRemoving |
A process link is being removed. |
|
|
paramChanging:<PARAM_IDS> |
A process parameter whose code is specified as a comma-separated list in <PARAM_IDS> is being changed. |
|
|
statusChanged:<STATUS_IDS> |
The process status has changed to one of the values whose IDs are specified as a comma-separated list in <STATUS_IDS> |
|
|
created |
Process was created. |
|
|
createFinished |
Process creation has been completed in the Wizard |
|
|
createdAsLink |
The process was created as linked to another process. |
|
|
removed |
Process was removed. |
|
|
descriptionAdded |
Text was added to the process description. |
|
|
descriptionChanged |
The process description was changed in full. |
|
|
executorsChanged |
Process executors were changed. |
|
|
linkAdded |
A link was added to the process. |
|
|
linkRemoved |
A process link was removed. |
|
|
messageAdded |
A new message was received in the process. |
|
|
paramChanged:<PARAM_IDS> |
A process parameter whose ID is specified as a comma-separated list in <PARAM_IDS> has changed. |
The *ing events differ from the *ed events in that they are generated before the data is written to the database.
Rules are checked in the order of their numbers. The first rule that emits a message interrupts the check and cancels the process-related change.
The JEXL processor receives Standard Process Context plus:
event - the event class, extending org.bgerp.event.base.UserEvent
Add the current user to executors and set the status to 40 when the process was created as linked to another process.
onProcessEvent.{@inc:cnt}.events=createdAsLink
onProcessEvent.{@cnt}.doExpression=addExecutors({user.getId()});setStatus(40, "")