Access to add and change pages is restricted. See: https://cwiki.apache.org/confluence/display/OFBIZ/Wiki+access

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 32 Next »

Mini-language Reference

The Apache Open For Business Project

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

Proposed Attribute Type Section

Attribute Types

constant

A string constant. The string may not include an expression

constant+expr

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

expression

A UEL expression

script

A short script ("scriptlet")

The <simple-method> element

<simple-method>
Contains a block of code.
<simple-method method-name="myMethod">
  <!-- some mini-language code goes here -->
</simple-method>

Attributes

method-name

optional

Each simple method in a file must have a unique name

short-description

optional

Used for documentation

default-error-code

optional

 

default-success-code

optional

 

parameter-map-name

optional

 

event-request-object-name

optional

 

event-session-object-name

optional

 

event-response-object-name

optional

 

event-response-code-name

optional

 

event-error-message-name

optional

 

event-error-message-list-name

optional

 

event-event-message-name

optional

 

event-event-message-list-name

optional

 

service-response-message-name

optional

 

service-error-message-name

optional

 

service-error-message-list-name

optional

 

service-error-message-map-name

optional

 

service-success-message-name

optional

 

service-success-message-list-name

optional

 

login-required

optional

 

use-transaction

optional

 

locale-name

optional

 

delegator-name

optional

 

security-name

optional

 

dispatcher-name

optional

 

user-login-name

optional

 


Proposed Changes

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


Assignment Operations

<add-error>
Adds a message to the error list.
<add-error>
  <fail-message message="There was an error" />
</add-error>

Attributes

error-list-name

optional

The name of a list that will contain the message

Default is "error_list"


Child Elements

<fail-message>

optional

<fail-property>

optional


Proposed Changes

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

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

Attributes

field

optional

The name of the field to remove

map-name

optional

The name of the map to remove


Proposed Changes

  • Currently, both attributes are optional. Require at least one attribute.
  • Eliminate the map-name attribute.
<create-object>
Create a new Java object.
<create-object field="foo" class-name="com.acme.SomeClass">
  <string value="bar" />
  <field field="foo" />
</create-object>

Attributes

field

optional

The name of the field for the new object

class-name

optional

The Java class name


Child Elements

<field>

optional

<string>

optional


Proposed Changes

  • Currently, both attributes are optional. Require both attributes.
  • Deprecate and replace with scriptlet
<env-to-env>

Deprecated. Use <set>.

<env-to-field>

Deprecated. Use <set>.

<fail-message>
Declares a message to be added to a message list.
<add-error>
  <fail-message message="There was an error" />
</add-error>

Attributes

message

optional

The message text


Proposed Changes

  • Currently, the message attribute is optional. Require the message attribute.
<fail-property>
Declares a property key that is used to add a message to a message list.
<add-error>
  <fail-property resource="ErrorMessages" property="FooError" />
</add-error>

Attributes

resource

optional

Name of the resource where the message can be found

property

optional

The message property key


Proposed Changes

  • Currently, both attributes are optional. Require both attributes.
<field-to-env>

Deprecated. Use <set>.

<field-to-field>

Deprecated. Use <set>.

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

Attributes

list

optional

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

field

optional

The field to add to the list


Proposed Changes

  • Currently, both attributes are optional. Require both attributes.
  • Deprecate and replace with UEL expression.
<field-to-request>
Copies a field to a servlet request attribute.
<field-to-request field="foo" request-name="fooAttribute" />

Attributes

field

optional

The name of the field to copy from

request-name

optional

The name of the request attribute to copy to

map-name

optional

The name of the map containing field


Proposed Changes

  • Currently, all attributes are optional. Require the field and request-name attributes.
  • Eliminate the map-name attribute.
  • Deprecate and replace with a UEL expression.
<field-to-result>
Copies a field to a service OUT attribute.
<field-to-result field="foo" result-name="fooAttribute" />

Attributes

field

optional

The name of the field to copy from

result-name

optional

The name of the service OUT attribute to copy to

map-name

optional

The name of the map containing field


Proposed Changes

  • Currently, all attributes are optional. Require the field and result-name attributes.
  • Eliminate the map-name attribute.
<field-to-session>
Copies a field to a servlet session attribute.
<field-to-session field="foo" session-name="fooAttribute" />

Attributes

field

optional

