Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: edited the attributes of <make-value> because the map is optional (seen in different minilang scripts in OFBiz)
Alert
titleMini Lang Deprecated
typeWarning

According to the proposal thread in [1] we decided to deprecate mini lang. For additional information please refer to the corresponding issue [2].


[1] https://s.apache.org/iS8W

[2]

Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyOFBIZ-9350

Current Mini Language (minilang) Reference Guide (Version 3)

Mini-language Reference

The Apache Open For Business Project

Note

This is a draft document. It can be modified at any time by any committer. Comments on the draft should be made on the dev mailing list.

Grammar version 2 (http://ofbiz.apache.org/dtds/simple-methods-v2.xsd

...

)

...

Info

...

titleOlder versions

There are 2 older versions that you can find respectively at

Mini-Language Guide (Version 1 - Deprecated)

Mini-Language Guide (Version 2 - Deprecated)

 

Attributes

Attribute Types

Type

Description

Type

Description

Example

constant

A string constant. The string may not include an expression.

name="fooMethod"

constant+expr

A string constant. The string may include an expression, but an expression-only string is not allowed.

default="${foo}Method"

expression

A UEL expression without enclosing brackets.

from="item.quantity * item.priceEach"

${expression}

A UEL expression with enclosing brackets.

default="${parameters.itemId}"

script

A short script ("scriptlet").

script="groovy:foo.bar();"

 

The <simple-method> element

Section
Column
width20%
<simple-method>
Column
Contains a block of code.

A simple method can be called in either an event context from the Control
Servlet (or another event) or in a service context through the Service
Engine, or any other component that has access to a service dispatcher.

Code Block
xml
xml

<simple-method method-name="fooMethod">
  <!-- some mini-language code goes here -->
</simple-method>
Attributes

Name

Type

Requirements

Description

Note

method-name

optional

constant

required

A name (preferably a legal Java identifier) for this method.

Each simple method Each simple method in a file must have a unique name.

short-description

constant

optional

A short description of the method.

Used for documentation.

default-error-code

optional

 

default-success-code

optional

 

login-required

constant

optional

Require a user login to run this method.

Defaults to "true".

use-transaction

constant

optional

Create a transaction if none exists for this thread.

Defaults to "true".

default-error-code

constant

optional

The default error return code.

Defaults to "error".

default-success-code

constant

optional

The default success return code.

Defaults to "success".

parameter-map-name

optional

 

event-request-object-name

constant

optional 

The name of the field containing the javax.servlet.ServletRequest object.

Defaults to "request".

event-sessionresponse-object-name

constant

optional 

The name of the field containing the javax.servlet.ServletResponse object.

Defaults to "response".

event-responsesession-object-name

constant

optional 

The name of the field containing the javax.servlet.http.HttpSession object.

Defaults to "session".

event-response-code-name

optional

constant

optional

The name of the field containing the event response code.

Defaults to "_response_code_". 

event-error-message-name

constant

optional 

The name of the field containing the event error message.

Defaults to "_error_message_".

event-error-message-list-name

constant

optional

 

event-event-message-name

optional

The name of the field containing the event message list.

Defaults to "_error_message_list_". 

event-event-message-list-name

constant

optional

 

The name of the field containing the event message.

Defaults to "_event_message_".

event-eventservice-response-message-list-name

constant

optional 

The name of the field containing the event message list.

Defaults to "_event_message_list_".

service-errorresponse-message-name

constant

optional 

The name of the field containing the service response message.

Defaults to "responseMessage".

service-error-message-list-name

constant

optional 

The name of the field containing the service error message.

Defaults to "errorMessage".

service-error-message-maplist-name

constant

optional

 

service-success-message-name

optional

The name of the field containing the service error message list.

Defaults to "errorMessageList". 

service-successerror-message-listmap-name

constant

optional

 

login-required

optional

 

use-transaction

optional

 

locale-name

optional

 

delegator-name

optional

 

security-name

optional

 

dispatcher-name

optional

 

user-login-name

optional

 

Info
titleProposed Changes
  • Eliminate unused and seldom used attributes.
  • Currently, the method-name attribute is optional. Require the method-name attribute.

Assignment Operations

The name of the field containing the service error message map.

Defaults to "errorMessageMap".

service-success-message-name

constant

optional

The name of the field containing the service success message.

Defaults to "successMessage".

service-success-message-list-name

constant

optional

The name of the field containing the service success message list.

Defaults to "successMessageList".

 

Child Elements

Name

Requirements

 

(Any block of code)

optional

 

 

Assignment Operations

Assignment operations modify the script's state.

Section
Column
width20%
<add-error>
Column
Adds
Section
Column
width20%
<add-error>
Column
Adds
a message to the error message list.
Code Block
xml
xml

<add-error>
  <fail-message message="There was an error" />
</add-error>
Attributes

Name

Type

Requirements

Description

Note

error-list-name

constant

optional

The name of a list that will contain the message.

Default is Defaults to "error_list".

 

Child Elements

One of the following child elements is required:

Name

 

<fail-message>optional

(?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})

<fail-property>

optional

Info
titleProposed Changes

Currently, child elements are optional. Require one child element.

