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)

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

Example

constant

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

name="fooMethod"

constant+expr

A

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.

...

titleProposed Attribute Type Section

Attribute Types

...

constant

...

A string constant. The string may not include an expression

...

constant+expr

...

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}"

...

expression

...

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="myMethodfooMethod">
  <!-- some mini-language code goes here -->
</simple-method>
Attributes

Name

Type

Requirements

Description

Note

method-name

constant

optional

required

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

Each 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

 

event-session-object-name

optional

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

Defaults to "request". 

event-response-object-name

constant

optional 

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

Defaults to "response".

event-responsesession-codeobject-name

constant

optional 

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

Defaults to "session".

event-errorresponse-messagecode-name

constant

optional 

The name of the field containing the event response code.

Defaults to "_response_code_".

event-error-message-list-name

constant

optional

 

event-event-message-name

optional

 

The name of the field containing the event error message.

Defaults to "_error_message_".

event-errorevent-event-message-list-name

constant

optional

 

The name of the field containing the event message list.

Defaults to "_error_message_list_".

event-eventservice-response-message-name

constant

optional

 

service-error-message-name

optional

 

The name of the field containing the event message.

Defaults to "_event_message_".

event-event-message-list-name

constant

optional

The name of the field containing the event message list.

Defaults to "_event_message_list_".

service-response-message-name

constant

optional

The name of the field containing the service response message.

Defaults to "responseMessage".

service-error-message-list-name

optional

 

service-error-message-map-name

constant

optional 

The name of the field containing the service error message.

Defaults to "errorMessage".

service-successerror-message-list-name

constant

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.

...

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>
Currently, child elements are optional. Require at least one child element.
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:

optional

Name

 

<fail-message>

<fail-property>

optional

