Entity Event Condition Actions (EECAs) are actions that are triggered by events on the database level. You can be quite specific as to what the event actually is (like before during or after an update has been performed on a particular row of a table) and how the action is going to be:
<?xml version="1.0" encoding="UTF-8"?> <entity-eca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entity-eca.xsd"> <!-- Inventory Issue ECAs for Immediately Fulfilled Orders --> <eca entity="MyEntity" operation="create-store" event="return"> <condition field-name="myParameter" operator="is-not-empty"/> <action service="checkUpdateQuoteStatus" mode="sync"/> </eca> </entity-eca>
EECA Options
Tag | Attribute | Description |
---|---|---|
eca | entity | Table name |
operation | Operation performed by the database.
Available options:
|
|
event | Time of event.
Available options:
|
|
run-on-error | Continue with event, even if the operation that is triggering the event results in error.
Available Options:
|
|
condition | field-name | Table field to be validated |
operator | Available options:
|
|
value | Field value | |
type | Object type (default:String) Available Options:
|
|
format | Format value before validation.
Available options:
|
|
set | field-name | Table field name |
env-name | Define variable name for this operation | |
format | Format value before storing as part of the variable.Available options:
|
|
value | variable value | |
action | service | Run service of name |
mode | Definition of when to call the service – synchronous or asynchronous
Available options:
|
|
abort-on-error | Abort the operation if an error occurs (affects entire transaction)
Available options:
|
|
persist | Restart action if attempt failed on first try.
Available options:
|
|
rollback-on-error | Rollback (revert) operation if an error occurs.
Available options:
|
|
run-as-user | User used to perform the operation | |
result-to-value | Return operation result as value | |
value-attr | if value-attr is specified the generic value object corresponding to the entity in question will be passed to the action service |