Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
<service name="userLogin" engine="java" location="org.ofbiz.commonapp.security.login.LoginServices" invoke="userLogin">
    <description>Authenticate a username/password; create a UserLogin object</description>
    <attribute name="login.username" type="String" mode="IN"/>
    <attribute name="login.password" type="String" mode="IN"/>
    <attribute name="userLogin" type="org.ofbiz.entity.GenericValue" mode="OUT" optional="true"/>
</service>

SERVICE ELEMENT

...

Attribute

Required?

Description

Default Value

name

Y

The unique name of the service.

 

engine

Y

The name of the engine (defined in serviceengine.xml).

 

location

N

The location or package of the service's class.

 

invoke

N

The method name of the service.

 

auth

N

Does this service require authorization? (true/false)

true

debug

N

Enable verbose debugging when calling this service?

true

default-entity-name

N

The default Entity to use for auto-attributes

 

export

N

Is this service allowed to be accessed via SOAP/HTTP/JMS? (true/false)

false

max-retry

N

Sets the max number of times this service will retry when failed (persisted async only)

-1 (unlimited)

require-new-transaction

N

Require a new transaction for this service

true

semaphore

N

Defines how concurrent calls to this service should be handled:
none: multiple calls to this service may run concurrently
wait: while this service is running, queue any subsequent calls
fail: while this service is running, fail any subsequent calls

none

semaphore-wait-seconds

N

When semaphore="wait" how many seconds to wait before failing the service call

300

sempahore-sleep

N

When semaphore="wait" how often (in milliseconds) to check if the waiting service call can be run

500

transaction-timeout

N

Override the default transaction timeout, only works if we start the transaction

0 (Use system default)

use-transaction

N

Create a transaction for this service (if one is not already in place)

true

validate

N

Do we validate the attributes found below for name and type matching? (true/false)

true

IMPLEMENTS ELEMENT

...

  • service - The name of the service which this service implements. All attributes are inherited

ATTRIBUTE ELEMENT

...

  • name - The name of this attribute
  • type - The object type (String, java.util.Date, etc.)
  • mode - Is this an input or output parameter or both (IN/OUT/INOUT)
  • optional - Is this parameter optional (true/false)*underlined values are defaults

...

Code Block
    <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>

...

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

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.

...

Code Block
<service-group>
    <group name="testGroup" send-mode="all">
        <invoke name="testScv" mode="sync"/>
        <invoke name="testBsh" mode="sync"/>
    </group>
</service-group>

...

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.

...

Invoke tag

Attribute Name

Required?

Description

name

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 false.

...