The name of the field to copy from

session-name

optional

The name of the session attribute to copy to

map-name

optional

The name of the map containing field


Proposed Changes

  • Currently, all attributes are optional. Require the field and session-name attributes.
  • Eliminate the map-name attribute.
  • Deprecate and replace with a UEL expression.
<first-from-list>
Copies the first element in a list to a field. If the list is empty or not found, sets the field to null.
<first-from-list entry-name="foo" list-name="fooList" />

Attributes

entry-name

optional

The name of the field to copy to

list-name

optional

The name of the list to copy from


Proposed Changes

  • Currently, both attributes are optional. Require both attributes.
  • Deprecate and replace with a UEL expression.
<list-to-list>
Copies list elements to another list. If the target list is not found, a new list is created.
<list-to-list list-name="foo" to-list-name="fooList" />

Attributes

list-name

optional

The name of the list to copy from

to-list-name

optional

The name of the list to copy to


Proposed Changes

  • Currently, both attributes are optional. Require both attributes.
  • Rename the list-name attribute to from-field or from-list to make the syntax similar to other operators.
<map-to-map>
Copies map entries to another map. If the target map is not found, a new map is created.
<map-to-map map-name="foo" to-map-name="fooMap" />

Attributes

map-name

optional

The name of the map to copy from

to-map-name

optional

The name of the map to copy to


Proposed Changes

  • Currently, both attributes are optional. Require both attributes.
  • Rename the map-name attribute to from-field or from-map to make the syntax similar to other operators.
<now-date-to-env>
Creates a java.sql.Date object that is set to the current system time.
<now-date-to-env field="fooDate" />

Attributes

field

optional

The name of the field


Proposed Changes

  • Currently, the field attribute is optional. Require the attribute.
  • Deprecate and replace with UEL expression.
<now-timestamp-to-env>
Creates a java.sql.Timestamp object that is set to the current system time.
<now-timestamp-to-env field="fooDate" />

Attributes

field

optional

The name of the field


Proposed Changes

  • Currently, the field attribute is optional. Require the attribute.
  • Deprecate and replace with UEL expression.
<order-by>

Child element of <order-map-list>

Defines a map key to sort on.
<order-map-list list="fooList">
    <order-by field="fooKey" />
</order-map-list>

Attributes

field

optional

The name of the key to sort on


<order-map-list>
Sorts a list of maps.
<order-map-list list="fooList">
    <order-by field="fooKey" />
</order-map-list>

Attributes

list

optional

The name of the list to be sorted


Child Elements

<order-by>

optional

Defines a map key to sort on


Proposed Changes

  • Currently, the list attribute is optional. Require the attribute.
  • Currently, the child elements are optional, and the operator throws an exception at run time when none are found. Require at least one child element.
<property-to-field>
Assigns a resource property to a field.
<property-to-field field="foo" resource="fooResource.properties" property="fooKey" />

Attributes

field

optional

The name of the field

 

resource

optional

The resource that contains the property

 

property

optional

The property key

 

default

optional

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

 

no-locale

optional

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

Default is "false"

arg-list-name

optional

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

 


Proposed Changes

  • Currently, all attributes are optional. Require the field, resource, and property attributes.
<request-parameters-to-list>
Copies request parameters to a list.
<request-parameters-to-list list-name="fooList" request-name="fooParameter" />

Attributes

list-name

optional

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

request-name

optional

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


Proposed Changes

  • Currently, both attributes are optional. Require both attributes.
  • Rename the list-name attribute to list - to make the syntax similar to other operators.
  • Rename the request-name attribute to parameter-name - to make the syntax clearer.
<request-to-field>
Copies a Servlet request attribute to a field.
<request-to-field field="foo" request-name="fooAttribute" />

Attributes

field

optional

The name of the field for the new object

request-name

optional

The name of the request attribute

default

optional

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

map-name

optional

The name of the map containing field


Proposed Changes

  • Currently, the field and request-name attributes are optional. Require both attributes.
  • Eliminate the map-name attribute.
  • Rename the request-name attribute to attribute-name - to make the syntax clearer.
  • Rename the default attribute to default-value - to make the syntax similar to other operators.
<session-to-field>
Copies a Servlet session attribute to a field.
<session-to-field field="foo" session-name="fooAttribute" />

Attributes

field

optional

The name of the field for the new object