Info
titleProposed Changes

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-{{}})

  • Currently, both attributes are optional. Require at least one attribute.
  • Eliminate the map-name attribute
    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.SomeClass">
      <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
    Section
    Column
    width20%
    <env-to-env>
    Column
    Warning

    Deprecated. Use <set>.

    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%
    <env-to-field>
    Deprecated. Use <set>.
    Column
    Warning

    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
    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-{{}})

    Column
    width20%
    <fail-property>

    Attributes

    Column
    Declares a property key that is used to add a message to a message list.
    Code Block
    xmlxml
    
    <add-error>
      <fail-property resource="ErrorMessages" property="FooError" />
    </add-error>
    

    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
    Column
    width20%
    <field
    <check-
    to-env>
    permission>
    Column
    Warning

    Deprecated. Use <set>.

    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-{{}})

    Section
    Column
    width20%
    <clear-field>
    Column
    Sets the value of the specified field to null.
    Code Block
    xml
    xml
    <clear-field field="foo" />
    
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    field

    expression

    required

    The name of the field to 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.

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

    Name

    Type

    Requirements

    Description

    Note

    field

    expression

    required

    The name of the field 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.
    Code Block
    xml
    xml
    <add-error>
      <fail-message message="There was an error." />
    </add-error>
    
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    message

    constant+expr

    required

    The message text.

     

    Section
    Column
    width20%
    <fail-property>
    Column
    Declares an error message found in a properties file.
    Code Block
    xml
    xml
    <add-error>
      <fail-property resource="ErrorMessages" property="FooError" />
    </add-error>
    
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    resource

    constant

    required

    The name of the resource where the message can be found.

     

    property

    constant

    required

    The message property key.

     

    Section
    Column
    width20%
    <field>
    Column
    Declares an environment field to be passed as an argument to an object method call.
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    field

    expression

    required

    The name of the environment field to use.

     

    type

    constant

    optional

    The Java class of the argument.

    Defaults to "java.lang.String".

    Section
    Column
    width20%
    <field-to-list>
    Column
    Appends an object to the specified list.
    Code Block
    xml
    xml
    <field-to-list list="barList" field="foo" />
    
    Attributes

    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.

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

    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.

    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.
    Code Block
    xml
    xml
    <field-to-result field="foo" result-name="fooAttribute" />
    
    Attributes

    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.

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

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

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

    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.

    session-name

    constant, ${expression}

    optional

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

    Defaults to the value of field attribute.

    Section
    Column
    width20%
    <first-from-list>
    Column
    Assigns the first (lowest order) entry in a list to a field.
    Code Block
    xml
    xml
    <first-from-list entry-name="foo" list="fooList" />
    
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    entry-name

    expression

    required

    The name of the field to set.

     

    list

    expression

    required

    The name of the list that contains the 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%
    <map-to-map>
    Column
    Copies a map to another map.
    Code Block
    xml
    xml
    <map-to-map map="oldMap" to-map="newMap" />
    
    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

    optional

    The name of the map to copy to.

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

    Section
    Column
    width20%
    <now>
    Column
    Sets a field to the current system time.
    Code Block
    xml
    xml
    <now field="fooNow" />
    
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    field

    expression

    required

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

     

    type

    constant

    optional

    The field data type.

    Defaults to "java.sql.Timestamp".

    Section
    Column
    width20%
    <now-date-to-env>
    Column
    Sets a field to a java.sql.Date 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.

    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.

    Section
    Column
    width20%
    <order-by>
    Column
    Declares a field or map key to sort on.
    Code Block
    xml
    xml
    <order-map-list list="fooList">
        <order-by field="fooKey" />
    </order-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

    Note

    list

    expression

    required

    The name of the list to be sorted.

    The operation does nothing if the list is not found.

     

    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.

    Section
    Column
    width20%
    <set-service-fields>
    Column
    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>
                <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 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-{{}})

    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%
    <check-errors>
    Column
    Halts script execution if the error message list contains any messages.

    The error message list is returned to the calling process.

    Attributes

    Name

    Type

    Requirements

    Description

    Note

    error-code

    constant, ${expression}

    optional

    The error code to return to the calling process.

    Defaults to value of the containing <simple-method> element "default-error-code" attribute.

    error-list-name

    constant, ${expression}

    optional

    The name of a list that will contain the message.

    Defaults to "error_list".

    Section
    Column
    width20%
    <condition>
    Column
    Combines a group of conditional elements into a single logical (true/false) expression.
    Code Block
    xml
    xml
    <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 of the following child elements is required:

    Name

     

    <and>

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

    <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-{{}})

    Section
    Column
    width20%
    <continue>
    Column
    Causes script execution to return to the beginning of the nearest enclosing loop 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%
    <else>
    Column
    Contains a block of code to be executed when a condition evaluates to false.
    Code Block
    xml
    xml
    <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

    Name

    Requirements

     

    (Any block of code)

    optional

     

    Section
    Column
    width20%
    <else-if>
    Column
    Contains a condition and a block of code to be evaluated/executed when a parent condition evaluates to false.

    If the condition of the parent element evaluates to false, then this element's condition will be evaluated, and if that condition evaluates to true, then the operations under the then element will be run.

    Code Block
    xml
    xml
    <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>
    
    Child Elements

    The following child elements are required:

    Name

     

    <condition>

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

    <then>

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

    Section
    Column
    width20%
    <if>
    Column
    Performs conditional processing on blocks of code.

    This operation specifies combinations of conditions, alternate conditions, and operations to run based on the evaluation of condition expressions.

    Code Block
    xml
    xml
    <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>
    
    Child Elements

    Name

    Requirements

     

    <condition>

    required

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

    <then>

    required

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

    <else-if>

    optional (one or more)

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

    <else>

    optional (only one)

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

    Section
    Column
    width20%
    <if-compare>
    Column
    Compares a field to a constant value.

    There are two versions of this element - one that contains sub-elements and can be used by itself, and another that does not contain sub-elements and is a sub-element of the <condition> element. The stand-alone version will execute its contained block of code if the condition evaluates to true, otherwise it will execute the block of code in its <else> sub-element (if one exists).

    Attributes

    Name

    Type

    Requirements

    Description

    Note

    field

    expression

    required

    The name of the field that will be compared. The l-value.

     

    operator

    constant

    required

    The comparison operator. The operator describes the l-value compared to the r-value.

    Valid values are: "equals", "not-equals", "less", "less-equals", "greater", "greater-equals", "contains", "is-null", "is-not-null", "is-empty".

    The "contains" operator returns true if the l-value contains the r-value. That operator does not perform type conversions. The l-value must be a collection type or a String. A null l-value evaluates to false.

    The "is-null", "is-not-null", and "is-empty" operators do not require an r-value. Any r-values will be ignored.

    value

    constant+expr

    ignored when operator attribute equals "is-null", "is-not-null", or "is-empty" - required otherwise

    The value that the field will be compared to. The r-value.

     

    type

    constant

    optional

    The Java data type. Both values will be converted to this type before comparison.

    Attribute must contain a valid Java class name. Invalid when the operator attribute value equals "contains".

    format

    constant, ${expression}

    optional

    Format used for type conversions.

    Valid only when the type attribute is not empty.

     

    Child Elements (stand-alone version only)

    Name

    Requirements

     

    (Any block of code)

    optional

     

    <else>

    optional

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

    Section
    Column
    width20%
    <if-compare-field>
    Column
    Compares a field to another field.

    There are two versions of this element - one that contains sub-elements and can be used by itself, and another that does not contain sub-elements and is a sub-element of the <condition> element. The stand-alone version will execute its contained block of code if the condition evaluates to true, otherwise it will execute the block of code in its <else> sub-element (if one exists).

    Attributes

    Name

    Type

    Requirements

    Description

    Note

    field

    expression

    required

    The name of the field that will be compared. The l-value.

     

    operator

    constant

    required

    The comparison operator. The operator describes the l-value compared to the r-value.

    Valid values are: "equals", "not-equals", "less", "less-equals", "greater", "greater-equals", "contains".

    The "contains" operator returns true if the l-value contains the r-value. That operator does not perform type conversions. The l-value must be a collection type or a String. A null l-value evaluates to false.

    to-field

    expression

    required

    The name of the field that field will be compared to. The r-value.

     

    type

    constant

    optional

    The Java data type. Both values will be converted to this type before comparison.

    Attribute must contain a valid Java class name. Invalid when the operator attribute value equals "contains".

    format

    constant, ${expression}

    optional

    Format used for type conversions.

    Valid only when the type attribute is not empty.

     

    Child Elements (stand-alone version only)

    Name

    Requirements

     

    (Any block of code)

    optional

     

    <else>

    optional

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

    Section
    Column
    width20%
    <if-empty>
    Column
    Tests if a field is null or empty.

    There are two versions of this element - one that contains sub-elements and can be used by itself, and another that does not contain sub-elements and is a sub-element of the <condition> element. The stand-alone version will execute its contained block of code if the condition evaluates to true, otherwise it will execute the block of code in its <else> sub-element (if one exists).

    Name

    Type

    Requirements

    Description

    Note

    field

    expression

    required

    The name of the field to test.

    Object to test must be a collection, string, or a class that implements org.ofbiz.base.lang.IsEmpty.

     

    Child Elements (stand-alone version only)

    Name

    Requirements

     

    (Any block of code)

    optional

     

    <else>

    optional

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

    Section
    Column
    width20%
    <if-has-permission>
    Column
    Tests if the current user has the specified permission.

    There are two versions of this element - one that contains sub-elements and can be used by itself, and another that does not contain sub-elements and is a sub-element of the <condition> element. The stand-alone version will execute its contained block of code if the condition evaluates to true, otherwise it will execute the block of code in its <else> sub-element (if one exists).

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

     

    Child Elements (stand-alone version only)

    Name

    Requirements

     

    (Any block of code)

    optional

     

    <else>

    optional

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

    Section
    Column
    width20%
    <if-instance-of>
    Column
    Tests if a field is an instance of a Java class.

    The operation will execute its contained block of code if the condition evaluates to true, otherwise it will execute the block of code in its <else> sub-element (if one exists).

    Attributes

    Name

    Type

    Requirements

    Description

    Note

    field

    expression

    required

    The name of the field to test.

    Test evaluates to false if the field does not exist.

    class

    constant

    required

    The name of the class to test for.

    Attribute must contain a valid Java class name.

     

    Child Elements

    Name

    Requirements

     

    (Any block of code)

    optional

     

    <else>

    optional

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

    Section
    Column
    width20%
    <if-not-empty>
    Column
    Tests if a field is not null and not empty.

    The operation will execute its contained block of code if the condition evaluates to true, otherwise it will execute the block of code in its <else> sub-element (if one exists).

    Attributes

    Name

    Type

    Requirements

    Description

    Note

    field

    expression

    required

    The name of the field to test.

    Object to test must be a collection, string, or a class that implements org.ofbiz.base.lang.IsEmpty.

     

    Child Elements

    Name

    Requirements

     

    (Any block of code)

    optional

     

    <else>

    optional

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

    Section
    Column
    width20%
    <if-regexp>
    Column
    Tests if a field matches a regular expression.

    There are two versions of this element - one that contains sub-elements and can be used by itself, and another that does not contain sub-elements and is a sub-element of the <condition> element. The stand-alone version will execute its contained block of code if the condition evaluates to true, otherwise it will execute the block of code in its <else> sub-element (if one exists).

    Attributes

    Name

    Type

    Requirements

    Description

    Note

    field

    expression

    required

    The name of the field to test.

    The field object will be converted to a string before the test. An empty string will be used if the field object is not found.

    expr

    constant, ${expression}

    required

    The regular expression to test for.

     

     

    Child Elements (stand-alone version only)

    Name

    Requirements

     

    (Any block of code)

    optional

     

    <else>

    optional

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

    Section
    Column
    width20%
    <if-validate-method>
    Column
    Invokes a Java class static method that returns a boolean value.

    There are two versions of this element - one that contains sub-elements and can be used by itself, and another that does not contain sub-elements and is a sub-element of the <condition> element. The stand-alone version will execute its contained block of code if the static method returns true, otherwise it will execute the block of code in its <else> sub-element (if one exists).

    Attributes

    Name

    Type

    Requirements

    Description

    Note

    field

    expression

    required

    The name of the field to use as the method argument.

    The field object will be converted to a string before the method call. An empty string will be used if the field object is not found.

    method

    constant

    required

    The name of the static method that will be called to validate the field.

    Must be a static method that takes a single java.lang.String parameter and return a boolean.

    class

    constant

    optional

    The name of the Java class that contains the validation method.

    Defaults to "org.ofbiz.base.util.UtilValidate".

     

    Child Elements (stand-alone version only)

    Name

    Requirements

     

    (Any block of code)

    optional

     

    <else>

    optional

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

    Section
    Column
    width20%
    <iterate>
    Column
    Contains a block of code that is executed once for each entry in a collection.
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    list

    expression

    required

    The name of the field that contains the collection to iterate over.

    The operation does nothing if the field is not found.

    entry

    expression

    required

    The name of the field that will contain the current collection entry.

     

     

    Child Elements

    Name

    Requirements

     

    (Any block of code)

    optional

     

    Section
    Column
    width20%
    <iterate-map>
    Column
    Contains a block of code that is executed once for each entry in a map.
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    map

    expression

    required

    The name of the field that contains the map to iterate over.

    The operation does nothing if the field is not found.

    key

    expression

    required

    The name of the field that will contain the current map entry key.

     

    value

    expression

    required

    The name of the field that will contain the current map entry value.

     

     

    Child Elements

    Name

    Requirements

     

    (Any block of code)

    optional

     

    Section
    Column
    width20%
    <loop>
    Column
    Contains a block of code that is executed repeatedly until a maximum count is reached.
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    count

    constant, ${expression}

    required

    A maximum count expression.

    Must evaluate to a positive integer. Defaults to "0" (zero)

    field

    expression

    optional

    The name of the field that will contain the current count value.

     

     

    Child Elements

    Name

    Requirements

     

    (Any block of code)

    optional

     

    Section
    Column
    width20%
    <not>
    Column
    Inverts a conditional element using a boolean NOT.

    Evaluates to true if the sub-element evaluates to false.

    Child Elements

    One of the following child elements is required:

    Name

     

    <and>

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

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

     

    <xor>

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

    Section
    Column
    width20%
    <or>
    Column
    Combines conditional elements using a boolean OR.

    Evaluates to true if any sub-element evaluates to true.

    Code Block
    xml
    xml
    <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 elements is required:

    Name

     

    <and>

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

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

     

    <not>

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

    <xor>

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

    Section
    Column
    width20%
    <return>
    Column
    Returns control (execution) to the calling process.
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    response-code

    constant, ${expression}

    optional

    A response code to return to the calling process.

    Defaults to the value of the containing <simple-method> element "default-success-code" attribute.

    Section
    Column
    width20%
    <then>
    Column
    Contains a block of code to be executed when a <condition> element evaluates to true.
    Code Block
    xml
    xml
    <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

    Name

    Requirements

     

    (Any block of code)

    optional

     

    Section
    Column
    width20%
    <while>
    Column
    Contains a block of code that is executed repeatedly while a <condition> element evaluates to true.
    Child Elements

    The following child elements are required:

    Name

     

    <condition>

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

    <then>

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

    Section
    Column
    width20%
    <xor>
    Column
    Combines conditional elements using a boolean XOR.

    Evaluates to true if only one sub-element evaluates to true.

    Child Elements

    One or more of the following child elements is required:

    Name

     

    <and>

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

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

     

     

    Call Operations

    Operations that transfer control to another process. Note that some of these operations behave like assignment operators - since they modify the script's state, but they are listed separately for clarity.

    Section
    Column
    width20%
    <call-bsh>
    Column
    Executes a BSH script.

    The script can be contained in a Java resource, and/or a short script can be included in the element body.
    If a Java resource is specified, and the element body contains a script, the element body script will be executed after the Java resource script is executed.

    Attributes

    Name

    Type

    Requirements

    Description

    Note

    resource

    constant

    required if the element body is empty

    A Java resource that contains the script.

     

    Warning

    Deprecated - use the <script> element.

    Section
    Column
    width20%
    <call-class-method>
    Column
    Calls a Java class method using the given fields as parameters.

    The <string> and <field> sub-elements are passed to the method as arguments in the order they are specified. If the method returns a value, the value will be put in the named field.

    Attributes

    Name

    Type

    Requirements

    Description

    Note

    class-name

    constant

    required

    The name of the class containing the static method.

     

    method-name

    constant

    required

    The name of the static method to call.

     

    ret-field

    expression

    optional

    The name of the field to put the method return value in.

     

    Child Elements

    One or more of the following child elements is optional:

    Name

     

    <string>

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

    <field>

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

    Warning

    Deprecated - use the <script> element.

    Section
    Column
    width20%
    <call-map-processor>
    Column
    Invokes a <simple-map-processor> element.

    The map processor can be contained in another file, and/or a <simple-map-processor> element can be included in the element body.
    If an XML resource is specified, and the element body contains a <simple-map-processor> element, the contained map processor will be executed after the external map processor is executed.

    Attributes

    Name

    Type

    Requirements

    Description

    Note

    in-map-name

    expression

    required

    The name of the field that contains the map to be processed.

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

    out-map-name

    expression

    required

    The name of the field that will receive the processed map.

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

    xml-resource

    constant

    optional

    The location of the map processor file.

     

    processor-name

    constant

    optional

    The name of the <simple-map-processor> element.

     

    error-list-name

    expression

    optional

    The name of the field that will contain a list of error messages generated by the processor.

    Defaults to "error_list".

     

    Child Elements

    The following child element is optional:

    Name

     

    <simple-map-processor>

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

    Section
    Column
    width20%
    <call-object-method>
    Column
    Calls a method on an existing Java object.

    The <string> and <field> sub-elements are passed to the method as arguments in the order they are specified. If the method returns a value, the value will be put in the named field.

    Attributes

    Name

    Type

    Requirements

    Description

    Note

    obj-field

    expression

    required

    The name of the field containing the object to be called.

    A runtime exception is thrown if the object is not found.

    method-name

    constant

    required

    The name of the method to call.

     

    ret-field

    expression

    optional

    The name of the field to put the method return value in.

     

     

    Child Elements

    One or more of the following child elements is optional:

    Name

     

    <string>

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

    <field>

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

    Warning

    Deprecated - use the <script> element.

    Section
    Column
    width20%
    <call-service>
    Column
    Invokes a service through the Service Engine.
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    service-name

    constant, ${expression}

    required

    The name of the service to invoke.

     

    in-map-name

    expression

    optional

    The name of a field containing a map that will be used for the service's IN parameters.

     

    include-user-login

    constant

    optional

    Include the current UserLogin entity value in the called service IN parameters.

    Defaults to "true".

    break-on-error

    constant

    optional

    Halt script execution if the called service returns an error.

    Defaults to "true".

    error-code

    constant

    optional

    The error code returned by the called service.

    Defaults to the enclosing <simple-method> "default-error-code" attribute value.

    success-code

    constant

    optional

    The success code returned by the called service.

    Defaults to the enclosing <simple-method> "default-success-code" attribute value.

    require-new-transaction

    constant

    optional

    Require a new transaction for the called service.

    Defaults to "false".

    transaction-timeout

    constant

    optional

    The timeout for the new transaction, in seconds.

    Defaults to the value set in the called service's definition.

     

    Child Elements

    Name

    Requirements

     

    <results-to-map>

    optional (one or more)

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

    <result-to-field>

    optional (one or more)

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

    <result-to-request>

    optional (one or more)

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

    <result-to-session>

    optional (one or more)

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

    <result-to-result>

    optional (one or more)

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

    <error-prefix>

    optional (only one)

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

    <error-suffix>

    optional (only one)

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

    <success-prefix>

    optional (only one)

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

    <success-suffix>

    optional (only one)

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

    <message-prefix>

    optional (only one)

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

    <message-suffix>

    optional (only one)

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

    <default-message>

    optional (only one)

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

    Section
    Column
    width20%
    <call-service-asynch>
    Column
    Invokes an OFBiz service asynchronously.
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    service-name

    constant, ${expression}

    required

    The name of the service to invoke.

     

    in-map-name

    expression

    optional

    The name of a field containing a map that will be used for the service's IN parameters.

     

    include-user-login

    constant

    optional

    Include the current UserLogin entity value in the called service IN parameters.

    Defaults to "true".

    Section
    Column
    width20%
    <call-simple-method>
    Column
    Invokes a Mini-language simple method.
    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    method-name

    constant

    required

    The name of the <simple-method> element.

     

    xml-resource

    constant

    optional

    The location of the <simple-method> file.

    Defaults to current file.

    scope

    constant

    optional

    The memory scope to use: "inline" or "function".

    When set to "inline", existing variables can be modified by the called script. When set to "function", existing variables are protected from modification, and the called script returns values via the <field-to-result> element. Defaults to "inline".

     

    Child Elements

    Name

    Requirements

     

    <result-to-field>

    optional (one or more), used when scope="function"

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

    Section
    Column
    width20%
    <default-message>
    Column
    Declares a message to be used when the called service does not return a message.

    The message can be included in the element body or in a Java resource.

    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    resource

    constant

    optional

    The name of a properties file on the classpath.

     

    property

    constant

    optional

    The property key.

     

    Section
    Column
    width20%
    <error-prefix>
    Column
    Declares a message to prepend to the error message.

    The message can be included in the element body or in a Java resource.

    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    resource

    constant

    optional

    The name of a properties file on the classpath.

     

    property

    constant

    optional

    The property key.

     

    Section
    Column
    width20%
    <error-suffix>
    Column
    Declares a message to append to the error message.

    The message can be included in the element body or in a Java resource.

    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    resource

    constant

    optional

    The name of a properties file on the classpath.

     

    property

    constant

    optional

    The property key.

     

    Section
    Column
    width20%
    <message-prefix>
    Column
    Declares a message to prepend to any kind of message.

    The message can be included in the element body or in a Java resource.

    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    resource

    constant

    optional

    The name of a properties file on the classpath.

     

    property

    constant

    optional

    The property key.

     

    Section
    Column
    width20%
    <message-suffix>
    Column
    Declares a message to append to any kind of message.

    The message can be included in the element body or in a Java resource.

    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    resource

    constant

    optional

    The name of a properties file on the classpath.

     

    property

    constant

    optional

    The property key.

     

    Section
    Column
    width20%
    <results-to-map>
    Column
    Copies the called service's result map to the specified field.
    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    map-name

    expression

    required

    The name of the target field.

     

    Section
    Column
    width20%
    <result-to-field>
    Column
    Copies the called service's OUT attribute to the specified field.
    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    result-name

    expression

    required

    The name of the called service's OUT attribute.

     

    field

    expression

    optional

    The name of target field.

    Defaults to the result-name attribute value.

    Section
    Column
    width20%
    <result-to-request>
    Column
    Copies the called service's OUT attribute to the specified request attribute.

    Valid only when the script is run in an event.

    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    result-name

    expression

    required

    The name of the called service's OUT attribute.

     

    request-name

    expression

    optional

    The name of the target request attribute.

    Defaults to the result-name attribute value.

    Section
    Column
    width20%
    <result-to-session>
    Column
    Copies the called service's OUT attribute to the specified session attribute.

    Valid only when the script is run in an event.

    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    result-name

    expression

    required

    The name of the called service's OUT attribute.

     

    session-name

    expression

    optional

    The name of the target session attribute.

    Defaults to the result-name attribute value.

    Section
    Column
    width20%
    <result-to-result>
    Column
    Copies service OUT attributes from a called service to the calling service's OUT attributes.

    This element can also be used to copy the called service OUT attributes to the return result of a simple-method called as a function.

    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    result-name

    expression

    required

    The name of the called service's OUT attribute.

     

    service-result-name

    expression

    optional

    The name of the calling service's OUT attribute (or function return result).

    Defaults to the result-name attribute value.

    Section
    Column
    width20%
    <script>
    Column
    Executes a script.

    The script can be contained in a Java resource, and/or a short inline script can be included in the element body or in the script attribute.
    If a Java resource is specified in addition to an inline script, the inline script will be executed after the Java resource script is executed.

    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    location

    constant

    required if script is empty

    The location of the script file.

    Script functions/methods can be invoked by appending a hash (#) and the function/method name.

    script

    script

    required if location and element body are empty

    A short script (scriptlet). Can be used instead of a file.

     

    Section
    Column
    width20%
    <success-prefix>
    Column
    Declares a message to prepend to the success message.

    The message can be included in the element body or in a Java resource.

    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    resource

    constant

    optional

    The name of a properties file on the classpath.

     

    property

    constant

    optional

    The property key.

     

    Section
    Column
    width20%
    <success-suffix>
    Column
    Declares a message to append to the success message.

    The message can be included in the element body or in a Java resource.

    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    resource

    constant

    optional

    The name of a properties file on the classpath.

     

    property

    constant

    optional

    The property key.

     

     

    Entity Operations

    Operations that interact with a data source. Note that many of these operations behave like assignment operators - since they modify the script's state, but they are listed separately for clarity.

    Section
    Column
    width20%
    <clear-cache-line>
    Column
    Clears entity values from the cache.
    Code Block
    xml
    xml
    <clear-cache-line entity-name="Party" />
    
    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    entity-name

    constant, ${expression}

    required

    The name of the entity.

     

    map

    expression

    optional

    The name of a field containing a map that will be used to find matching entity values.

    If the fields in the map form the full primary key the entry will be removed from the byPrimaryKey cache. If the map exists but the fields do not include a full primary key the entry will be removed from the byAnd cache. If no map name is specified the entry will be removed from the all caches.

    Section
    Column
    width20%
    <clear-entity-caches>
    Column
    Removes all entity values from the cache.

    This element should be used sparingly because of the performance impact.

    Section
    Column
    width20%
    <clone-value>
    Column
    Creates a copy of an entity value.
    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    value-field

    expression

    required

    The name of the field that contains the entity value to be copied.

    The operation does nothing if the entity value is not found.

    new-value-field

    expression

    required

    The name of the field that will contain the new entity value.

     

    Section
    Column
    width20%
    <condition-expr>
    Column
    Uses an SQL operator to compare an entity field to a variable or constant value.
    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    field-name

    constant

    required

    The name of the entity field that will be compared. The l-value.

     

    operator

    constant

    required

    The SQL operator.

    If set to "between" then the r-value must be a collection that has two entries in it. If set to "in" or "not-in" then the r-value must be a collection. Defaults to "equals".

    from-field

    expression

    required if the value attribute is empty

    The name of an environment field that the entity field will be compared to. The r-value.

     

    value

    constant, ${expression}

    required if the from-field attribute is empty

    A constant value that the entity field will be compared to. The r-value.

     

    ignore-if-null

    constant

    optional

    Ignore the condition if the r-value is null.

    Defaults to "false".

    ignore-if-empty

    constant

    optional

    Ignore the condition if the r-value is empty.

    Defaults to "false".

    ignore-case

    constant

    optional

    Perform a case-insensitive comparison.

    Defaults to "false".

    ignore

    constant, ${expression}

    optional

    Ignore the condition if the r-value evaluates to "true".

    Defaults to "false".

    Section
    Column
    width20%
    <condition-list>
    Column
    Uses an SQL operator to combine entity find conditions into a single expression.
    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    combine

    constant

    required

    The SQL operator.

    Defaults to "and".

     

    Child Elements

    One or more of the following child elements is required:

    Name

     

    <condition-expr>

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

    <condition-list>

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

    <condition-object>

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

    Section
    Column
    width20%
    <condition-object>
    Column
    Declares an environment field (variable) that contains an entity find condition expression object.
    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    field

    expression

    required

    The name of the field that contains an entity find condition expression object

     

    Section
    Column
    width20%
    <create-value>
    Column
    Creates a new entity value in the data source.
    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    value-field

    expression

    required

    The name of the field that contains the entity value to be created.

    The operation generates an error and halts script execution if the entity value is not found.

    do-cache-clear

    constant

    optional

    Clear the cache.

    Defaults to "true".

    or-store

    constant

    optional

    Store the entity value if it already exists.

    Defaults to "false". If set to "false", an error will result if an instance of the entity value exists in the data source with the same primary key.

    Section
    Column
    width20%
    <entity-and>
    Column
    Finds a group of entity values by using a set of entity field name/value pairs that are ANDed together.

    The name/value pairs used for the search are defined in child elements.

    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    entity-name

    constant, ${expression}

    required

    The name of the entity to search in.

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

    list

    expression

    required

    The name of the field that will contain the result list.

     

    filter-by-date

    constant, ${expression}

    optional

    Filter the result list by the current date.

    The entity must have "fromDate" and "thruDate" fields. Defaults to "false".

    distinct

    constant, ${expression}

    optional

    Filter the results so that all of them are unique.

    Defaults to "false".

    use-cache

    constant, ${expression}

    optional

    Use the entity cache.

    Defaults to "false".

    delegator-name

    constant, ${expression}

    optional

    Overrides the current delegator by specifying a delegator name.

     

     

    Child Elements

    Name

    Requirements

     

    <field-map>

    required (one or more)

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

    <select-field>

    optional (one or more)

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

    <order-by>

    optional (one or more)

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

    <limit-range>

    optional (only one)

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

    <limit-view>

    optional (only one)

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

    <use-iterator>

    optional (only one)

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

    Section
    Column
    width20%
    <entity-condition>
    Column
    Finds a group of entity values by using a condition expression.
    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    entity-name

    constant, ${expression}

    required

    The name of the entity to search in.

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

    list

    expression

    required

    The name of the field that will contain the result list.

     

    filter-by-date

    constant, ${expression}

    optional

    Filter the result list by the current date.

    The entity must have "fromDate" and "thruDate" fields. Defaults to "false".

    distinct

    constant, ${expression}

    optional

    Filter the results so that all of them are unique.

    Defaults to "false".

    use-cache

    constant, ${expression}

    optional

    Use the entity cache.

    Defaults to "false".

    delegator-name

    constant, ${expression}

    optional

    Overrides the current delegator by specifying a delegator name.

     

     

    Child Elements

    One of the following child elements is required:

    Name

     

    <condition-expr>

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

    <condition-list>

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

    <condition-object>

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

    The following child elements are optional:

    Name

    Requirements

     

    <having-condition-list>

    optional (only one)

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

    <select-field>

    optional (one or more)

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

    <order-by>

    optional (one or more)

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

    <limit-range>

    optional (only one)

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

    <limit-view>

    optional (only one)

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

    <use-iterator>

    optional (only one)

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

    Section
    Column
    width20%
    <entity-count>
    Column
    Counts a group of entity values that match a condition expression.
    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    entity-name

    constant, ${expression}

    required

    The name of the entity to count in.

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

    count-field

    expression

    required

    Name of the field that will contain the count result.

     

    delegator-name

    constant, ${expression}

    optional

    Overrides the current delegator by specifying a delegator name.

     

     

    Child Elements

    One of the following child elements is required:

    Name

     

    <condition-expr>

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

    <condition-list>

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

    <condition-object>

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

    The following child element is optional:

    Name

     

    <having-condition-list>

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

    Section
    Column
    width20%
    <entity-data>
    Column
    Load or assert an entity data XML file.

    The operation can be used in two modes: "load" or "assert". The "load" mode will load the XML entity data into the data source. The "assert" mode will compare the XML entity data with the data source - any mismatched or missing data will be logged in the error message list.

    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    location

    constant, ${expression}

    required

    The location of an XML file to load in data source mode or to verify in assert mode.

    A message will be added to the error message list if the file is not found.

    mode

    constant

    optional

    Operation mode: "load" or "assert".

    Defaults to "load".

    timeout

    constant

    optional

    Override the current transaction to start a new transaction and load the data with a different timeout.

    Valid only when mode="load".

    error-list-name

    constant, ${expression}

    optional

    The name of the error message list.

    Defaults to "error_list". It will be created if it does not exist.

    delegator-name

    constant, ${expression}

    optional

    Overrides the current delegator by specifying a delegator name.

     

    Section
    Column
    width20%
    <entity-one>
    Column
    Finds a single entity value by using the primary key.

    The primary key can be specified in the <field-map> child elements, or if they are absent, the primary key will be constructed from matching environment fields.

    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    entity-name

    constant, ${expression}

    required

    The name of the entity to search in.

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

    value-field

    expression

    required

    The name of the field that will contain the entity value.

     

    use-cache

    constant, ${expression}

    optional

    Use the entity cache.

    Defaults to "false".

    auto-field-map

    constant, ${expression}

    optional

    Look for all primary key field names in the current context as well as in the parameters map.

    Defaults to "true".

     

    Child Elements

    Name

    Requirements

     

    <field-map>

    optional(one or more)

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

    <select-field>

    optional (one or more)

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

    Section
    Column
    width20%
    <field-map>
    Column
    Declares an entity field name/value pair.
    Attributes

    Name

    Type

    Requirements

    Description

    Note

    field-name

    expression

    required

    The name of the entity field.

    Defaults to from-field attribute value.

    from-field

    expression

    required if the value attribute is empty.

    The name of an environment field that contains the entity field value.

     

    value

    constant+expr

    required if the from-field attribute is empty.

    A constant entity field value.

     

    Section
    Column
    width20%
    <filter-list-by-and>
    Column
    Filters a list of entity values by the fields in the specified map.

    Each entity value in the list will be compared to the specified map, and if the entity value's fields match the map, the entity value will be copied to the target list.

    Attributes

    Name

    Type

    Requirements

    Description

    Note

    list

    expression

    required

    The name of the field that contains the list of entity values.

     

    map

    expression

    required

    The name of the field that contains the map that will be used for the entity field comparison.

     

    to-list

    expression

    optional

    The name of the field the filtered list will be put into.

    Defaults to the value of the list attribute (operation replaces the old list).

    Section
    Column
    width20%
    <filter-list-by-date>
    Column
    Filters a list of entity values by their date-range fields.

    Each entity value in the list will be compared to the specified date, and if the entity value's date-range fields include the date, the entity value will be copied to the target list.

    Attributes

    Name

    Type

    Requirements

    Description

    Note

    list

    expression

    required

    The name of the field that contains the list of entity values.

     

    to-list

    expression

    optional

    The name of the field the filtered list will be put into.

    Defaults to the value of the list attribute (operation replaces the old list).

    valid-date

    expression

    optional

    The name of a field that contains the date object to filter by.

    The date object must be a java.sql.Timestamp data type. Defaults to now.

    from-field-name

    constant

    optional

    The name of the entity field to use as the beginning date.

    Defaults to "fromDate".

    thru-field-name

    constant

    optional

    The name of the entity field to use as the ending date.

    Defaults to "thruDate".

    Section
    Column
    width20%
    <find-by-and>
    Column
    Finds a group of entity values by using a set of entity field name/value pairs that are ANDed together.

    The name/value pairs used for the search are contained in a map.

    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    entity-name

    constant, ${expression}

    required

    The name of the entity to search in.

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

    list

    expression

    required

    The name of the field that will contain the result list.

     

    map

    expression

    required

    The name of the field containing a map that will be used for the search.

    The map name/value pairs will be combined using a boolean AND.

    order-by-list

    expression

    optional

    The name of the field containing a list that contains field names that you want the operation to order the results by.

    Each entry in the list is a field name. The field name can be preceded by a plus or a minus sign to specify an ascending or descending sort for that field. The default is ascending sort.

    fields-to-select-list

    expression

    optional

    The name of a list or set in the method environment that contains field names to select.

     

    use-cache

    constant, ${expression}

    optional

    Use the entity cache.

    Defaults to "false".

    use-iterator

    constant, ${expression}

    optional

    Use the EntityListIterator when doing the query.

    This is much more efficient for large data sets because the results are read incrementaly instead of all at once. The EntityListIterator must be closed when you are finished, but this is done automatically by the iterate operation. Defaults to "false".

    delegator-name

    constant, ${expression}

    optional

    Overrides the current delegator by specifying a delegator name.

     

    Section
    Column
    width20%
    <find-by-primary-key>
    Column
    Returns a single entity value that is retrieved from the data source by using the primary key.

    The primary key used for the search is contained in a map.

    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    entity-name

    constant, ${expression}

    optional if the entity name comes from the primary key map

    The name of the entity to search in.

    If the primary key map is an entity value, then the value's entity name can be used instead of this attribute. A runtime exception will be thrown if the entity does not exist.

    value-field

    expression

    required

    The name of the field that will contain the entity value.

     

    map

    expression

    required

    The name of the field containing a map that will be used for the search.

     

    fields-to-select-list

    expression

    optional

    The name of a list or set in the method environment that contains field names to select.

     

    use-cache

    constant, ${expression}

    optional

    Use the entity cache.

    Defaults to "false".

    delegator-name

    constant, ${expression}

    optional

    Overrides the current delegator by specifying a delegator name.

     

    Section
    Column
    width20%
    <get-related>
    Column
    Finds entity values that are related to an existing entity value.
    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    value-field

    expression

    required

    The name of the field containing the entity value.

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

    relation-name

    constant, ${expression}

    required

    The name of the entity value relation to use.

    Script execution will halt if the relation does not exist.

    list

    expression

    required

    The name of the field that will contain the result list.

     

    map

    expression

    required

    The name of the field containing a map that will be used for the search.

    The map name/value pairs will be combined using a boolean AND. All entity values will be found if this attribute is empty.

    order-by-list

    expression

    optional

    The name of the field containing a list that contains field names that you want the operation to order the results by.

    Each entry in the list is a field name. The field name can be preceded by a plus or a minus sign to specify an ascending or descending sort for that field. The default is ascending sort.

    use-cache

    constant, ${expression}

    optional

    Use the entity cache.

    Defaults to "false"

    Section
    Column
    width20%
    <field-to-field>
    Deprecated. Use <set>
    Column
    Warning

    .

  • Currently, both attributes are optional. Require both attributes.
  • Deprecate and replace with UEL expression
    Section
    Column
    width20%
    <fieldtolist>

    Attributes

    Column
    Finds an entity value that is related to an existing entity value.
    Attributes

    Name

    Type

    Requirements

    Description

    Notes

    value-field

    expression

    required

    The name of the field containing the entity value.

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

    relation-name

    constant, ${expression}

    required

    The name of the entity value relation to use.

    Script execution will halt if the relation does not exist.

    to-value-field

    expression

    required

    The name of the field that will contain the related entity value.

     

    use-cache

    constant, ${expression}

    optional

    Use the entity cache.

    Defaults to "false"

    Copies a field to a list.
    Code Block
    xmlxml
    
    <field-to-list list="barList" field="foo" />
    

    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

    .