Java definition classes and automation scripts
You can use a Java™ definition class and an automation script at the same time on an object structure. The Java definition class is executed before the automation script for each function.
Some of the object structures that are included in the integration framework and Migration Manager provide Java definition classes that filter data. For example, the item object structure filters items that are of the type TOOL. When an automation script is implemented with a Java definition class, the automation script can override the filtering of the Java definition class and remove the filtering of the Java class or change the filtering criteria to exclude more data from or include more data in the XML message.
For example, the Java definition class of the MXOPERLOC object structure filters out the locations of the type LABOR while allowing locations of the type OPERATING to be included in the message. You can change the filtering, add more filtering, or replace the default filtering. The following example script changes the processing to filter the locations of the type OPERATING and continues to process locations of the type LABOR:
def skipMbo(ctx):
if ctx.getMboName()=='LOCATIONS':
if ctx.getMbo().getString("type")=="LABOR":
ctx.process()
if ctx.getMbo().getString("type")=="OPERATING":
ctx.skipMbo()
The following example script adds more filtering for the MXOPERLOC object structure by filtering out type COURIER:
if ctx.getMboName()=='LOCATIONS':
if ctx.getMbo().getString("type")=="COURIER":
ctx.skipMbo()
The following example script replaces the definition class filtering so that only locations of type COURIER are filtered out:
def skipMbo(ctx):
if ctx.getMboName()=='LOCATIONS':
if ctx.getMbo().getString("type")=="COURIER":
ctx.skipMbo()
else:
ctx.process()