Any customer or integration application that needs to run an additional migration should add a setting to the FTRInterOpIntermediateObjectMigration command. The setting must consist of a unique name, which can be any string value. The setting value must be in the form PROGRAM:METHOD for the program and method name that the default migration script should call to handle customizations. The following are some examples of settings that can be added to the command:
There must be Matrix Java Program Object (JPO) by the name of the program given in the setting. Below is an example of a custom migration program and method with the required arguments and retype: public class MyProgram_mxJPO extends emxCommonMigration_mxJPO { ... /** * Custom Migration * This method contains any custom migration algorithsm that need to be run * @param context the eMatrix <code>Context</code> object * @param args is a packed HashMap containing * objectId String id of context object being migrated * newRelId String id of the relationship that is replacing the object being migrated * @return Map consisting of * status integer flag, 9 on success or 1 on failure * faiureId String specifying a meaningful status code * failureMessage String specifying the failure message * @throws Exception if the operation fails */ public Map myMigration (Context context, String[] args) throws Exception { Map statusMap = new HashMap(); statusMap.put("status", 0); statusMap.put("failureId", ""); statusMap.put("failureMessage", ""); HashMap paramMap = (HashMap)JPO.unpackArgs(args); MapList objMapList = (MapList)paramMap.get("objectList"); String objectId = ""; String newRelId = ""; try { Iterator itr = objMapList.iterator(); while ( itr.hasNext()) { Map objMap = (Map)itr.next(); objectId = (String)objMap.get("objectId"); newRelId = (String)objMap.get("newRelId"); …custom migration code… } } catch (Exception ex) { statusMap.put("status", 1); statusMap.put("failureId", objectId); statusMap.put("failureMessage", objectId + " " + ex.getMessage()); } return statusMap; } } The PROGRAM:METHOD is called for each object that is being migrated. Upon return to the migration, the status flag is checked.
The default migration automatically migrates any custom relationships that are connected TO or FROM the Feature List or GBOM type, and those custom relationships do not require a custom migration program. |