메뉴 닫기

3.5.2. Mini Language Simple Method Reference

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

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

Older 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
TypeDescriptionExample
constantA string constant. The string may not include an expression.name=”fooMethod”
constant+exprA string constant. The string may include an expression, but an expression-only string is not allowed.default=”${foo}Method”
expressionUEL expression without enclosing brackets.from=”item.quantity * item.priceEach”
${expression}UEL expression with enclosing brackets.default=”${parameters.itemId}”
scriptA short script (“scriptlet”).script=”groovy:foo.bar();”

The <simple-method> element

<simple-method>
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.

<simple-method method-name="fooMethod">  <!-- some mini-language code goes here --></simple-method>
Attributes
NameTypeRequirementsDescriptionNote
method-nameconstantrequiredA name (preferably a legal Java identifier) for this method.Each simple method in a file must have a unique name.
short-descriptionconstantoptionalA short description of the method.Used for documentation.
login-requiredconstantoptionalRequire a user login to run this method.Defaults to “true”.
use-transactionconstantoptionalCreate a transaction if none exists for this thread.Defaults to “true”.
default-error-codeconstantoptionalThe default error return code.Defaults to “error”.
default-success-codeconstantoptionalThe default success return code.Defaults to “success”.
event-request-object-nameconstantoptionalThe name of the field containing the javax.servlet.ServletRequest object.Defaults to “request”.
event-response-object-nameconstantoptionalThe name of the field containing the javax.servlet.ServletResponse object.Defaults to “response”.
event-session-object-nameconstantoptionalThe name of the field containing the javax.servlet.http.HttpSession object.Defaults to “session”.
event-response-code-nameconstantoptionalThe name of the field containing the event response code.Defaults to “_response_code_”.
event-error-message-nameconstantoptionalThe name of the field containing the event error message.Defaults to “_error_message_”.
event-error-message-list-nameconstantoptionalThe name of the field containing the event message list.Defaults to “_error_message_list_”.
event-event-message-nameconstantoptionalThe name of the field containing the event message.Defaults to “_event_message_”.
event-event-message-list-nameconstantoptionalThe name of the field containing the event message list.Defaults to “_event_message_list_”.
service-response-message-nameconstantoptionalThe name of the field containing the service response message.Defaults to “responseMessage”.
service-error-message-nameconstantoptionalThe name of the field containing the service error message.Defaults to “errorMessage”.
service-error-message-list-nameconstantoptionalThe name of the field containing the service error message list.Defaults to “errorMessageList”.
service-error-message-map-nameconstantoptionalThe name of the field containing the service error message map.Defaults to “errorMessageMap”.
service-success-message-nameconstantoptionalThe name of the field containing the service success message.Defaults to “successMessage”.
service-success-message-list-nameconstantoptionalThe name of the field containing the service success message list.Defaults to “successMessageList”.
Child Elements
NameRequirements 
(Any block of code)optional 

Assignment Operations

Assignment operations modify the script’s state.

<add-error>
Adds a message to the error message list.
<add-error>  <fail-message message="There was an error" /></add-error>
Attributes
NameTypeRequirementsDescriptionNote
error-list-nameconstantoptionalThe 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-{{}})
<alt-permission>
Declares an alternate permission (<check-permission> sub-element).

Alternate permissions are checked when the primary permission check fails.

Attributes
NameTypeRequirementsDescriptionNote
permissionconstant, ${expression}requiredThe permission to check. 
actionconstant, ${expression}optionalThe action to be performed (permission scope).Examples: “_ADMIN”, “_CREATE”, “_UPDATE”.
<assert>
Adds an error message to the error message list for each condition that evaluates to false.
Attributes
NameTypeRequirementsDescriptionNote
titleconstant, ${expression}optionalThe title of the assert operation.The title is used in test reports.
error-list-nameconstantoptionalThe 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-{{}})
<check-id>
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
NameTypeRequirementsDescriptionNote
fieldexpressionoptionalThe name of the field to test. 
error-list-nameconstantoptionalThe 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-{{}})
<check-permission>
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
NameTypeRequirementsDescriptionNote
permissionconstant, ${expression}requiredThe permission to check. 
actionconstant, ${expression}optionalThe action to be performed (permission scope).Examples: “_ADMIN”, “_CREATE”, “_UPDATE”.
error-list-nameconstantoptionalThe 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-{{}})
<clear-field>
Sets the value of the specified field to null.
<clear-field field="foo" />
Attributes
NameTypeRequirementsDescriptionNote
fieldexpressionrequiredThe name of the field to remove. 
<create-object>
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.

<create-object field="foo" class-name="com.acme.FooClass">  <string value="bar" />  <field field="foo" /></create-object>
Attributes
NameTypeRequirementsDescriptionNote
fieldexpressionrequiredThe name of the field for the new object. 
class-nameconstantrequiredThe Java class name. 
Child Elements
NameRequirements 
<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-{{}})

Deprecated – use the <script> element.

<fail-message>
Declares an error message.
<add-error>  <fail-message message="There was an error." /></add-error>
Attributes
NameTypeRequirementsDescriptionNote
messageconstant+exprrequiredThe message text. 
<fail-property>
Declares an error message found in a properties file.
<add-error>  <fail-property resource="ErrorMessages" property="FooError" /></add-error>
Attributes
NameTypeRequirementsDescriptionNote
resourceconstantrequiredThe name of the resource where the message can be found. 
propertyconstantrequiredThe message property key. 
<field>
Declares an environment field to be passed as an argument to an object method call.
Attributes
NameTypeRequirementsDescriptionNote
fieldexpressionrequiredThe name of the environment field to use. 
typeconstantoptionalThe Java class of the argument.Defaults to “java.lang.String”.
<field-to-list>
Appends an object to the specified list.
<field-to-list list="barList" field="foo" />
Attributes
NameTypeRequirementsDescriptionNote
fieldexpressionrequiredThe field to add to the list.The operation does nothing if the field does not exist.
listexpressionrequiredName of the list.If the list does not exist, one is created.

Deprecated – use the <set> element.

<field-to-request>
Copies a field to a servlet request attribute.

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

