Just like entity event condition actions, services can be interlinked by the event condition action model. On the service level these are referred to as Service Event Condition Actions (SECAs). SECAs are defined inside service-eca definition files:
<?xml version="1.0" encoding="UTF-8"?> <service-eca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/service-eca.xsd"> <!-- Sample SECA--> <eca service="myService" event="return"> <condition field-name="myField" operator="equals" value="TEST"/> <action service="testService" mode="sync" run-as-user="system"/> </eca> </service-eca>
SECA Options
Tag | Attribute | Description |
---|---|---|
eca | service | Service name |
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:
|
|
run-on-failure | Continue with event, even if the operation that is triggering the event results in a failed state.
Available Options:
|
|
condition | field-name | Field to be validated |
map-name | Validate an input map as an alternative to the field-name | |
operator | Available options:
|
|
value | Field value | |
type | Object type (default:String) Available Options:
|
|
format | Format value before validation.
Available options:
|
|
condition-service | service-name | Service to be validated
This is rarely used. We recommend to rely on conditions instead. |
condition-field | field-name | Attribute name in context |
format | Format value before validation.
Available options:
|
|
map-name | Validate an input map as an alternative to the field-name | |
to-field-name | store result as a field | |
to-map-name | store result as a map | |
type | Object type (default:String) 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:
|
|
ignore-error | ignore errors thrown within the transaction | |
ignore-failure | ignore if transaction context is in a failed state | |
new-transaction | Run service in a new transaction | |
result-map-name | store result as a map | |
result-to-context | Store result in context
Available options:
|
|
persist | Restart action if attempt failed on first try.
Available options:
|
|
result-to-result | If true, copies the action’s result Map into the service’s result Map.
|
|
run-as-user | User used to perform the operation | |
result-to-value | Return operation result as value |