session-name

optional

The name of the session attribute

default

optional

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

map-name

optional

The name of the map containing field


Proposed Changes

  • Currently, the field and session-name attributes are optional. Require both attributes.
  • Eliminate the map-name attribute.
  • Rename the session-name attribute to attribute-name - to make the syntax clearer.
  • Rename the default attribute to default-value - to make the syntax similar to other operators.
<set>
Assigns a value to a field.
<set field="foo" value="bar" />
<set field="baz" from-field="foo" />

Attributes

field

optional

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

 

from-field

optional

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

 

value

optional

A constant value

 

default-value

optional

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

 

type

optional

The Java data type of field

Defaults to "String"

set-if-null

optional

Controls if field can be set to null.

Defaults to "false"

set-if-empty

optional

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

Defaults to "true"


Proposed Changes

  • Currently, the field attribute is optional. Require the field attribute.
  • Currently, the from-field and value attributes are optional. Require one of the two attributes.
  • Add a new attribute: from-script. The attribute will be used exclusively for scriptlets that are currently found in other attributes.
  • Rename the from-field attribute to from. The attribute will be used exclusively for UEL expressions.
  • Change the behavior of the value attribute: The attribute will be used exclusively for string constants.
  • Remove the default-value attribute. The value attribute will be used for default constant values.
  • Remove the type attribute default.
<set-calendar>
Performs a Timestamp adjustment operation.
<set field="tomorrowStamp" from-field="nowTimestamp" day="1" />
<set field="yesterdayStamp" from-field="nowTimestamp" day="-1" />

Attributes

field

optional

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

from-field

optional

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

value

optional

A constant value

default-value

optional

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

type

optional

The Java data type of field

years

optional

A signed integer adjustment amount

months

optional

A signed integer adjustment amount

days

optional

A signed integer adjustment amount

hours

optional

A signed integer adjustment amount

minutes

optional

A signed integer adjustment amount

seconds

optional

A signed integer adjustment amount

millis

optional

A signed integer adjustment amount

period-align-start

optional

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

period-align-end

optional

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

locale

optional

The locale to be used for the operation

time-zone

optional

The time zone to be used for the operation


Proposed Changes

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

Attributes

service-name

optional

The name of the service

map

optional

The name of the map to copy from

to-map

optional

The name of the map to copy to

error-list

optional

The name of a list to copy error messages to


Proposed Changes

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

Proposed Changes

Deprecate and replace with UEL expression or <set>

<string-to-field>

Proposed Changes

Deprecate and replace with UEL expression or <set>

<string-to-list>

Proposed Changes

Deprecate and replace with UEL expression or <set>

<to-string>

Proposed Changes

Deprecate and replace with UEL expression or <set>

<webapp-property-to-field>


Conditional/Looping Statements

<and>
<assert>
<check-id>
<check-errors>
<check-permission>
<condition>
<else>
<else-if>
<if>
<if-compare>
<if-compare-field>
<if-empty>
<if-has-permission>
<if-instance-of>
<if-not-empty>
<if-regexp>
<if-validate-method>
<iterate>
<iterate-map>
<loop>
<not>
<or>
<return>
<then>
<while>
<xor>


Call Operations

<call-bsh>
<call-class-method>
<call-object-method>
<script>
<call-service>
<call-service-asynch>
<call-map-processor>
<call-simple-method>


Entity Operations

<clear-cache-line>
<clear-entity-caches>
<clone-value>
<condition>
<condition-expr>
<condition-list>
<condition-object>
<create-value>
<entity-and>
<entity-condition>
<entity-count>
<entity-data>
<entity-one>
<field-map>
<filter-list-by-and>
<filter-list-by-date>
<find-by-and>
<find-by-primary-key>
<get-related>
<having-condition-list>
<make-next-seq-id>
<make-value>
<order-by>
<order-value-list>
<refresh-value>
<remove-by-and>
<remove-list>
<remove-related>
<remove-value>
<select-field>
<sequenced-id-to-env>
<set-current-user-login>
<set-nonpk-fields>
<set-pk-fields>
<store-list>
<store-value>
<transaction-begin>
<transaction-commit>
<transaction-rollback>


Calculate Operations

Deprecated. Use a UEL expression.

<calcop>
<calculate>
<number>


Map Processor

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


Logging

<log>


  • No labels