<field-to-request field="foo" request-name="fooAttribute" />
Attributes
NameTypeRequirementsDescriptionNote
fieldexpressionrequiredThe name of the field to copy from. The source of the assignment.The operation does nothing if the field does not exist.
request-nameconstant, ${expression}optionalThe servlet request attribute name. The target of the assignment.Defaults to the value of field attribute.
<field-to-result>
Copies a field to a service OUT attribute.
<field-to-result field="foo" result-name="fooAttribute" />
Attributes
NameTypeRequirementsDescriptionNote
fieldexpressionrequiredThe name of the field to copy from. The source of the assignment.The operation does nothing if the field does not exist.
result-nameexpressionoptionalThe name of the result field to set. The target of the assignment.Defaults to the value of field attribute.
<field-to-session>
Copies a field to a servlet session attribute.

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

<field-to-session field="foo" session-name="fooAttribute" />
Attributes
NameTypeRequirementsDescriptionNote
fieldexpressionrequiredThe name of the field to copy from. The source of the assignment.The operation does nothing if the field does not exist.
session-nameconstant, ${expression}optionalThe servlet session attribute name. The target of the assignment.Defaults to the value of field attribute.
<first-from-list>
Assigns the first (lowest order) entry in a list to a field.
<first-from-list entry-name="foo" list="fooList" />
Attributes
NameTypeRequirementsDescriptionNote
entry-nameexpressionrequiredThe name of the field to set. 
listexpressionrequiredThe name of the list that contains the object to copy.Defaults to a null value if the list does not exist or is empty.

Deprecated – use the <set> element.

<list-to-list>
Copies list elements to another list.
<list-to-list list="foo" to-list-name="fooList" />
Attributes
NameTypeRequirementsDescriptionNote
listexpressionrequiredThe name of the list to copy from.Operation does nothing if the list does not exist.
to-list-nameexpressionrequiredName of the list to copy to.If the list does not exist, one will be created.
<map-to-map>
Copies a map to another map.
<map-to-map map="oldMap" to-map="newMap" />
Attributes
NameTypeRequirementsDescriptionNote
mapexpressionrequiredThe name of the map to copy from.Operation does nothing if the map does not exist.
to-mapexpressionoptionalThe name of the map to copy to.If this attribute is empty, the source map will be copied to the current environment.
<now>
Sets a field to the current system time.
<now field="fooNow" />
Attributes
NameTypeRequirementsDescriptionNote
fieldexpressionrequiredThe name of the field to set, the target of the assignment. 
typeconstantoptionalThe field data type.Defaults to “java.sql.Timestamp”.
<now-date-to-env>
Sets a field to a java.sql.Date object initialized to the current system time.
Attributes
NameTypeRequirementsDescriptionNote
fieldexpressionrequiredThe name of the field to set, the target of the assignment. 

Deprecated – use the <now> element.

<now-timestamp>
Sets a field to a java.sql.Timestamp object initialized to the current system time.
Attributes
NameTypeRequirementsDescriptionNote
fieldexpressionrequiredThe name of the field to set, the target of the assignment. 

Deprecated – use the <now> element.

<order-by>
Declares a field or map key to sort on.
<order-map-list list="fooList">    <order-by field="fooKey" /></order-map-list>
Attributes
NameTypeRequirementsDescriptionNote
fieldexpressionrequiredThe name of the field or map key to sort on. 
<order-map-list>
Sorts a list of maps.

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

<order-map-list list="fooList">    <order-by field="fooKey" /></order-map-list>
Attributes
NameTypeRequirementsDescriptionNote
listexpressionrequiredThe 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-{{}})
<property-to-field>
Assigns a resource property value to a field.
<property-to-field field="foo" resource="fooResource.properties" property="fooKey" />
Attributes
NameTypeRequirementsDescriptionNote
fieldexpressionrequiredThe name of the field to set, the target of the assignment. 
resourceconstant, ${expression}requiredThe name of a properties resource. Can be a file on the classpath or a resource defined in the SystemProperty entity. 
propertyconstant, ${expression}requiredThe property key. 
defaultconstant, ${expression}optionalThe default value to use if the property value is null or empty. 
no-localeconstantoptionalSuppress property value localization. The user’s/system locale will be ignored when retrieving the property value.Default is “false”.
arg-listexpressionoptionalThe 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.
<request-parameters-to-list>
Appends a servlet request parameter list to a list.

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

<request-parameters-to-list list="fooList" request-name="fooParameter" />
Attributes
NameTypeRequirementsDescriptionNote
request-nameconstant, ${expression}requiredThe name of the servlet request parameter. All matching parameter values will be added to the list. 
listexpressionoptionalThe name of the list.If the list does not exist, one will be created. Defaults to the request-name attribute value.
<request-to-field>
Copies a servlet request attribute to a field.

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

<request-to-field field="foo" request-name="fooAttribute" />
Attributes
NameTypeRequirementsDescriptionNote
fieldexpressionrequiredThe name of the field to set, the target of the assignment. 
request-nameconstant, ${expression}optionalThe servlet request attribute name.Defaults to the value of field attribute.
defaultconstant, ${expression}optionalA default value to use if the request attribute does not exist. 
<session-to-field>
Copies a servlet session attribute to a field.

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

