Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Replace BeanShell by Groovy

...

Introduction
Anchor
introduction
introduction

Services are independent pieces of logic which when placed together process many different types of business requirements. Services can be of many different types: Workflow, Rules, Java, SOAP, BeanShellGroovy, etc. A service with the type Java is much like an event where it is a static method, however with the Services Framework we do not limit to web based applications. Services require input parameters to be in a Map and the results are returned in a Map as well. This is nice since a Map can be serialized and stored or passed via HTTP (SOAP).

...

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

...

Code Block
languagexml
<service name="createInvoiceContactMech" engine="entity-auto" invoke="create" default-entity-name="InvoiceContactMech">
    <description>Create a ContactMech for an invoice</description>
    <permission-service service-name="acctgInvoicePermissionCheck" main-action="CREATE"/>
    <auto-attributes include="pk" mode="IN" optional="false"/>
</service>

...


The entity-auto engine can implement the following Create operations:

...

ECA (Event Condition Action) is much like a trigger. When a service is called, a lookup is performed to see if any ECAs are defined for this event. Events include before authentication, before IN parameter validation, before actual service invocation, before OUT parameter validation, before transaction commit, or before the service returns. Next each condition in the ECA definition is evaluated and if all come back as true, each actionis action is performed. An action is just a service which must be defined to work with the parameters already in the service's context. There are no limit to the number of conditions or actions each ECA may define.

...