...
Code Block |
---|
<service-eca>
<eca service="testScv" event="commit">
<condition field-name="message" operator="equals" value="12345"/>
<action service="testBsh" mode="sync"/>
</eca>
</service-eca>
A tip from Parimal Gain : Note that you may use the set operation to rename a parameter for the triggered service or insert values for instance...
|
<eca service="setCustRequestStatus" event="commit">
<condition field-name="oldStatusId" operator="not-equals" value="CRQ_ACCEPTED"/>
<condition field-name="statusId" operator="equals" value="CRQ_ACCEPTED"/>
<set field-name="bodyParameters.custRequestId" env-name="custRequestId"/>
<set field-name="bodyParameters.custRequestName" env-name="custRequestName"/>
<set field-name="partyIdTo" env-name="fromPartyId"/>
<set field-name="emailTemplateSettingId" value="CUST_REQ_ACCEPTED"/>
<action service="sendMailFromTemplateSetting" mode="sync" />
</eca>
Code Block |
---|
eca |
...
tag:
| *Attribute Name* | *Required?* | *Description* |
| service | Y | The name of the service this ECA is attached to. |
| event | Y | The event on which this ECA will run can be (before): auth, in-validate, out-validate, invoke, commit, or return. |
| run-on-error | N | Should this ECA run if there is an error in the service (default +false+) |
The eca element should also have 0 or more condition or condition-fieldelements and 1 or more action elements.
condition tag
| *Attribute Name* | *Required?* | *Description* |
| map-name | N | The name of the service context field that contains the map that the field to be validated will come from. If not specified the field-name will be treated as a service context field name (an env-name). |
| field-name | Y | The name of the map field that will be compared. |
| operator | Y | Specified the comparison operator must be one of the following: less, greater, less-equals, greater-equals, equals, not-equals, or contains. |
| value | Y | The value that the field will compared to. Must be a String, but can be converted to other types. |
| type | N | The data type to use for the comparison. Must be one of the following: String, Double, Float, Long, Integer, Date, Time, or Timestamp. If no type is specified the default will be String. |
| format | N | A format specifier to use when converting String objects to other data types, mainly Date, Time and Timestamp. |
condition-field tag
| *Attribute Name* | *Required?* | *Description* |
| map-name | N | The name of the service context field that contains the map that the field to be validated will come from. If not specified the field-name will be treated as a method environment field name (an env-name). |
| field-name | Y | The name of the map field that will be compared. |
| operator | Y | Specified the comparison operator must be one of the following: less, greater, less-equals, greater-equals, equals, not-equals, or contains. |
| to-map-name | N | The name of the service context field that contains the map that the field to be compared will come from. If left empty will default to the map-name, or the method environment if map-name is also unspecified. |
| to-field-name | N | The name of the to-map field that the main field will be compared to. If left empty will default to the field-name. |
| type | N | The data type to use for the comparison. Must be one of the following: String, Double, Float, Long, Integer, Date, Time, or Timestamp. If no type is specified the default will be String. |
| format | N | A format specifier to use when converting String objects to other data types, mainly Date, Time and Timestamp. |
action tag
| *Attribute Name* | *Required?* | *Description* |
| service | N | The name of the service this action will invoke. |
| mode | Y | The mode in which this service should be invoked. Can be sync or async. Note that async actions will not update the context even when set to true. |
| result-to-context | N | Should the results of the action service update the main service's context. Default true. |
| result-to-result | N | Should the results of the action service update the main service's results. If true, the action service's messages will be appended to the main service's messages. Default false. |
| ignore-error | N | Ignore any errors caused by the action service. If true the error will cause the original service to fail. Default true. |
| persist | N | The action service store / run. Can be true or false. Only effective when mode is async. Default false. |
----
h3. Service Groups{anchor:serviceGroups}
----
Service groups are a set of services which should run when calling the initial service. You define a service using the group service engine, and include all the parameters/attributes needed for all the services in the group. The location attribute is not needed for groupservices, the invoke attribute defines the name of the groupto run. When this service is invoked the group is called and the services defined in the group are called as defined.
The group definition is very simple, it contains a group elements along with 1 or more service elements. The group element contains a name attribute and a modeattribute used to define how the group will function. The service element is much like the actionelement in an ECA, the difference being the default value for result-to-context.
|
<service-group>
<group name="testGroup" send-mode="all">
<invoke name="testScv" mode="sync"/>
<invoke name="testBsh" mode="sync"/>
</group>
</service-group>
Code Block |
---|
Attribute Name | Required? | Description |
service | Y | The name of the service this ECA is attached to. |
event | Y | The event on which this ECA will run can be (before): auth, in-validate, out-validate, invoke, commit, or return. |
run-on-error | N | Should this ECA run if there is an error in the service (default false) |
The eca element should also have 0 or more condition or condition-fieldelements and 1 or more action elements.
condition tag
Attribute Name | Required? | Description |
map-name | N | The name of the service context field that contains the map that the field to be validated will come from. If not specified the field-name will be treated as a service context field name (an env-name). |
field-name | Y | The name of the map field that will be compared. |
operator | Y | Specified the comparison operator must be one of the following: less, greater, less-equals, greater-equals, equals, not-equals, or contains. |
value | Y | The value that the field will compared to. Must be a String, but can be converted to other types. |
type | N | The data type to use for the comparison. Must be one of the following: String, Double, Float, Long, Integer, Date, Time, or Timestamp. If no type is specified the default will be String. |
format | N | A format specifier to use when converting String objects to other data types, mainly Date, Time and Timestamp. |
condition-field tag
Attribute Name | Required? | Description |
map-name | N | The name of the service context field that contains the map that the field to be validated will come from. If not specified the field-name will be treated as a method environment field name (an env-name). |
field-name | Y | The name of the map field that will be compared. |
operator | Y | Specified the comparison operator must be one of the following: less, greater, less-equals, greater-equals, equals, not-equals, or contains. |
to-map-name | N | The name of the service context field that contains the map that the field to be compared will come from. If left empty will default to the map-name, or the method environment if map-name is also unspecified. |
to-field-name | N | The name of the to-map field that the main field will be compared to. If left empty will default to the field-name. |
type | N | The data type to use for the comparison. Must be one of the following: String, Double, Float, Long, Integer, Date, Time, or Timestamp. If no type is specified the default will be String. |
format | N | A format specifier to use when converting String objects to other data types, mainly Date, Time and Timestamp. |
action tag
Attribute Name | Required? | Description |
service | N | The name of the service this action will invoke. |
mode | Y | The mode in which this service should be invoked. Can be sync or async. Note that async actions will not update the context even when set to true. |
result-to-context | N | Should the results of the action service update the main service's context. Default true. |
result-to-result | N | Should the results of the action service update the main service's results. If true, the action service's messages will be appended to the main service's messages. Default false. |
ignore-error | N | Ignore any errors caused by the action service. If true the error will cause the original service to fail. Default true. |
persist | N | The action service store / run. Can be true or false. Only effective when mode is async. Default false. |
...
Service groups are a set of services which should run when calling the initial service. You define a service using the group service engine, and include all the parameters/attributes needed for all the services in the group. The location attribute is not needed for groupservices, the invoke attribute defines the name of the groupto run. When this service is invoked the group is called and the services defined in the group are called as defined.
The group definition is very simple, it contains a group elements along with 1 or more service elements. The group element contains a name attribute and a modeattribute used to define how the group will function. The service element is much like the actionelement in an ECA, the difference being the default value for result-to-context.
Code Block |
---|
group tag
Attribute Name | Required? | Description |
name | Y | The name of the service this action will invoke. |
send-mode | N | The mode in which the service(s) should be invoked. The options are: none, all, first-available, random, or round-robin. The default is all. |
...