<session-to-field field="foo" session-name="fooAttribute" />
Attributes
NameTypeRequirementsDescriptionNote
fieldexpressionrequiredThe name of the field to set, the target of the assignment. 
session-nameconstant, ${expression}optionalThe servlet session attribute name.Defaults to the value of the field attribute.
defaultconstant, ${expression}optionalA default value to use if the session attribute does not exist. 
<set>
Assigns a field from an expression or script, or from a constant value.
<set field="foo" value="bar" /><set field="baz" from="foo" /><!-- Field "baz" contains the string "bar" -->
Attributes
NameTypeRequirementsDescriptionNotes
fieldexpressionrequiredThe name of the field to set, the target of the assignment. 
fromexpression, scriptrequired if value is emptyAn expression or script that returns an object or null.The script must be prefixed with the script language followed by a colon (“:”).
valueconstant+exprrequired if from is emptyA constant value.Default type = “java.lang.String”.
defaultconstant, ${expression}optionalA default value that is used when the from attribute evaluates to null or empty. 
typeconstantoptionalThe 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.
localeconstant, ${expression}optionalIf a locale dependent type is passed allows to i18n the value.Defaults to environment locale.
set-if-nullconstantoptionalControls if field can be set to null.Defaults to “false”.
set-if-emptyconstantoptionalControls if field can be set to an empty value. The meaning of “empty” depends on the Java data type.Defaults to “true”.
<set-calendar>
Adjusts a Timestamp by a specified time duration.
<set-calendar field="tomorrowStamp" from-field="nowTimestamp" day="1" /><set-calendar field="yesterdayStamp" from-field="nowTimestamp" day="-1" />
Attributes
NameTypeRequirementsDescriptionNotes
fieldexpressionrequiredThe name of the field to set, the target of the assignment. 
fromexpression, scriptrequired if value is emptyAn expression or script that returns an object or null.The script must be prefixed with the script language followed by a colon (“:”).
valueconstant+exprrequired if from is emptyA constant value.Default type = “java.lang.String”.
defaultconstant, ${expression}optionalA default value that is used when the from attribute evaluates to null or empty. 
set-if-nullconstantoptionalControls if field can be set to null.Defaults to “false”.
yearsconstant, ${expression}optionalAdd (optionally using +) or subtract (using -) a number of year(s).If an expression is used, it should evaluate to an integer.
monthsconstant, ${expression}optionalAdd (optionally using +) or subtract (using -) a number of month(s).If an expression is used, it should evaluate to an integer.
daysconstant, ${expression}optionalAdd (optionally using +) or subtract (using -) a number of days(s).If an expression is used, it should evaluate to an integer.
hoursconstant, ${expression}optionalAdd (optionally using +) or subtract (using -) a number of hour(s).If an expression is used, it should evaluate to an integer.
minutesconstant, ${expression}optionalAdd (optionally using +) or subtract (using -) a number of minute(s).If an expression is used, it should evaluate to an integer.
secondsconstant, ${expression}optionalAdd (optionally using +) or subtract (using -) a number of second(s).If an expression is used, it should evaluate to an integer.
millisconstant, ${expression}optionalAdd (optionally using +) or subtract (using -) a number of milli-second(s).If an expression is used, it should evaluate to an integer.
period-align-startconstant, ${expression}optionalAlign the adjusted date to the start of a period: “day”, “week”, “month”, “year” 
period-align-endconstant, ${expression}optionalAlign the adjusted date to the end of a period: “day”, “week”, “month”, “year” 
localeconstant, ${expression}optionalThe locale (calendar) to be used for the operationDefaults to the environment locale.
time-zoneconstant, ${expression}optionalThe time zone to be used for the operationDefaults to the environment time zone.
<set-current-user-login>
Sets the UserLogin entity value to be used for authentication for the rest of the method.
Attributes
NameTypeRequirementsDescriptionNotes
value-fieldexpressionrequiredThe name of the field that contains the UserLogin entity value.A runtime exception will be thrown if the entity value does not exist.

Deprecated – you can pass an alternate UserLogin entity value to the called service’s IN attributes.

<set-service-fields>
Copies map elements that match a service’s IN attributes from a source map to a target map.
<set-service-fields service-name="fooService" map="barMap" to-map="fooServiceAttributes" />
Attributes
NameTypeRequirementsDescriptionNotes
service-nameconstant, ${expression}requiredThe name of the service. 
mapexpressionrequiredThe name of the map to copy the matching IN attributes from.The operation does nothing if the map does not exist.
to-mapexpressionrequiredThe name of the map to copy the matching IN attributes to.If the map does not exist, a new one is created.
<string>
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
NameTypeRequirementsDescriptionNote
valueconstant, ${expression}optionalThe String text. 
<string-append>
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
NameTypeRequirementsDescriptionNotes
fieldexpressionrequiredThe name of the field to set, the target of the assignment. 
stringconstant, ${expression}requiredThe 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-listexpressionoptionalThe 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.
prefixconstant, ${expression}optionalA string that will be prepended to the string attribute value. 
suffixconstant, ${expression}optionalA string that will be appended to the string attribute value. 
<string-to-list>
Adds a string to a list of strings.
Attributes
NameTypeRequirementsDescriptionNotes
stringconstant, ${expression}requiredThe string to add to the list specified in the list attribute. 
listexpressionrequiredList to add the string to.If the list does not exist, one will be created.
arg-listexpressionoptionalThe 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-fieldconstantoptionalInserts a message above a field (used in conjunction with @fieldErrors FTL macro). 

Deprecated – use the <set> element.

<to-string>
Converts an object to a string.
Attributes
NameTypeRequirementsDescriptionNotes
fieldexpressionrequiredThe name of the field containing the object to convert.The operation does nothing if the object is not found.
formatconstantoptionalThe format to use for the conversion. 
numeric-paddingconstantoptionalLeft-pad the string with the specified number of zeroes. 

Deprecated – use the <set> element.

<webapp-property-to-field>
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.

<webapp-property-to-field field="foo" resource="/WEB-INF/foo.properties" property="fooKey" />
Attributes
NameTypeRequirementsDescriptionNotes
fieldexpressionrequiredThe name of the field to set, the target of the assignment. 
resourceconstant, ${expression}requiredThe 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”.
propertyconstant, ${expression}requiredThe property key. 
defaultconstant, ${expression}optionalA default value to use if the property value is null or empty. 

Conditional/Looping Statements

Conditional/looping statements control the script execution path.

<and>
Combines conditional elements using a boolean AND.

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

<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-{{}})
<break>
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-{{}})
<check-errors>
Halts script execution if the error message list contains any messages.

The error message list is returned to the calling process.

Attributes
NameTypeRequirementsDescriptionNote
error-codeconstant, ${expression}optionalThe error code to return to the calling process.Defaults to value of the containing <simple-method> element “default-error-code” attribute.
error-list-nameconstant, ${expression}optionalThe name of a list that will contain the message.Defaults to “error_list”.
<condition>
Combines a group of conditional elements into a single logical (true/false) expression.
<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-{{}})
<continue>
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-{{}})
<else>
Contains a block of code to be executed when a condition evaluates to false.
<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
NameRequirements 
(Any block of code)optional 
<else-if>
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.

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

