Mini-language Reference
The Apache Open For Business Project
This is a draft document. It can be modified at any time by anyone.
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 an environment 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>
<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>
<list-to-list>
<map-to-map>
<now-date-to-env>
<now-timestamp-to-env>
<order-map-list>
<property-to-field>
<request-parameters-to-list>
<request-to-field>
<session-to-field>
<set>
Assigns a value to a field.
<set field="foo" value="bar" /> <set field="baz" from-field="foo" />
Attributes
field |
required |
The name of the field to set (the l-value) |
|
from-field |
required if value attribute is empty |
The name of a field to copy from (the r-value) |
|
value |
required if from-field attribute is empty |
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 |
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
- 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 type attribute default.
<set-calendar>
<set-service-fields>
<string-append>
<string-to-field>
<string-to-list>
<to-string>
<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>
<get-related-one>
<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.