(?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})

  • Currently, the field attribute is optional. Require the field attribute.
  • Eliminate the map-name attribute
    Section
    Section
    Column
    width20%
    <clear
    <alt-
    field>
    permission>

    Attributes

    Column
    Declares an alternate permission (<check-permission> sub-element).

    Alternate permissions are checked when the primary permission check fails.

    Attributes

    Name

    Type

    Requirements

    Description

    Note

    permission

    constant, ${expression}

    required

    The permission to check.

     

    action

    constant, ${expression}

    optional

    The action to be performed (permission scope).

    Examples: "_ADMIN", "_CREATE", "_UPDATE"

    Removes a field from memory.
    Code Block
    xmlxml
    
    <clear-field field="foo" />
    

    field

    optional

    The name of the field to remove

    map-name

    optional

    The name of the map to remove

    Info
    titleProposed Changes

    .

    Section
    Column
    width20%
    <create-object>
    <assert>
    Create a new Java object.

    Attributes

    Column
    Code Block
    xmlxml
    
    <create-object field="foo" class-name="com.acme.FooClass">
      <string value="bar" />
      <field field="foo" />
    </create-object>
    

    field

    optional

    The name of the field for the new object

    class-name

    optional

    The Java class name

    Child Elements

    <field>

    optional

    <string>

    optional

    Info
    titleProposed Changes
    • Currently, both attributes are optional. Require both attributes.
    • Deprecate and replace with scriptlet
    Adds an error message to the error message list for each condition that evaluates to false.
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    title

    constant, ${expression}

    optional

    The title of the assert operation.

    The title is used in test reports.

    error-list-name

    constant

    optional

    The name of a list that will contain the message.

    Defaults to "error_list".

     

    Child Elements

    Name

     

    Any <condition> child element

    (?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})

    Section
    Column
    width20%
    <fail
    <check-
    message>
    id>
    Declares a message to be added to a message list.

    Attributes

    Column
    Code Block
    xmlxml
    
    <add-error>
      <fail-message message="There was an error" />
    </add-error>
    

    message

    optional

    The message text

    Info
    titleProposed Changes
    • Currently, the message attribute is optional. Require the message attribute.
    Section
    Column
    width20%
    <fail-property>
    Column
    Declares a property key that is used to add a message to a message list.
    Code Blockxmlxml
    
    <add-error>
      <fail-property resource="ErrorMessages" property="FooError" />
    </add-error>
    

    Attributes

    resource

    optional

    Name of the resource where the message can be found

    property

    optional

    The message property key

    Info
    titleProposed Changes
    • Currently, both attributes are optional. Require both attributes.
    Section
    Evaluates the specified field, and adds an error message to the error message list if the field's value is not a valid data source ID value.

    Valid IDs can be any sequence of characters or digits, but they must not contain the following characters: space [ ], double quote ["], single quote ['], ampersand [&], question mark [?], less-than sign [<]\, greater-than sign [>], forward-slash [/], back-slash [\ ].

    Attributes

    Name

    Type

    Requirements

    Description

    Note

    field

    expression

    optional

    The name of the field to test.

     

    error-list-name

    constant

    optional

    The name of a list that will contain the message.

    Defaults to "error_list".

     

    Child Elements

    One of the following child elements is required:

    Name

     

    <fail-message>

    (?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})

    <fail-property>

    (?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})

    Section
    Column
    width20%
    <check-permission>
    Column
    Checks if the user has the specified permission, and adds an error message to the error message list if the user does not have the specified permission.

    Note that this element must be followed by the <check-errors> element for it to do anything meaningful.

    Attributes

    Name

    Type

    Requirements

    Description

    Note

    permission

    constant, ${expression}

    required

    The permission to check.

     

    action

    constant, ${expression}

    optional

    The action to be performed (permission scope).

    Examples: "_ADMIN", "_CREATE", "_UPDATE".

    error-list-name

    constant

    optional

    The name of a list that will contain the message.

    Defaults to "error_list".

     

    Child Elements

    One or more of the following child element is optional:

    Name

     

    <alt-permission>

    (?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})

    One of the following child elements is required:

    Name

     

    <fail-message>

    (?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})

    <fail-property>

    (?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})

    Column
    width20%
    <field-to-list>
    Column
    Copies a field to a list.
    Code Blockxmlxml
    
    <field-to-list list="barList" field="foo" />
    

    Attributes

    list

    optional

    Name of the list. If the list does not exist, one is created.

    field

    optional

    The field to add to the list

    Info
    titleProposed Changes
    • Currently, both attributes are optional. Require both attributes.
    • Deprecate and replace with UEL expression.
    Section
    Column
    width20%
    <field-to-request>

    Attributes

    Column
    Copies a field to a servlet request attribute.
    Code Block
    xmlxml
    
    <field-to-request field="foo" request-name="fooAttribute" />
    

    field

    optional

    The name of the field to copy from

    request-name

    optional

    The name of the request attribute to copy to

    map-name

    optional

    The name of the map containing field

    Info
    titleProposed Changes
  • Currently, all attributes are optional. Require the field and request-name attributes.
  • Eliminate the map-name attribute.
  • Deprecate and replace with a UEL expression.

    Section
    Column
    width20%
    <field
    <clear-
    to-result>
    field>
    Column
    Copies a
    Sets the value of the specified field to
    a service OUT attribute
    null.
    Code Block
    xml
    xml
    
    <field-to-result<clear-field field="foo" result-name="fooAttribute" />
    
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    field

    expression

    requiredoptional

    The name of the field to copy from

    result-name

    optional

    The name of the service OUT attribute to copy to

    map-name

    optional

    The name of the map containing field

    Info
    titleProposed Changes
    • Currently, all attributes are optional. Require the field and result-name attributes.
    • Eliminate the map-name attribute.
    Section

    remove.

     

    Section
    Column
    width20%
    <create-object>
    Column
    Creates an instance of the specified class.

    The <string> and <field> sub-elements are passed to the constructor method as arguments in the order they are specified.
    A runtime exception will be thrown if the sub-elements do not match the constructor method arguments.

    Column
    width20%
    <field-to-session>
    Column
    Copies a field to a servlet session attribute.
    Code Block
    xml
    xml
    
    <field-to-session<create-object field="foo" sessionclass-name="fooAttribute"com.acme.FooClass">
      <string value="bar" />
    

    Attributes

      <field field="foo" />
    </create-object>
    
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    field

    expression

    required

    field

    optional

    The name of the field to copy from

    session-name

    optional

    The name of the session attribute to copy to

    map-name

    optional

    The name of the map containing field

    Info
    titleProposed Changes
    • Currently, all attributes are optional. Require the field and session-name attributes.
    • Eliminate the map-name attribute.
    • Deprecate and replace with a UEL expression.

    for the new object.

     

    class-name

    constant

    required

    The Java class name.

     

     

    Child Elements

    Name

    Requirements

     

    <field>

    optional

    (?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})

    <string>

    optional

    (?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})

    Warning

    Deprecated - use the <script> element.

    Section
    Column
    width20%
    <fail-message>
    Column
    Declares an error message
    Section
    Column
    width20%
    <first-from-list>
    Column
    Copies the first element in a list to a field. If the list is empty or not found, sets the field to null
    .
    Code Block
    xml
    xml
    
    <first-from-list entry-name="foo" list-name="fooList"<add-error>
      <fail-message message="There was an error." />
    </add-error>
    
    Attributes
    entry-name

    Name

    Type

    optional

    The name of the field to copy to

    list-name

    optional

    The name of the list to copy from

    Info
    titleProposed Changes

    Requirements

    Description

    Note

    message

    constant+expr

    required

    The message text.

     

  • Currently, both attributes are optional. Require both attributes.
  • Deprecate and replace with a UEL expression.

    Section
    Column
    width20%
    <list
    <fail-
    to-list>
    property>
    Column
    Copies list elements to another list. If the target list is not found, a new list is created
    Declares an error message found in a properties file.
    Code Block
    xml
    xml
    
    <list-to-list list-name="foo" to-list-name="fooList<add-error>
      <fail-property resource="ErrorMessages" property="FooError" />
    </add-error>
    
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    resource

    constant

    required

    list-name

    optional

    The name of the list to copy from

    to-list-name

    the resource where the message can be found.

     

    property

    constant

    required

    The message property key.

     

    Section
    Column
    width20%
    <field>
  • Currently, both attributes are optional. Require both attributes.
  • Column
    Declares an environment field to be passed as an argument to an object method call.
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    field

    expression

    requiredoptional

    The name of the list to copy to

    Info
    titleProposed Changes

    environment field to use.

     

    type

    constant

    optional

    The Java class of the argument.

    Defaults to "java.lang.String"

    Rename the list-name attribute to from-field or from-list to make the syntax similar to other operators

    .

    Section
    Column
    width20%
    <map
    <field-to-
    map>
    list>
    Column
    Copies map entries to another map. If the target map is not found, a new map is created
    Appends an object to the specified list.
    Code Block
    xml
    xml
    
    <map<field-to-maplist map-namelist="foobarList" to-map-namefield="fooMapfoo" />
    
    Attributes

    map-name

    optional

    The name of the map to copy from

    to-map-name

    optional

    The name of the map to copy to

    Info
    titleProposed Changes
    • Currently, both attributes are optional. Require both attributes.
    • Rename the map-name attribute to from-field or from-map to make the syntax similar to other operators.

    Name

    Type

    Requirements

    Description

    Note

    field

    expression

    required

    The field to add to the list.

    The operation does nothing if the field does not exist.

    list

    expression

    required

    Name of the list.

    If the list does not exist, one is created.

    Warning

    Deprecated - use the <set> element.

    Section
    Column
    width20%
    <field-to-request>
    Column
    Copies a field to a servlet request attribute.

    Valid only when the simple-method is called as an event, it is ignored otherwise

    Section
    Column
    width20%
    <now>
    Column
    Sets a field to the current system time

    .

    Code Block
    xml
    xml
    
    <now<field-to-request field="foo" request-name="fooNowfooAttribute" />
    
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    field

    expression

    required

    The name of the field to set, the target copy from. The source of the assignment

     

    type

    constant

    optional

    The Java data type of field

    Defaults to "java.sql.Timestamp"

    Note
    titleDraft Status

    Final draft.

    Section
    Column
    width20%
    <now-date-to-env>
    Column
    Deprecated - use <now>.
    Note
    titleDraft Status

    Final draft.

    Section
    Column
    width20%
    <now-timestamp>
    Column
    Deprecated - use <now>.
    Note
    titleDraft Status

    Final draft.

    .

    The operation does nothing if the field does not exist.

    request-name

    constant, ${expression}

    optional

    The servlet request attribute name. The target of the assignment.

    Defaults to the value of field attribute.

    Section
    Column
    width20%
    <field-to-result>
    Column
    Copies a field to a service OUT attribute
    Section
    Column
    width20%
    <order-by>

    Child element of <order-map-list>

    Column
    Defines a map key to sort on
    .
    Code Block
    xml
    xml
    
    <order<field-mapto-listresult listfield="fooListfoo">
        <order-by field result-name="fooKeyfooAttribute" />
    </order-map-list>
    
    Attributes
    field

    Name

    Type

    Requirements

    Description

    Note

    field

    expression

    required

    The name of the field to copy from. The source of the assignment.

    The operation does nothing if the field does not exist.

    result-name

    expression

    optional

    The name of the result field to set. The target of the assignment.

    Defaults to the value of field attribute.

    optional

    The name of the key to sort on

    Section
    Column
    width20%
    <order
    <field-
    map
    to-
    list>
    session>
  • Currently, the list attribute is optional. Require the attribute.
  • Currently, the child elements are optional, and the operator throws an exception at run time when none are found. Require at least one
    Column
    Copies a field to a servlet session attribute.

    Valid only when the simple-method is called as an event, it is ignored otherwise

    Sorts a list of maps

    .

    Code Block
    xml
    xml
    
    <order<field-mapto-listsession listfield="fooListfoo">
        <order-by field session-name="fooKeyfooAttribute" />
    </order-map-list>
    
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    field

    expression

    required

    list

    optional

    The name of the list to be sorted

    Child Elements

    <order-by>

    optional

    Defines a map key to sort on

    Info
    titleProposed Changes

    field to copy from. The source of the assignment.

    The operation does nothing if the field does not exist.

    session-name

    constant, ${expression}

    optional

    The servlet session attribute name. The target of the assignment.

    Defaults to the value of field attribute

    child element

    .

    Section
    Column
    width20%
    <property
    <first-
    to
    from-
    field>
    list>
    Currently, all attributes are optional. Require the field, resource, and property attributes
    Column
    Assigns
    a resource property
    the first (lowest order) entry in a list to a field.
    Code Block
    xml
    xml
    
    <property<first-tofrom-fieldlist fieldentry-name="foo" resourcelist="fooResource.propertiesfooList" property="fooKey" />
    
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    entry-name

    expression

    required

    field

    optional

    The name of the field to set.

     

    list

    expressionresource

    optionalrequired

    The resource name of the list that contains the property

     

    property

    optional

    The property key

     

    default

    optional

    A default value to be used when the property is not found

     

    no-locale

    optional

    If "true" no localization will be performed on the property's value

    Default is "false"

    arg-list-name

    optional

    The name of a field that contains a list of arguments to be used in formatted property values

     

    Info
    titleProposed Changes

    object to copy.

    Defaults to a null value if the list does not exist or is empty.

    Warning

    Deprecated - use the <set> element.

    Section
    Column
    width20%
    <list-to-list>
    Column
    Copies list elements to another list.
    Code Block
    xml
    xml
    <list-to-list list="foo" to-list-name="fooList" />
    
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    list

    expression

    required

    The name of the list to copy from.

    Operation does nothing if the list does not exist.

    to-list-name

    expression

    required

    Name of the list to copy to.

    If the list does not exist, one will be created.

    Section
    Column
    width20%
    <request
    <map-
    parameters-
    to-
    list>
    map>
    Column
    Copies
    request parameters to a list
    a map to another map.
    Code Block
    xml
    xml
    
    <request<map-parameters-to-listmap list-namemap="fooListoldMap" requestto-namemap="fooParameternewMap" />
    
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    map

    expression

    required

    The name of the map to copy from.

    Operation does nothing if the map does not exist.

    to-map

    expression

    list-name

    optional

    Name of the list. If the list does not exist, one is created.

    request-name

    optional

    The name of the request parameter. All parameter values will be added to the list

    Info
    titleProposed Changes

    map to copy to.

    If this attribute is empty, the source map will be copied to the current environment

  • Currently, both attributes are optional. Require both attributes.
  • Rename the list-name attribute to list - to make the syntax similar to other operators.
  • Rename the request-name attribute to parameter-name - to make the syntax clearer

    .

    Section
    Column
    width20%
    <request-to-field>
    <now>
    Column
    Copies
    Sets a
    Servlet request attribute to a field
    field to the current system time.
    Code Block
    xml
    xml
    
    <request-to-field<now field="foo" request-name="fooAttribute"fooNow" />
    
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    field

    expression

    optionalrequired

    The name of the field for the new object

    request-name

    optional

    The name of the request attribute

    default

    optional

    A default constant value - used if the request attribute does not exist

    to set, the target of the assignment.

     

    type

    constantmap-name

    optional

    The name of the map containing field

    Info
    titleProposed Changes
    • Currently, the field and request-name attributes are optional. Require both attributes.
    • Eliminate the map-name attribute.
    • Rename the request-name attribute to attribute-name - to make the syntax clearer.

    field data type.

    Defaults to "java.sql.Timestamp".

    Section
    Column
    width20%
    <session
    <now-date-to-
    field>
    env>
    java.sql.Date object initialized to the current system time.
    Attributes
    Column
    Copies
    Sets a
    Servlet session attribute
    field to a
    field.
    Code Block
    xmlxml
    
    <session-to-field field="foo" session-name="fooAttribute" />
    

    Name

    Type

    Requirements

    Description

    Note

    field

    expression

    required

    Attributes

    field

    optional

    The name of the field for the new object

    session-name

    optional

    The name of the session attribute

    default

    optional

    A default constant value - used if the session attribute does not exist

    map-name

    optional

    The name of the map containing field

    to set, the target of the assignment.

     

    Warning

    Deprecated - use the <now> element.

    Section
    Column
    width20%
    <now-timestamp>
    Column
    Sets a field to a java.sql.Timestamp object initialized to the current system time.
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    field

    expression

    required

    The name of the field to set, the target of the assignment.

     

    Warning

    Deprecated - use the <now> element

    Info
    titleProposed Changes
  • Currently, the field and session-name attributes are optional. Require both attributes.
  • Eliminate the map-name attribute.
  • Rename the session-name attribute to attribute-name - to make the syntax clearer

    .

    Section
    Column
    width20%
    <set>
    <order-by>
    Column
    Assigns
    Declares a field
    from an expression or script, or from a constant value
    or map key to sort on.
    Code Block
    xml
    xml
    
    <set field<order-map-list list="foofooList" value="bar" />
    <set>
        <order-by field="baz" from="foofooKey" />
    <!/order-- Field "baz" contains the string "bar" -->map-list>
    
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    field

    expression

    required

    The name of the field or map key to sort on.

     

    Section
    Column
    width20%
    <order-map-list>
    Column
    Sorts a list of maps.

    Maps are sorted by the keys specified in the <order-by> sub-elements.

    Code Block
    xml
    xml
    <order-map-list list="fooList">
        <order-by field="fooKey" />
    </order-map-list>
    
    Attributes

    Name

    Type

    Requirements

    Description

    NotesNote

    fieldlist

    expression

    required

    The name of the field to set, the target of the assignmentlist to be sorted.

    The operation does nothing if the list is not found.

     

    from

    expression, script

    required if value is empty

    An expression or script that returns an object or null

    The script must be prefixed with the script language followed by a colon (":")

    value

    constant+expr

    required if from is empty

    A constant value

    Default type = "java.lang.String"

    default

    constant+expr, expression

    optional

    A default value - used if from evaluates to null

    Expressions must be enclosed in ${}

    type

    constant

    optional

    The Java data type of field

    "NewList" will create a new java.util.List, "NewMap" will create a new java.util.Map

    set-if-null

    constant

    optional

    Controls if field can be set to null.

    Defaults to "false"

    set-if-empty

    constant

    optional

    Controls if field can be set to an empty value. The meaning of "empty" depends on the Java data type.

    Defaults to "true"

    Note
    titleDraft Status

    Final draft.

    Section
    Column
    width20%
    <set-calendar>
    Column
    Performs a Timestamp adjustment operation.
    Code Blockxmlxml
    
    <set-calendar field="tomorrowStamp" from-field="nowTimestamp" day="1" />
    <set-calendar field="yesterdayStamp" from-field="nowTimestamp" day="-1" />
    

    Attributes

    field

    optional

    The name of the field to set (the l-value)

    from-field

    optional

    The name of a field to copy from (the r-value)

    value

    optional

    A constant value

    default-value

    optional

    A default constant value - used if from-field evaluates to null

    type

    optional

    The Java data type of field

    years

    optional

    A signed integer adjustment amount

    months

    optional

    A signed integer adjustment amount

    days

    optional

    A signed integer adjustment amount

    hours

    optional

    A signed integer adjustment amount

    minutes

    optional

    A signed integer adjustment amount

    seconds

    optional

    A signed integer adjustment amount

    millis

    optional

    A signed integer adjustment amount

    period-align-start

    optional

    Set the adjusted Timestamp to period start: "day", "week", "month", "year"

    period-align-end

    optional

    Set the adjusted Timestamp to period end: "day", "week", "month", "year"

    locale

    optional

    The locale (calendar) to be used for the operation

    time-zone

    optional

    The time zone to be used for the operation

    Info
    titleProposed Changes
    • Currently, the field attribute is optional. Require the field attribute.
    • Currently, the from-field and value attributes are optional. Require one of the two attributes.
    • Rename the from-field attribute to from. The attribute will be used exclusively for UEL expressions.
    • Change the behavior of the value attribute: The attribute will be used exclusively for string constants.
    • Remove the default-value attribute. The value attribute will be used for default constant values.
    Section
    Column
    width20%
    <set-service-fields>
    Column
    Copies map entries that match a service definition to another map. If the target map is not found, a new map is created.
    Code Blockxmlxml
    
    <set-service-fields service-name="fooService" map="barMap" to-map="fooServiceAttributes" />
    

    Attributes

    service-name

    optional

    The name of the service

    map

    optional

    The name of the map to copy from

    to-map

    optional

    The name of the map to copy to

    error-list

    optional

    The name of a list to copy error messages to

    Info
    titleProposed Changes
    • Currently, the service-name, map, and to-map attributes are optional. Require all three attributes.
    • Eliminate the error-list attribute, error messages are added to the result map
    Section
    Column
    width20%
    <string-append>
    Column
    Info
    titleProposed Changes

    Deprecate and replace with <set>

    Section
    Column
    width20%
    <string-to-field>
    Column
    Info
    titleProposed Changes

    Deprecate and replace with <set>

    Section
    Column
    width20%
    <string-to-list>
    Column
    Info
    titleProposed Changes

    Deprecate and replace with <set>

    Section
    Column
    width20%
    <to-string>
    Column
    Info
    titleProposed Changes

    Deprecate and replace with <set>

    ...

    Column
    width20%
    <webapp-property-to-field>

    ...

    Copies a ServletContext resource property to a field.

    ...

    
    <webapp-property-to-field field="foo" resource="fooResource" property="fooKey" />
    

    Attributes

    field

    optional

    The name of the field for the new object

    resource

    optional

    The resource that contains the property

    property

    optional

    The property key

    default

    optional

    A default value to be used when the property is not found

    map-name

    optional

    The name of the map containing field

    Info
    titleProposed Changes
    • Currently, the field, resource and property attributes are optional. Require all three attributes.
    • Eliminate the map-name attribute.

    Conditional/Looping Statements

    ...

    Column
    width20%
    <and>

    ...

    Combines conditional elements using a boolean AND.

    ...

    
    <if>
        <condition>
            <and>
                <if-compare field="colorModel" operator="equals" value="RYB" />
                <or>
                    <if-compare field="color" operator="equals" value="red" />
                    <if-compare field="color" operator="equals" value="yellow" />
                    <if-compare field="color" operator="equals" value="blue" />
                </or>
            </and>
        </condition>
        <then>
            <set field="isPrimaryColor" value="true" type="Boolean" />
        </then>
        <else>
            <set field="isPrimaryColor" value="false" type="Boolean" />
        </else>
    </if>
    
    Child Elements

    One or more of the following child element is required:

    Name

     

    <order-by>

    (?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})

    Section
    Column
    width20%
    <property-to-field>
    Column
    Assigns a resource property value to a field.
    Code Block
    xml
    xml
    <property-to-field field="foo" resource="fooResource.properties" property="fooKey" />
    
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    field

    expression

    required

    The name of the field to set, the target of the assignment.

     

    resource

    constant, ${expression}

    required

    The name of a properties resource. Can be a file on the classpath or a resource defined in the SystemProperty entity.

     

    property

    constant, ${expression}

    required

    The property key.

     

    default

    constant, ${expression}

    optional

    The default value to use if the property value is null or empty.

     

    no-locale

    constant

    optional

    Suppress property value localization. The user's/system locale will be ignored when retrieving the property value.

    Default is "false".

    arg-list

    expression

    optional

    The name of an argument list to be used with a formatting string. The argument list is applied to the property value.

    The attribute does nothing if the argument list is not found. See the java.text.MessageFormat class for more information.

    Section
    Column
    width20%
    <request-parameters-to-list>
    Column
    Appends a servlet request parameter list to a list.

    Valid only when the simple-method is called as an event, it is ignored otherwise.

    Code Block
    xml
    xml
    <request-parameters-to-list list="fooList" request-name="fooParameter" />
    
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    request-name

    constant, ${expression}

    required

    The name of the servlet request parameter. All matching parameter values will be added to the list.

     

    list

    expression

    optional

    The name of the list.

    If the list does not exist, one will be created. Defaults to the request-name attribute value.

    Section
    Column
    width20%
    <request-to-field>
    Column
    Copies a servlet request attribute to a field.

    Valid only when the simple-method is called as an event, it is ignored otherwise.

    Code Block
    xml
    xml
    <request-to-field field="foo" request-name="fooAttribute" />
    
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    field

    expression

    required

    The name of the field to set, the target of the assignment.

     

    request-name

    constant, ${expression}

    optional

    The servlet request attribute name.

    Defaults to the value of field attribute.

    default

    constant, ${expression}

    optional

    A default value to use if the request attribute does not exist.

     

    Section
    Column
    width20%
    <session-to-field>
    Column
    Copies a servlet session attribute to a field.

    Valid only when the simple-method is called as an HTTP event, it is ignored otherwise.

    Code Block
    xml
    xml
    <session-to-field field="foo" session-name="fooAttribute" />
    
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    field

    expression

    required

    The name of the field to set, the target of the assignment.

     

    session-name

    constant, ${expression}

    optional

    The servlet session attribute name.

    Defaults to the value of the field attribute.

    default

    constant, ${expression}

    optional

    A default value to use if the session attribute does not exist.

     

    Section
    Column
    width20%
    <set>
    Column
    Assigns a field from an expression or script, or from a constant value.
    Code Block
    xml
    xml
    <set field="foo" value="bar" />
    <set field="baz" from="foo" />
    <!-- Field "baz" contains the string "bar" -->
    
    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    field

    expression

    required

    The name of the field to set, the target of the assignment.

     

    from

    expression, script

    required if value is empty

    An expression or script that returns an object or null.

    The script must be prefixed with the script language followed by a colon (":").

    value

    constant+expr

    required if from is empty

    A constant value.

    Default type = "java.lang.String".

    default

    constant, ${expression}

    optional

    A default value that is used when the from attribute evaluates to null or empty.

     

    type

    constant

    optional

    The Java data type of field.

    "NewList" will create a new java.util.List, "NewMap" will create a new java.util.Map. Otherwise, the attribute must contain a valid Java class name.

    locale

    constant, ${expression}

    optional

    If a locale dependent type is passed allows to i18n the value.

    Defaults to environment locale.

    set-if-null

    constant

    optional

    Controls if field can be set to null.

    Defaults to "false".

    set-if-empty

    constant

    optional

    Controls if field can be set to an empty value. The meaning of "empty" depends on the Java data type.

    Defaults to "true".

    Section
    Column
    width20%
    <set-calendar>
    Column
    Adjusts a Timestamp by a specified time duration.
    Code Block
    xml
    xml
    <set-calendar field="tomorrowStamp" from-field="nowTimestamp" day="1" />
    <set-calendar field="yesterdayStamp" from-field="nowTimestamp" day="-1" />
    
    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    field

    expression

    required

    The name of the field to set, the target of the assignment.

     

    from

    expression, script

    required if value is empty

    An expression or script that returns an object or null.

    The script must be prefixed with the script language followed by a colon (":").

    value

    constant+expr

    required if from is empty

    A constant value.

    Default type = "java.lang.String".

    default

    constant, ${expression}

    optional

    A default value that is used when the from attribute evaluates to null or empty.

     

    set-if-null

    constant

    optional

    Controls if field can be set to null.

    Defaults to "false".

    years

    constant, ${expression}

    optional

    Add (optionally using +) or subtract (using -) a number of year(s).

    If an expression is used, it should evaluate to an integer.

    months

    constant, ${expression}

    optional

    Add (optionally using +) or subtract (using -) a number of month(s).

    If an expression is used, it should evaluate to an integer.

    days

    constant, ${expression}

    optional

    Add (optionally using +) or subtract (using -) a number of days(s).

    If an expression is used, it should evaluate to an integer.

    hours

    constant, ${expression}

    optional

    Add (optionally using +) or subtract (using -) a number of hour(s).

    If an expression is used, it should evaluate to an integer.

    minutes

    constant, ${expression}

    optional

    Add (optionally using +) or subtract (using -) a number of minute(s).

    If an expression is used, it should evaluate to an integer.

    seconds

    constant, ${expression}

    optional

    Add (optionally using +) or subtract (using -) a number of second(s).

    If an expression is used, it should evaluate to an integer.

    millis

    constant, ${expression}

    optional

    Add (optionally using +) or subtract (using -) a number of milli-second(s).

    If an expression is used, it should evaluate to an integer.

    period-align-start

    constant, ${expression}

    optional

    Align the adjusted date to the start of a period: "day", "week", "month", "year"

     

    period-align-end

    constant, ${expression}

    optional

    Align the adjusted date to the end of a period: "day", "week", "month", "year"

     

    locale

    constant, ${expression}

    optional

    The locale (calendar) to be used for the operation

    Defaults to the environment locale.

    time-zone

    constant, ${expression}

    optional

    The time zone to be used for the operation

    Defaults to the environment time zone.

    Section
    Column
    width20%
    <set-current-user-login>
    Column
    Sets the UserLogin entity value to be used for authentication for the rest of the method.
    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    value-field

    expression

    required

    The name of the field that contains the UserLogin entity value.

    A runtime exception will be thrown if the entity value does not exist.

    Warning

    Deprecated - you can pass an alternate UserLogin entity value to the called service's IN attributes

    ...

    Column
    width20%
    <assert>

    ...

    Evaluates each contained condition independently, and adds an error message to the error message list for each condition that does not evaluate to true.

    Attributes

    title

    optional

    The assertion title - used in error messages to identify the assertion

     

    error-list-name

    optional

    The name of the error list

    Defaults to "error_list"

    Child Elements

    Any <condition> child element

    optional

    A condition to test

    Info
    titleProposed Changes
    • Currently, the title attribute is optional. Keep the title attribute optional but have it default to the file location and line number.
    • Eliminate the error-list-name attribute.
    • Currently, the child element is optional. Require at least one child element.
    Section
    Column
    width20%
    <break>
    Column
    Causes script execution to exit the nearest loop element.
    Section
    Column
    width20%
    <check-id>
    Column
    Evaluates the specified field, and adds an error message to the error message list if the field's value is not a valid database ID value.

    Attributes

    field

    optional

    The name of the field to validate

     

    map-name

    optional

    The name of the map containing field

     

    error-list-name

    optional

    The name of the error list

    Defaults to "error_list"

    Child Elements

    <fail-message>

    optional

    <fail-property>

    optional

    Info
    titleProposed Changes
  • Currently, the field attribute is optional. Require the field attribute.
  • Eliminate the map-name and error-list-name attributes.
  • Currently, the child elements are optional. Require one child element

    .

    Section
    Column
    width20%
    <check
    <set-service-
    errors>
    fields>
    Halts script execution if the error message list contains any messages. The error message list is returned to the calling process.

    Attributes

    Column

    error-code

    optional

    The error code to return

    Defaults to "error"

    error-list-name

    optional

    The name of the error list

    Defaults to "error_list"

    Info
    titleProposed Changes
    • Eliminate the error-list-name attribute.
    Section
    Column
    width20%
    <check-permission>
    Column
    Checks if the user has the specified permission, and adds an error message to the error message list if the user does not have the specified permission.

    Attributes

    permission

    optional

    The permission to check

     

    action

    optional

    The action to be performed (permission scope)

     

    error-list-name

    optional

    The name of the error list

    Defaults to "error_list"

    Child Elements

    <accept-userlogin-party>

    optional

    <alt-permission>

    optional

    <fail-message>

    optional

    <fail-property>

    optional

    Info
    titleProposed Changes
    • Currently, the permission and action attributes are optional. Require the permission and action attributes.
    • Eliminate the error-list-name attribute.
    Section
    Column
    width20%
    <condition>
    Column
    Combines a group of conditional elements into a single logical (true/false) expression.
    Code Blockxmlxml
    
    <if>
        <condition>
            <and>
                <if-compare field="colorModel" operator="equals" value="RYB" />
                <or>
                    <if-compare field="color" operator="equals" value="red" />
                    <if-compare field="color" operator="equals" value="yellow" />
                    <if-compare field="color" operator="equals" value="blue" />
                </or>
            </and>
        </condition>
        <then>
            <set field="isPrimaryColor" value="true" type="Boolean" />
        </then>
        <else>
            <set field="isPrimaryColor" value="false" type="Boolean" />
        </else>
    </if>
    
    Section
    Column
    width20%
    <continue>
    Column
    Causes script execution to return to the beginning of the nearest enclosing loop element.
    Copies map elements that match a service's IN attributes from a source map to a target map.
    Code Block
    xml
    xml
    <set-service-fields service-name="fooService" map="barMap" to-map="fooServiceAttributes" />
    
    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    service-name

    constant, ${expression}

    required

    The name of the service.

     

    map

    expression

    required

    The name of the map to copy the matching IN attributes from.

    The operation does nothing if the map does not exist.

    to-map

    expression

    required

    The name of the map to copy the matching IN attributes to.

    If the map does not exist, a new one is created.

    Section
    Column
    width20%
    <string>
    Column
    Declares a java.lang.String to be passed as an argument to a method call.

    The String can be contained in the value attribute and/or in the element body. The element body text is appended to the value attribute text.

    Attributes

    Name

    Type

    Requirements

    Description

    Note

    value

    constant, ${expression}

    optional

    The String text.

     

    Section
    Column
    width20%
    <string-append>
    Column
    Performs string concatenation and formatting.

    The operation starts by applying an argument list (if found) to the string attribute value, the result is prepended by the prefix attribute value, and the suffix attribute value is appended to the result. If the string specified in the field attribute exists, the final result is appended to it, else the field is set to the final result.

    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    field

    expression

    required

    The name of the field to set, the target of the assignment.

     

    string

    constant, ${expression}

    required

    The string to append to the field named in the field attribute.

    This can be a formatting string that is used with the argument list specified in the arg-list attribute.

    arg-list

    expression

    optional

    The name of an argument list to be used with a formatting string.

    The argument list is applied to the string attribute value. The attribute does nothing if the argument list is not found. See the java.text.MessageFormat class for more information.

    prefix

    constant, ${expression}

    optional

    A string that will be prepended to the string attribute value.

     

    suffix

    constant, ${expression}

    optional

    A string that will be appended to the string attribute value.

     

    Section
    Column
    width20%
    <string-to-list>
    Column
    Adds a string to a list of strings.
    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    string

    constant, ${expression}

    required

    The string to add to the list specified in the list attribute.

     

    list

    expression

    required

    List to add the string to.

    If the list does not exist, one will be created.

    arg-list

    expression

    optional

    The name of an argument list to be used with a formatting string.

    The argument list is applied to the string attribute value. The attribute does nothing if the argument list is not found. See the java.text.MessageFormat class for more information.

    message-field

    constant

    optional

    Inserts a message above a field (used in conjunction with @fieldErrors FTL macro).

     

    Warning

    Deprecated - use the <set> element.

    Section
    Column
    width20%
    <to-string>
    Column
    Converts an object to a string.
    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    field

    expression

    required

    The name of the field containing the object to convert.

    The operation does nothing if the object is not found.

    format

    constant

    optional

    The format to use for the conversion.

     

    numeric-padding

    constant

    optional

    Left-pad the string with the specified number of zeroes.

     

    Warning

    Deprecated - use the <set> element.

    Section
    Column
    width20%
    <webapp-property-to-field>
    Column
    Copies a property value from a properties file in a ServletContext resource to a field.

    Valid only when the simple-method is called as an event, it is ignored otherwise.

    Code Block
    xml
    xml
    <webapp-property-to-field field="foo" resource="/WEB-INF/foo.properties" property="fooKey" />
    
    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    field

    expression

    required

    The name of the field to set, the target of the assignment.

     

    resource

    constant, ${expression}

    required

    The resource location of the properties file inside the webapp, and relative to the root of the webapp (can be inside a war file).

    Example: "/WEB-INF/myprops.properties".

    property

    constant, ${expression}

    required

    The property key.

     

    default

    constant, ${expression}

    optional

    A default value to use if the property value is null or empty.

     

     

    Conditional/Looping Statements

    Conditional/looping statements control the script execution path.

    Section
    Column
    width20%
    <and>
    Column
    Combines conditional elements using a boolean AND.

    Evaluates to true if all sub-elements evaluate to true.

    Code Block
    xml
    xml
    <if>
        <condition>
            <and>
    
    Section
    Column
    width20%
    <else>
    Column
    Contains a block of code to be executed when a condition evaluates to false.
    Code Blockxmlxml
    
    <if>
        <condition>
            <and>
                <if-compare field="colorModel" operator="equals" value="RYB" />
                <or>
                    <if-compare field="color" operator="equals" value="red" />
                    <if-compare field="color" operator="equals" value="yellow" />
                    <if-compare field="color" operator="equals" value="blue" />
                </or>
            </and>
        </condition>
        <then>
            <set field="isPrimaryColor" value="true" type="Boolean" />
        </then>
        <else>
            <set field="isPrimaryColor" value="false" type="Boolean" />
        </else>
    </if>
    
    Section
    Column
    width20%
    <else-if>
    Column
    Contains a block of code to be executed when a condition evaluates to false.
    Code Block
    xmlxml
    
    <if>
        <condition>
            <and>
                <if-compare field="colorModel" operator="equals" value="RYB" />
                <or>
                    <if-compare field="color" operator="equals" value="red" />
                       <if-compare field="colorcolorModel" operator="equals" value="yellowRYB" />
                <or>
        <if-compare field="color"            <if-compare field="color" operator="equals" value="bluered" />
                </or>
        <if-compare field="color" operator="equals" value="yellow" </and>>
        </condition>
        <then>
            <set<if-compare field="isPrimaryColorcolor" valueoperator="trueequals" typevalue="Booleanblue" />
        </then>
        <else-if>
            <condition></or>
            </and>
        <and></condition>
        <then>
                <if-compare <set field="colorModelisPrimaryColor" operatorvalue="equalstrue" valuetype="CYMBoolean" />
        </then>
        <else>
            <or>
                        <if-compare field="color" operator="equals" value="cyan" />
                        <if-compare field="color" operator="equals" value="yellow" />
                        <if-compare field="color" operator="equals" value="magenta" />
                    </or>
                </and>
            </condition>
            <then>
                <set field="isPrimaryColor" value="true" type="Boolean" />
            </then>
        </else-if>
        <else>
            <set field="isPrimaryColor" value="false" type="Boolean" />
        </else>
    </if>
    <set field="isPrimaryColor" value="false" type="Boolean" />
        </else>
    </if>
    
    Child Elements

    One or more of the following child elements is required:

    Name

     

    <and>

     

    <if-validate-method>

    (?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})

    <if-compare>

    (?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})

    <if-compare-field>

    (?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})

    <if-regexp>

    (?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})

    <if-empty>

    (?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})

    <if-has-permission>

    (?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})

    <or>

    (?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})

    <not>

    (?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})

    <xor>

    (?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})

    Currently, the <condition> and <then> child elements are optional. Require the <condition> and <then> child elements.
    Section
    Column
    width20%
    <break>
    Column
    Causes script execution to exit the nearest looping element.

    The operation will throw an exception if there is no enclosing looping element.

    Enclosing Looping Elements

    Name

     

    <iterate>

    (?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})

    <iterate-map>

    (?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})

    <loop>

    (?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})

    <while>

    (?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})

    Section
    Column
    width20%
    <if>

    Child Elements

    Column
    Contains blocks of code that are executed based on a logical (true/false) condition.
    Code Block
    xmlxml
    
    <if>
        <condition>
            <and>
                <if-compare field="colorModel" operator="equals" value="RYB" />
                <or>
                    <if-compare field="color" operator="equals" value="red" />
                    <if-compare field="color" operator="equals" value="yellow" />
                    <if-compare field="color" operator="equals" value="blue" />
                </or>
            </and>
        </condition>
        <then>
            <set field="isPrimaryColor" value="true" type="Boolean" />
        </then>
        <else-if>
            <condition>
                <and>
                    <if-compare field="colorModel" operator="equals" value="CYM" />
                    <or>
                        <if-compare field="color" operator="equals" value="cyan" />
                        <if-compare field="color" operator="equals" value="yellow" />
                        <if-compare field="color" operator="equals" value="magenta" />
                    </or>
                </and>
            </condition>
            <then>
                <set field="isPrimaryColor" value="true" type="Boolean" />
            </then>
        </else-if>
        <else>
            <set field="isPrimaryColor" value="false" type="Boolean" />
        </else>
    </if>
    

    <condition>

    optional

    <then>

    optional

    <else>

    optional

    <else-if>

    optional

    Info
    titleProposed Changes