Context APIs for the inbound processing of object structures

A context (ctx) is an object that provides convenience methods for automation scripts to pass data or trigger actions. The context is supported bidirectionally. Predefined APIs are available for the context, and each function can use different contexts.

An automation script requires context methods to implement processing logic. A context is passed between the processing of the object structure and the automation script, which implements the custom code. The following table shows the context APIs and the common usage of the APIs for each of the functions:

Table 1. Context APIs as used by the functions
Context APIs beforeProcess
(ctx)
beforeCreateMBOSet
(ctx)
afterCreateMboSet
(ctx)
mboRules
(ctx)
beforeMboData
(ctx)
afterMboData
(ctx)
preSaveRules
(ctx)
changeStatus
(ctx)
ctx.setMsgType()              
ctx.getProcessTable()      
ctx.setProcessTable(String ProcessTable)              
ctx.setMboSet(MboSet mboSet)              
ctx.setMbo(Mbo mbo)              
ctx.getData()
ctx.getMosDetailInfo()  
ctx.setSkipBaseAdditionalRules()              
ctx.skipMbo()              
ctx.skipTxn()
ctx.complete()              
ctx.process()              
ctx.getUserInfo()
ctx.getParentMbo()      
ctx.isPrimary()  
ctx.bypassMbo()              
ctx.getMsgType()
ctx.getPrimaryMboSet()    
ctx.getPrimaryMbo()        
ctx.processAsUpdate()              
ctx.processAsAdd()              
ctx.processAsAddAtEnd()              
ctx.log ()

The following APIs are available for inbound data processing:

ctx.getMosDetailInfo()
Provides information about the data dictionary cache for the integration framework for the object structure that is being processed.
ctx.skipMbo()
Skips the processing of a Maximo® business object.
ctx.skipTxn()
Skips the processing of an entire transaction, such as a message.
ctx.complete()
Ends the processing of the object structure at the point of execution, which means that child data is not processed.
ctx.process()
Continues the processing at the point of execution. This API is typically used as part of conditional logic.
ctx.getParentMbo()
Retrieves the parent business object. This API can be used from a child object whose business object is not yet created.
ctx.isPrimary()
Identifies whether the current business object is the root-level business object of the object structure.
ctx.getUserInfo()
Retrieves user information, which is needed if a script is creating a new business object.
ctx.bypassMbo()
Bypasses the creation of the business object and continues to the next business object that is being processed.
ctx.getMsgType()
Provides access to the message type, such as Sync or Create.
ctx.setMsgType()
Sets the message type, such as Sync or Create. This API can be used before processing begins.
ctx.getData()
Provides access to the StructureData, which is the XML message.
ctx.setMboSet(MboSet mboSet)
Sets values in a business object set.
ctx.setMbo(Mbo mbo)
Sets values in a business object.
ctx. getPrimaryMboSet()
Retrieves the root business object of an object structure during the processing of a child business object.
ctx.setProcessTable(String processTable)
Sets the table for a process. The method is used if you have a nonpersistent business object, such as MXRECEIPT, that has processing logic to determine whether the MATRECTRANS table or the SERVRECTRANS table is updated. The ctx.setProcessTable(String processTable) API is used in the beforeProcess(ctx) function.
ctx.getProcessTable()
Retrieves the table name that is set by the ctx.setProcessTable(String processTable) API.
ctx.setSkipBaseAdditionalRules()
Adds custom logic to in the preSaveRules(ctx) function to operate on a completed object structure that is now prepared in the processing.
ctx.processAsUpdate()
Sets the processing action of a business object to the Update action instead of the Add or Delete action.
ctx.processAsAdd()
Sets the processing action of a business object to the Add action instead of the Update or Delete action.
ctx.processAsAddAtEnd()
Sets the processing action of a business object to the Add action instead of the Update or Delete action and creates the business object at the end of the collection instead of at the top of the collection.
ctx.log ()
Runs a log statement from an object structure processing context.


Feedback