Wednesday, August 10, 2011

WPS: Custom code to call map

 // create a BOFactory instance to create BO instance
BOFactory boFactory = (BOFactory)ServiceManager.INSTANCE.locateService("com/ibm/websphere/bo/BOFactory");
// creating input BO
DataObject ldsJobInput = boFactory.create("<name space>","<BO Name>");

HashMap inputMap  = new HashMap();
//adding the inputs to the map
inputMap.put("<input BO Name>",<input BO reference>);
inputMap.put("<input BO Name>",<input BO reference>);
inputMap.put("<input BO Name>",<input BO reference>);//..... as per our submap
HashMap outputMap  = new HashMap();
//adding the out bo's to the map
outputMap.put("<Out BO name>",<out Bo reference>);

// creating the instance for map service
MapService service  = (MapService)new com.ibm.websphere.sca.ServiceManager().locateService("com/ibm/wbiserver/map/MapService");
// calling the map
service.transform("<map namespace>","<Map Name>",inputMap,outputMap,null);
//set the out BO reference to outreference
<output Reference>  =<out Bo reference>;
ex: ServiceMessageObject_1_body_createLDSJob_createLDSJobInput_Content  = ldsJobInput;

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.