<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
NameRequirements 
<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-{{}})
<if-compare>
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
NameTypeRequirementsDescriptionNote
fieldexpressionrequiredThe name of the field that will be compared. The l-value. 
operatorconstantrequiredThe 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.
valueconstant+exprignored when operator attribute equals “is-null”, “is-not-null”, or “is-empty” – required otherwiseThe value that the field will be compared to. The r-value. 
typeconstantoptionalThe 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”.
formatconstant, ${expression}optionalFormat used for type conversions.Valid only when the type attribute is not empty.
Child Elements (stand-alone version only)
NameRequirements 
(Any block of code)optional 
<else>optional(?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})
<if-compare-field>
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
NameTypeRequirementsDescriptionNote
fieldexpressionrequiredThe name of the field that will be compared. The l-value. 
operatorconstantrequiredThe 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-fieldexpressionrequiredThe name of the field that field will be compared to. The r-value. 
typeconstantoptionalThe 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”.
formatconstant, ${expression}optionalFormat used for type conversions.Valid only when the type attribute is not empty.
Child Elements (stand-alone version only)
NameRequirements 
(Any block of code)optional 
<else>optional(?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})
<if-empty>
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).

NameTypeRequirementsDescriptionNote
fieldexpressionrequiredThe 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)
NameRequirements 
(Any block of code)optional 
<else>optional(?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})
<if-has-permission>
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
NameTypeRequirementsDescriptionNote
permissionconstant, ${expression}requiredThe permission to check. 
actionconstant, ${expression}optionalThe action to be performed (permission scope).Examples: “_ADMIN”, “_CREATE”, “_UPDATE”.
Child Elements (stand-alone version only)
NameRequirements 
(Any block of code)optional 
<else>optional(?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})
<if-instance-of>
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
NameTypeRequirementsDescriptionNote
fieldexpressionrequiredThe name of the field to test.Test evaluates to false if the field does not exist.
classconstantrequiredThe name of the class to test for.Attribute must contain a valid Java class name.
Child Elements
NameRequirements 
(Any block of code)optional 
<else>optional(?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})
<if-not-empty>
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
NameTypeRequirementsDescriptionNote
fieldexpressionrequiredThe 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
NameRequirements 
(Any block of code)optional 
<else>optional(?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})
<if-regexp>
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
NameTypeRequirementsDescriptionNote
fieldexpressionrequiredThe 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.
exprconstant, ${expression}requiredThe regular expression to test for. 
Child Elements (stand-alone version only)
NameRequirements 
(Any block of code)optional 
<else>optional(?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})
<if-validate-method>
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
NameTypeRequirementsDescriptionNote
fieldexpressionrequiredThe 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.
methodconstantrequiredThe 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.
classconstantoptionalThe name of the Java class that contains the validation method.Defaults to “org.ofbiz.base.util.UtilValidate”.
Child Elements (stand-alone version only)
NameRequirements 
(Any block of code)optional 
<else>optional(?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})
<iterate>
Contains a block of code that is executed once for each entry in a collection.
Attributes
NameTypeRequirementsDescriptionNote
listexpressionrequiredThe name of the field that contains the collection to iterate over.The operation does nothing if the field is not found.
entryexpressionrequiredThe name of the field that will contain the current collection entry. 
Child Elements
NameRequirements 
(Any block of code)optional 
<iterate-map>
Contains a block of code that is executed once for each entry in a map.
Attributes
NameTypeRequirementsDescriptionNote
mapexpressionrequiredThe name of the field that contains the map to iterate over.The operation does nothing if the field is not found.
keyexpressionrequiredThe name of the field that will contain the current map entry key. 
valueexpressionrequiredThe name of the field that will contain the current map entry value. 
Child Elements
NameRequirements 
(Any block of code)optional 
<loop>
Contains a block of code that is executed repeatedly until a maximum count is reached.
Attributes
NameTypeRequirementsDescriptionNote
countconstant, ${expression}requiredA maximum count expression.Must evaluate to a positive integer. Defaults to “0” (zero)
fieldexpressionoptionalThe name of the field that will contain the current count value. 
Child Elements
NameRequirements 
(Any block of code)optional 
<not>
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-{{}})
<or>
Combines conditional elements using a boolean OR.

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

<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-{{}})
<return>
Returns control (execution) to the calling process.
Attributes
NameTypeRequirementsDescriptionNote
response-codeconstant, ${expression}optionalA response code to return to the calling process.Defaults to the value of the containing <simple-method> element “default-success-code” attribute.
<then>
Contains a block of code to be executed when a <condition> element evaluates to true.
<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
NameRequirements 
(Any block of code)optional 
<while>
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-{{}})
<xor>
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.

<call-bsh>
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
NameTypeRequirementsDescriptionNote
resourceconstantrequired if the element body is emptyA Java resource that contains the script. 

Deprecated – use the <script> element.

<call-class-method>
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
NameTypeRequirementsDescriptionNote
class-nameconstantrequiredThe name of the class containing the static method. 
method-nameconstantrequiredThe name of the static method to call. 
ret-fieldexpressionoptionalThe 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-{{}})

Deprecated – use the <script> element.

<call-map-processor>
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
NameTypeRequirementsDescriptionNote
in-map-nameexpressionrequiredThe name of the field that contains the map to be processed.If the map does not exist, one will be created.
out-map-nameexpressionrequiredThe name of the field that will receive the processed map.If the map does not exist, one will be created.
xml-resourceconstantoptionalThe location of the map processor file. 
processor-nameconstantoptionalThe name of the <simple-map-processor> element. 
error-list-nameexpressionoptionalThe 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-{{}})
<call-object-method>
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
NameTypeRequirementsDescriptionNote
obj-fieldexpressionrequiredThe name of the field containing the object to be called.A runtime exception is thrown if the object is not found.
method-nameconstantrequiredThe name of the method to call. 
ret-fieldexpressionoptionalThe 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-{{}})

Deprecated – use the <script> element.

