EECAs

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:

  • create
  • store
  • remove
  • find
  • create-store
  • create
  • remove
  • store-remove
  • create-store-remove
  • any
 event  Time of event.

Available options:

  • validate
  • run
  • return
  • cache-check
  • cache-put
  • cache-clear
 run-on-error Continue with event, even if the operation that is triggering the event results in error.

Available Options:

  • true
  • false
 condition field-name Table field to be validated
operator  Available options:

  • less
  • greater
  • less-equals
  • greater-equals
  • equals
  • not-equals
  • is-empty
  • is-not-empty
  • contains
value  Field value
type  Object type (default:String)
Available Options:

  • PlainString
  • String
  • BigDecimal
  • Double
  • Float
  • Long
  • Integer
  • Date
  • Time
  • Timestamp
  • Boolean
  • Object
format Format value before validation.

Available options:

  • append
  • to-upper
  • to-lower
  • hash-code
  • long
  • double
  • upper-
    first-char
  • lower-first-char
  • db-to-java
  • java-to-db
 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:

  • append
  • to-upper
  • to-lower
  • hash-code
  • long
  • double
  • upper-
    first-char
  • lower-first-char
  • db-to-java
  • java-to-db
 value variable value
 action service Run service of name
mode Definition of when to call the service – synchronous or asynchronous

Available options:

  • sync
  • async
abort-on-error Abort the operation if an error occurs (affects entire transaction)

Available options:

  • true
  • false
persist Restart action if attempt failed on first try.

Available options:

  • true
  • false
rollback-on-error Rollback (revert) operation if an error occurs.

Available options:

  • true
  • false
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