Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Simple Map Processor Mini-Language performes two primary tasks: validation and conversion. It does this in a context of moving values from one Map to another. The input map will commonly contain Strings, but can contain other object types like Integer, Long, Float, Double, java.sql.Date, Time, and Timestamp.

Panel

(info) NOTE: The reference information for the simple-map-processor has been moved to annotations in

Wiki Markup
\[to be modified
www.ofbiz.org/dtds/simple-methods.xsd]


We hope to recommended soon a tool that will use XSL/Transform to render the documentation directly from the XSD file in Browsers

...


The path or location for a Simple Method is the classpath and filename of the XML file.


In this Mini-Language you can invoke Simple Map Processors, Services and bsh scripts, perform entity related operations, and create messages to return to the caller. Specific operations can be enclosed in if blocks to execute conditionally and values or fields can be copied around in the maps, lists and method environment.
There are a number of tags which can be used to get and set attributes to/from a request or session object when called as an event or to set attributes in the result when called as a service. These operations are only applied when applicable. In other words if you include an env-to-request operation it will only be invoked when the simple-method is called as an event and an env-to-result operation will only be invoked when the simple-method is called as a service. Everything else is the same when called as an event or a service which makes it easy to write flexible logic that can be mounted/applied in various ways.
There are a number of objects that exist in the method environment when a simple-method starts or that are used as it executes to keep track of certain information. Some will exist when called as an event or a service, these are marked in the XSD. Each name can be overridden using an attribute on the simple-method tag. The defaults are listed below in the XSD.

Panel

(info) NOTE: The reference information for simple-method has been moved to annotations in

Wiki Markup
\[to be modified
www.ofbiz.org/dtds/simple-methods.xsd]


We hope to recommended soon a tool that will use XSL/Transform to render the documentation directly from the XSD file in Browsers

...

make-value
clone-value
create-value
store-value
remove-value
remove-by-and

The remove-by-and tag uses the delegator to remove entity values from the datasource and is constrained by anding the fields passed in the map. Make sure the map contains something, or all values will be removed.

Attribute Name

Required?

Description

entity-name

Y

The name of the entity to remove instances of.

map-name

Y

The name of a map in the method environment that will be used for the entity fields.

clear-cache-line

Uses the delegator to clear elements from the cache; intelligently looks at the map passed to see if it is a byPrimaryKey, and byAnd, or an all.

Attribute Name

Required?

Description

entity-name

Y

The name of the entity to clear cache lines of.

map-name

Y

The name of a map in the method environment that will be used for the entity fields. 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 cache.

clear-entity-caches

This is a very simple tag that should be used sparingly because of the performance impact. It clears all lines from all Entity Engine caches. It has no attributes or sub-elements.

set-pk-fields

Looks for each PK field in the named map and if it exists there it will copy it into the named value object.

Attribute Name

Required?

Description

value-name

Y

The name of the method environment field that contains the GenericValue object.

map-name

Y

The name of a map in the method environment that will be used for the entity fields.

set-if-null

N

Specifies whether or not to set fields that are null or empty. Defaults to true.

set-nonpk-fields

Looks for each non-PK field in the named map and if it exists there it will copy it into the named value object.

...

Attribute Name

...

Required?

...

Description

...

value-name

...

Y

...

The name of the method environment field that contains the GenericValue object.

...

map-name

...

Y

...

The name of a map in the method environment that will be used for the entity fields.

...

set-if-null

...

N

...

clear-cache-line
clear-entity-caches
set-pk-fields
set-nonpk-fields

Entity Engine List Operations

...