<call-service>
Invokes a service through the Service Engine.
Attributes
NameTypeRequirementsDescriptionNote
service-nameconstant, ${expression}requiredThe name of the service to invoke. 
in-map-nameexpressionoptionalThe name of a field containing a map that will be used for the service’s IN parameters. 
include-user-loginconstantoptionalInclude the current UserLogin entity value in the called service IN parameters.Defaults to “true”.
break-on-errorconstantoptionalHalt script execution if the called service returns an error.Defaults to “true”.
error-codeconstantoptionalThe error code returned by the called service.Defaults to the enclosing <simple-method> “default-error-code” attribute value.
success-codeconstantoptionalThe success code returned by the called service.Defaults to the enclosing <simple-method> “default-success-code” attribute value.
require-new-transactionconstantoptionalRequire a new transaction for the called service.Defaults to “false”.
transaction-timeoutconstantoptionalThe timeout for the new transaction, in seconds.Defaults to the value set in the called service’s definition.
Child Elements
NameRequirements 
<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-{{}})
<call-service-asynch>
Invokes an OFBiz service asynchronously.
Attributes
NameTypeRequirementsDescriptionNote
service-nameconstant, ${expression}requiredThe name of the service to invoke. 
in-map-nameexpressionoptionalThe name of a field containing a map that will be used for the service’s IN parameters. 
include-user-loginconstantoptionalInclude the current UserLogin entity value in the called service IN parameters.Defaults to “true”.
<call-simple-method>
Invokes a Mini-language simple method.
Attributes
NameTypeRequirementsDescriptionNotes
method-nameconstantrequiredThe name of the <simple-method> element. 
xml-resourceconstantoptionalThe location of the <simple-method> file.Defaults to current file.
scopeconstantoptionalThe 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
NameRequirements 
<result-to-field>optional (one or more), used when scope=”function”(?) (https://cwiki.apache.org/OFBADMIN/mini-language-reference.html#Mini-languageReference-{{}})
<default-message>
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
NameTypeRequirementsDescriptionNotes
resourceconstantoptionalThe name of a properties file on the classpath. 
propertyconstantoptionalThe property key. 
<error-prefix>
Declares a message to prepend to the error message.

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

Attributes
NameTypeRequirementsDescriptionNotes
resourceconstantoptionalThe name of a properties file on the classpath. 
propertyconstantoptionalThe property key. 
<error-suffix>
Declares a message to append to the error message.

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

Attributes
NameTypeRequirementsDescriptionNotes
resourceconstantoptionalThe name of a properties file on the classpath. 
propertyconstantoptionalThe property key. 
<message-prefix>
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
NameTypeRequirementsDescriptionNotes
resourceconstantoptionalThe name of a properties file on the classpath. 
propertyconstantoptionalThe property key. 
<message-suffix>
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
NameTypeRequirementsDescriptionNotes
resourceconstantoptionalThe name of a properties file on the classpath. 
propertyconstantoptionalThe property key. 
<results-to-map>
Copies the called service’s result map to the specified field.
Attributes
NameTypeRequirementsDescriptionNotes
map-nameexpressionrequiredThe name of the target field. 
<result-to-field>
Copies the called service’s OUT attribute to the specified field.
Attributes
NameTypeRequirementsDescriptionNotes
result-nameexpressionrequiredThe name of the called service’s OUT attribute. 
fieldexpressionoptionalThe name of target field.Defaults to the result-name attribute value.
<result-to-request>
Copies the called service’s OUT attribute to the specified request attribute.

Valid only when the script is run in an event.

Attributes
NameTypeRequirementsDescriptionNotes
result-nameexpressionrequiredThe name of the called service’s OUT attribute. 
request-nameexpressionoptionalThe name of the target request attribute.Defaults to the result-name attribute value.
<result-to-session>
Copies the called service’s OUT attribute to the specified session attribute.

Valid only when the script is run in an event.

Attributes
NameTypeRequirementsDescriptionNotes
result-nameexpressionrequiredThe name of the called service’s OUT attribute. 
session-nameexpressionoptionalThe name of the target session attribute.Defaults to the result-name attribute value.
<result-to-result>
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
NameTypeRequirementsDescriptionNotes
result-nameexpressionrequiredThe name of the called service’s OUT attribute. 
service-result-nameexpressionoptionalThe name of the calling service’s OUT attribute (or function return result).Defaults to the result-name attribute value.
<script>
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
NameTypeRequirementsDescriptionNotes
locationconstantrequired if script is emptyThe location of the script file.Script functions/methods can be invoked by appending a hash (#) and the function/method name.
scriptscriptrequired if location and element body are emptyA short script (scriptlet). Can be used instead of a file. 
<success-prefix>
Declares a message to prepend to the success message.

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

Attributes
NameTypeRequirementsDescriptionNotes
resourceconstantoptionalThe name of a properties file on the classpath. 
propertyconstantoptionalThe property key. 
<success-suffix>
Declares a message to append to the success message.

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

Attributes
NameTypeRequirementsDescriptionNotes
resourceconstantoptionalThe name of a properties file on the classpath. 
propertyconstantoptionalThe 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.

<clear-cache-line>
Clears entity values from the cache.
<clear-cache-line entity-name="Party" />
Attributes
NameTypeRequirementsDescriptionNotes
entity-nameconstant, ${expression}requiredThe name of the entity. 
mapexpressionoptionalThe 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.
<clear-entity-caches>
Removes all entity values from the cache.

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

<clone-value>
Creates a copy of an entity value.
Attributes
NameTypeRequirementsDescriptionNotes
value-fieldexpressionrequiredThe 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-fieldexpressionrequiredThe name of the field that will contain the new entity value. 
<condition-expr>
Uses an SQL operator to compare an entity field to a variable or constant value.
Attributes
NameTypeRequirementsDescriptionNotes
field-nameconstantrequiredThe name of the entity field that will be compared. The l-value. 
operatorconstantrequiredThe 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-fieldexpressionrequired if the value attribute is emptyThe name of an environment field that the entity field will be compared to. The r-value. 
valueconstant, ${expression}required if the from-field attribute is emptyA constant value that the entity field will be compared to. The r-value. 
ignore-if-nullconstantoptionalIgnore the condition if the r-value is null.Defaults to “false”.
ignore-if-emptyconstantoptionalIgnore the condition if the r-value is empty.Defaults to “false”.
ignore-caseconstantoptionalPerform a case-insensitive comparison.Defaults to “false”.
ignoreconstant, ${expression}optionalIgnore the condition if the r-value evaluates to “true”.Defaults to “false”.
<condition-list>
Uses an SQL operator to combine entity find conditions into a single expression.
Attributes
NameTypeRequirementsDescriptionNotes
combineconstantrequiredThe 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-{{}})
<condition-object>
Declares an environment field (variable) that contains an entity find condition expression object.
Attributes
NameTypeRequirementsDescriptionNotes
fieldexpressionrequiredThe name of the field that contains an entity find condition expression object 
<create-value>
Creates a new entity value in the data source.
Attributes
NameTypeRequirementsDescriptionNotes
value-fieldexpressionrequiredThe 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-clearconstantoptionalClear the cache.Defaults to “true”.
or-storeconstantoptionalStore 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.
<entity-and>
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
NameTypeRequirementsDescriptionNotes
entity-nameconstant, ${expression}requiredThe name of the entity to search in.A runtime exception will be thrown if the entity does not exist.
listexpressionrequiredThe name of the field that will contain the result list. 
filter-by-dateconstant, ${expression}optionalFilter the result list by the current date.The entity must have “fromDate” and “thruDate” fields. Defaults to “false”.
distinctconstant, ${expression}optionalFilter the results so that all of them are unique.Defaults to “false”.
use-cacheconstant, ${expression}optionalUse the entity cache.Defaults to “false”.
delegator-nameconstant, ${expression}optionalOverrides the current delegator by specifying a delegator name. 
Child Elements
NameRequirements 
<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-{{}})
<entity-condition>
Finds a group of entity values by using a condition expression.
Attributes
NameTypeRequirementsDescriptionNotes
entity-nameconstant, ${expression}requiredThe name of the entity to search in.A runtime exception will be thrown if the entity does not exist.
listexpressionrequiredThe name of the field that will contain the result list. 
filter-by-dateconstant, ${expression}optionalFilter the result list by the current date.The entity must have “fromDate” and “thruDate” fields. Defaults to “false”.
distinctconstant, ${expression}optionalFilter the results so that all of them are unique.Defaults to “false”.
use-cacheconstant, ${expression}optionalUse the entity cache.Defaults to “false”.
delegator-nameconstant, ${expression}optionalOverrides 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:

