FilterArrayProcessor
Version #1
Description:
This processor will split an input array to two output arrays based on a condition defined in Spring Expression Language.
Note that access is really limited to a set of utility classes defined in java.util and java.lang package. Property write, instance creation, bean access is disabled.
Some additional utility methods are defined:
listOf(items|array|null)
, setOf(items|array|null)
, hasAny(collection|array|null, items...)
, hasAll(collection|array|null, items...)
Some Respresso specific utilities:
readInput(structurePath)
, readCurrentElement(structurePath)
, readPath(StructureObject|null, structurePath)
, jsonToStructure(String|null)
You may want to abort the whole process when you find a critical error in the data. In this case you can use
error(String)
which will throw an exception with your message. This may be used for restricting data format or editor users based on permissions.Interface:
Config
: FilterArrayConfigStructure:v1 [REQUIRED]Input
: StructureObject:v1 [REQUIRED]Output
: FilterArrayOutputStructure:v1
Internally used structures:
FilterContextStructure:v1 This object is given to the expression evaluator’s context.
Basic sample:
<processor id="<FLOW_SCOPED_ARBITRARY_ID_GOES_HERE>" name="FilterArrayProcessor" version="1">
{
"condition": STRING
}
</processor>
Advanced sample:
<processor id="<FLOW_SCOPED_ARBITRARY_ID_GOES_HERE>" name="FilterArrayProcessor" version="1">
{
"arrayPath": STRING,
"condition": STRING
}
</processor>