IBM BPM How To Copy Object Data From and Instance to Another



IBM BPM - How to copy a data from an instance object to txt file and copy data to another object on another intance?

You can use the script 1 (to write a file)  and 2 (to read and copy to another instance object).

First copy the object data to a file on server.

try{
var map = new tw.object.Map();
map.put("filePath", "C:\\FOLDERNAME\\copy.txt");
map.put("fileContents", tw.system.serializer.toXml(tw.local.objectName).toString(true));
tw.system.executeServiceByName("Write Text File", map);
}catch(e){
e + ".."
}


After copy the object data to a text file on server, you can copy the data to any object on any instance. Be sure that object map is the same.

try{
var map = new tw.object.Map();
map.put("filePath", "C:\\FOLDERNAME\\copy.txt");
var fileContent = tw.system.executeServiceByName("Read Text File", map);

tw.local.objectName = tw.system.serializer.fromXml(fileContent.get("fileContents"));
}catch(e){
e + ".."
} 
Custom Search

Post a Comment