NameRequirements 
<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-{{}})
<entity-count>
Counts a group of entity values that match a condition expression.
Attributes
NameTypeRequirementsDescriptionNotes
entity-nameconstant, ${expression}requiredThe name of the entity to count in.A runtime exception will be thrown if the entity does not exist.
count-fieldexpressionrequiredName of the field that will contain the count result. 
delegator-nameconstant, ${expression}optionalOverrides 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-{{}})
<entity-data>
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
NameTypeRequirementsDescriptionNotes
locationconstant, ${expression}requiredThe 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.
modeconstantoptionalOperation mode: “load” or “assert”.Defaults to “load”.
timeoutconstantoptionalOverride the current transaction to start a new transaction and load the data with a different timeout.Valid only when mode=”load”.
error-list-nameconstant, ${expression}optionalThe name of the error message list.Defaults to “error_list”. It will be created if it does not exist.
delegator-nameconstant, ${expression}optionalOverrides the current delegator by specifying a delegator name. 
<entity-one>
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
NameTypeRequirementsDescriptionNotes
entity-nameconstant, ${expression}requiredThe name of the entity to search in.A runtime exception will be thrown if the entity does not exist.
value-fieldexpressionrequiredThe name of the field that will contain the entity value. 
use-cacheconstant, ${expression}optionalUse the entity cache.Defaults to “false”.
auto-field-mapconstant, ${expression}optionalLook for all primary key field names in the current context as well as in the parameters map.Defaults to “true”.
Child Elements
NameRequirements 
<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-{{}})
<field-map>
Declares an entity field name/value pair.
Attributes
NameTypeRequirementsDescriptionNote
field-nameexpressionrequiredThe name of the entity field.Defaults to from-field attribute value.
from-fieldexpressionrequired if the value attribute is empty.The name of an environment field that contains the entity field value. 
valueconstant+exprrequired if the from-field attribute is empty.A constant entity field value. 
<filter-list-by-and>
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
NameTypeRequirementsDescriptionNote
listexpressionrequiredThe name of the field that contains the list of entity values. 
mapexpressionrequiredThe name of the field that contains the map that will be used for the entity field comparison. 
to-listexpressionoptionalThe name of the field the filtered list will be put into.Defaults to the value of the list attribute (operation replaces the old list).
<filter-list-by-date>
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
NameTypeRequirementsDescriptionNote
listexpressionrequiredThe name of the field that contains the list of entity values. 
to-listexpressionoptionalThe 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-dateexpressionoptionalThe 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-nameconstantoptionalThe name of the entity field to use as the beginning date.Defaults to “fromDate”.
thru-field-nameconstantoptionalThe name of the entity field to use as the ending date.Defaults to “thruDate”.
<find-by-and>
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
NameTypeRequirementsDescriptionNotes
entity-nameconstant, ${expression}requiredThe name of the entity to search in.A runtime exception will be thrown if the entity does not exist.
listexpressionrequiredThe name of the field that will contain the result list. 
mapexpressionrequiredThe 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-listexpressionoptionalThe 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-listexpressionoptionalThe name of a list or set in the method environment that contains field names to select. 
use-cacheconstant, ${expression}optionalUse the entity cache.Defaults to “false”.
use-iteratorconstant, ${expression}optionalUse 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-nameconstant, ${expression}optionalOverrides the current delegator by specifying a delegator name. 
<find-by-primary-key>
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
NameTypeRequirementsDescriptionNotes
entity-nameconstant, ${expression}optional if the entity name comes from the primary key mapThe 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-fieldexpressionrequiredThe name of the field that will contain the entity value. 
mapexpressionrequiredThe name of the field containing a map that will be used for the search. 
fields-to-select-listexpressionoptionalThe name of a list or set in the method environment that contains field names to select. 
use-cacheconstant, ${expression}optionalUse the entity cache.Defaults to “false”.
delegator-nameconstant, ${expression}optionalOverrides the current delegator by specifying a delegator name. 
<get-related>
Finds entity values that are related to an existing entity value.
Attributes
NameTypeRequirementsDescriptionNotes
value-fieldexpressionrequiredThe name of the field containing the entity value.A runtime exception will be thrown if the entity value does not exist.
relation-nameconstant, ${expression}requiredThe name of the entity value relation to use.Script execution will halt if the relation does not exist.
listexpressionrequiredThe name of the field that will contain the result list. 
mapexpressionrequiredThe 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-listexpressionoptionalThe 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-cacheconstant, ${expression}optionalUse the entity cache.Defaults to “false”.
Finds an entity value that is related to an existing entity value.
Attributes
NameTypeRequirementsDescriptionNotes
value-fieldexpressionrequiredThe name of the field containing the entity value.A runtime exception will be thrown if the entity value does not exist.
relation-nameconstant, ${expression}requiredThe name of the entity value relation to use.Script execution will halt if the relation does not exist.
to-value-fieldexpressionrequiredThe name of the field that will contain the related entity value. 
use-cacheconstant, ${expression}optionalUse the entity cache.Defaults to “false”.
<having-condition-list>
A list of conditions that are combined with a boolean AND or OR that are applied to an entity value group.

