cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Child Reference of bpm:package

swemon
Champ on-the-rise
Champ on-the-rise
Dear all,

I want to get child reference of bpmSmiley Tongueackage from process definition file. I can get child file name and child's custom status in process definition file like that. I change custom status of the document in this file but it does not really change the custom status of document when I see document details page. Let me know if you have any solution.
for (var i = 0; i < bpm_package.children.length; i++) 
            {
               logger.log(bpm_package.children[i]);
               var doc = bpm_package.children[i];
               logger.log("Name:" + doc.properties['cm:name']);
               logger.log("Before Status:" + doc.properties['cm:customstatus']);
               doc.properties['cm:customstatus'] = "Completed";
               logger.log("After Status:" + doc.properties['cm:customstatus']);
               logger.log("Noderef:" + doc.properties['d:noderef']); //return null
               logger.log("Noderef:" + doc.noderef);//return undefined
            }

Thank in advance,
swemon
2 REPLIES 2

yogeshpj
Star Contributor
Star Contributor
you need to  save document object like document.save(). After that only document properties will be updated.

swemon
Champ on-the-rise
Champ on-the-rise
@yogeshPJ

Thank for your answer. I can save document properties of workflow package without noderef like that.
for (var i = 0; i < bpm_package.children.length; i++) 
               {
                  var doc = bpm_package.children[i];
                  doc.properties['cm:customstatus'] = "Rejected";
                  doc.save();
               }