...
Code Block |
---|
language | xml |
---|
title | A trivial implementation of Predicate<EntityDescriptor> |
---|
|
<ConditionScript>
<Script>
<![CDATA[
"use strict";
false;
]]>
</Script>
</ConditionScript> |
A more complex example might use the theĀ custom
object to help in the definition:operation.
Code Block |
---|
language | xml |
---|
title | A trivial implementation of Predicate<EntityDescriptor>Use of custom object |
---|
|
<ConditionScript customObjectRef="BeanID">
<Script>
<![CDATA[
"use strict";
var someCondition = function(entityID) {
// Good stuff
}
var result;
// CustomObjectRef points to a <util:map> where the key is a string and the value is an 'interesting bean'
if (someCondition(input.getEntityID())) {
result = custom["myFirstBean"].someFunction(input);
} else {
result = custom["mySecondBean"].someOtherFunction(input);
}
result;
]]>
</Script>
</ConditionScript>
|