This element implements the SQL HAVING clause.

Attributes
NameTypeRequirementsDescriptionNotes
combineconstant, ${expression}optionalThe boolean operator used to combine conditions.Defaults to “and”.
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-{{}})
<limit-range>
Constrains an entity find result by specifying a starting index and the number of results to include.
Attributes
NameTypeRequirementsDescriptionNotes
startconstant, ${expression}requiredA zero-based starting index.The attribute value must resolve to a non-negative integer.
sizeconstant, ${expression}requiredThe number of results to include.The attribute value must resolve to a non-negative integer.
<limit-view>
Constrains an entity find result by specifying a view index and a view size.

Example: view-index=”3″ and view-size=”10″ returns results 21 to 30.

Attributes
NameTypeRequirementsDescriptionNotes
view-indexconstant, ${expression}requiredA one-based view index.The attribute value must resolve to a non-negative integer.
sizeconstant, ${expression}requiredThe number of results to view.The attribute value must resolve to a non-negative integer.
<make-next-seq-id>
Generates a sequence string and uses it to update an entity value field.

The sequence string is generated by scanning all similar values in the entity and adding an increment amount to the highest sequence value found.

Attributes
NameTypeRequirementsDescriptionNotes
value-fieldexpressionrequiredThe name of the field containing the entity value.A runtime exception will be thrown if the entity value does not exist.
seq-field-nameconstant, ${expression}requiredThe name of the entity value field that will receive the sequence string. 
numeric-paddingconstant, ${expression}optionalLeft-pad the sequence string with the specified number of zeros.Defaults to “5”.
increment-byconstant, ${expression}optionalSequence increment amount.Defaults to “1”.
<make-value>
Creates a new entity value.

The new entity value exists only in memory – it is not persisted in the data source until it is stored.

Attributes
NameTypeRequirementsDescriptionNotes
entity-nameconstant, ${expression}requiredThe name of the entity.A runtime exception will be thrown if the entity does not exist.
value-fieldexpressionrequiredThe name of the field that will contain the new entity value. 
mapexpressionoptionalThe name of the field that contains a map that is used to initialize the entity value fields.Map values whose key matches one of the entity value fields will be copied to the corresponding entity value field.Defaults to parameters.
<order-value-list>
Performs an in-memory sort of a list of entity values.
Attributes
NameTypeRequirementsDescriptionNotes
listexpressionrequiredThe name of the field that contains the list of entity values.The target field will be set to null if the list is not found.
order-by-listexpressionrequiredThe name of the field that contains the list of field names to sort on.Field names can be preceded by a plus symbol (더하기) or a minus symbol (빼기) to specify an ascending or descending sort for that field. The default is ascending sort. If the order-by-list is not found the target field will be set to a copy of the source list.
to-listexpressionoptionalThe name of the field that will contain the sorted list.Defaults to the field specified in the list attribute.
<refresh-value>
Refresh an entity value from the data source.
Attributes
NameTypeRequirementsDescriptionNotes
value-fieldexpressionrequiredThe name of the field containing the entity value.A runtime exception will be thrown if the entity value does not exist.
do-cache-clearconstant, ${expression}optionalClear the cache.Defaults to “true”.
<remove-by-and>
Removes entity values from the data source.

Uses a map of name/value pairs that will be combined using a boolean AND to constrain the removal.

Attributes
NameTypeRequirementsDescriptionNotes
entity-nameconstant, ${expression}requiredThe name of the entity to search in.A runtime exception will be thrown if the entity does not exist.
mapexpressionrequiredThe name of the field containing a map that will be used for the constraint.The map name/value pairs will be combined using a boolean AND. If the map is missing or empty, then all entity values will be removed.
do-cache-clearconstant, ${expression}optionalClear the cache.Defaults to “true”.
<remove-list>
Removes from the data source all entity values in a list.

If an entity value in the list is a complete primary key, then just that entity value will be removed from the data source.
If an entity value in the list is not a complete primary key, then all matching entity values will be removed from the data source.

Attributes
NameTypeRequirementsDescriptionNotes
listexpressionrequiredThe name of the field that contains the list of entity values.A runtime exception will be thrown if the list does not exist.
do-cache-clearconstant, ${expression}optionalClear the cache.Defaults to “true”.
<remove-related>
Removes entity values from the data source that are related to an existing entity value.

For a one-to-one relationship it will remove a single entity value if it exists, and for a one-to-many relationship it will remove all related entity values.

Attributes
NameTypeRequirementsDescriptionNotes
value-fieldexpressionrequiredThe name of the field containing the entity value.A runtime exception will be thrown if the entity value does not exist.
relation-nameconstant, ${expression}requiredThe name of the entity value relation to use.Script execution will halt if the relation does not exist.
do-cache-clearconstant, ${expression}optionalClear the cache.Defaults to “true”.
<remove-value>
Removes an entity value from the data source.
Attributes
NameTypeRequirementsDescriptionNotes
value-fieldexpressionrequiredThe name of the field containing the entity value.A runtime exception will be thrown if the entity value does not exist.
do-cache-clearconstant, ${expression}optionalClear the cache.Defaults to “true”.
<select-field>
Declares an entity field to include in the entity operation.
Attributes
NameTypeRequirementsDescriptionNotes
field-nameconstant, ${expression}requiredThe entity field name. 
<sequenced-id>
Generates a unique numeric sequence value.

Sequence values are unique per sequence name.

Attributes
NameTypeRequirementsDescriptionNotes
sequence-nameconstant, ${expression}requiredThe sequence name.In most cases, this is the name of the entity the sequence value will be used in, but any name can be used.
fieldexpressionrequiredThe name of the field to set, the target of the assignment. 
stagger-maxconstantoptionalSequence stagger maximum.If set to “1” the sequence value will be incremented by 1, otherwise the sequence value will be incremented by an amount between 1 and the stagger maximum. Defaults to “1”.
get-long-onlyconstantoptionalPreserve the sequence type – a numeric long.If set to “false” the sequence value will be converted to a string. Defaults to “false”.
<set-nonpk-fields>
Copies non-PK fields from a map to an entity value.
Attributes
NameTypeRequirementsDescriptionNotes
value-fieldexpressionrequiredThe name of the field containing the entity value.A runtime exception will be thrown if the entity value does not exist.
mapexpressionrequiredThe name of the field that contains a map that is used to initialize the entity value non-pk fields.Map values whose key matches one of the entity value fields will be copied to the entity value. A runtime exception will be thrown if the map does not exist.
set-if-nullconstant, ${expression}optionalSet entity value fields that are null or empty.Defaults to “true”.
<set-pk-fields>
Copies PK fields from a map to an entity value.
Attributes
NameTypeRequirementsDescriptionNotes
value-fieldexpressionrequiredThe name of the field containing the entity value.A runtime exception will be thrown if the entity value does not exist.
mapexpressionrequiredThe name of the field that contains a map that is used to initialize the entity value pk fields.Map values whose key matches one of the entity value fields will be copied to the entity value. A runtime exception will be thrown if the map does not exist.
set-if-nullconstant, ${expression}optionalSet entity value fields that are null or empty.Defaults to “true”.
<store-list>
Stores in the data source all entity values in a list.

Entity values that do not exist in the data source will be added to the data source.

Attributes
NameTypeRequirementsDescriptionNotes
listexpressionrequiredThe name of the field that contains the list of entity values.A runtime exception will be thrown if the list does not exist.
do-cache-clearconstant, ${expression}optionalClear the cache.Defaults to “true”.
<store-value>
Stores an entity value in the data source.
Attributes
NameTypeRequirementsDescriptionNotes
value-fieldexpressionrequiredThe name of the field containing the entity value.A runtime exception will be thrown if the entity value does not exist. Script execution will halt if the entity value does not exist in the data source.
do-cache-clearconstant, ${expression}optionalClear the cache.Defaults to “true”.
<transaction-begin>
Begins a transaction if one is not already in place.

Note that all simple-methods are executed inside a transaction unless the simple-method is flagged to not use a transaction.

Attributes
NameTypeRequirementsDescriptionNotes
began-transaction-nameexpressionoptionalThe name of the field that contains a Boolean value specifying whether or not a transaction was begun in the current transaction demarcation.Defaults to “beganTransaction”.
<transaction-commit>
Commits a transaction that was begun with the <transaction-begin> element.

Operation does nothing if no transaction was begun.

Attributes
NameTypeRequirementsDescriptionNotes
began-transaction-nameexpressionoptionalThe name of the field that contains a Boolean value specifying whether or not a transaction was begun in the current transaction demarcation.Defaults to “beganTransaction”.
<transaction-rollback>
Rolls back a transaction that was begun with the <transaction-begin> element.

If no transaction was begun with the transaction-begin element, a “set rollback only” operation will be performed – which will force the transaction to rollback regardless of which method or object is responsible for beginning and ending the transaction.

Attributes
NameTypeRequirementsDescriptionNotes
began-transaction-nameexpressionoptionalThe name of the field that contains a Boolean value specifying whether or not a transaction was begun in the current transaction demarcation.Defaults to “beganTransaction”.
<use-iterator>
Use the EntityListIterator for the entity find operation.

Logging

<log>
Outputs a log a message.
Attributes
NameTypeRequirementsDescriptionNotes
levelconstantrequiredThe logging level to use.Must be one of the following: “verbose”, “timing”, “info”, “important”, “warning”, “error”, “fatal”, “always”. Defaults to “info”.
messageconstant+exprrequiredThe message to log. 
<trace>
Logs detailed information on the internal state of its sub-elements, using the specified log level.
Attributes
NameTypeRequirementsDescriptionNotes
levelconstantrequiredThe logging level to use.Must be one of the following: “verbose”, “timing”, “info”, “important”, “warning”, “error”, “fatal”, “always”. Defaults to “info”.
Child Elements
NameRequirements 
(Any block of code)optional 

Calculate Operations

<calculate>
Performs an arithmetic calculation and puts the result in the specified field.
Attributes
NameTypeRequirementsDescriptionNotes
fieldexpressionrequiredThe name of the field to set, the target of the assignment. 
rounding-modeconstant, ${expression}optionalRounding mode for the calculation, primarily for divide operation.Defaults to “HalfEven”.
decimal-scaleconstant, ${expression}optionalInitial scale (decimals) to use.Defaults to “2”.
decimal-formatconstant, ${expression}optionalDecimal format to use for conversion to string. 
typeconstantoptionalData type of the calculation result.Defaults to “BigDecimal”.
Child Elements

One or more of the following child elements is optional:

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

Deprecated – use the <set> element.

<calcop>
A basic arithmetic operation.
Attributes
NameTypeRequirementsDescriptionNotes
operatorconstantrequiredThe arithmetic operator.Defaults to “add”.
fieldexpressionoptionalThe name of the field to use. 
Child Elements

One or more of the following child elements is optional:

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

Deprecated – use the <set> element.

<number>
Declares a numeric constant to be used in the calculation.
Attributes
NameTypeRequirementsDescriptionNotes
valueconstant, ${expression}requiredA numeric constant. 

Deprecated – use the <set> element.

Map Processor

<compare>
<compare-field>
<convert>
<copy>
<fail-message>
<fail-property>
<make-in-string>
<not-empty>
<process>
<regexp>
<simple-map-processor>
<validate-method>

Mini-language Reference