var artifacts = pkit.getCurrentProject().getEntities("containsProcess@SYSTEM") [0].getEntities("containsArtifact@SYSTEM"); for (i = 0; i <artifacts.length; i++) { var artifacts_instances = artifacts[i].getEntities("containsInstance@SYSTEM"); for (j = 0; j <artifacts_instances.length; j++) { var artifacts_revisions = artifacts_instances[j].getEntities("containsRevision@SYSTEM"); if (artifacts_revisions.length == 0) { dataset.setColumnValue("State", "no version"); } else { dataset.setColumnValue("State", artifacts_revisions[0].getProperty("state")); } dataset.setColumnValue("DocumentName", artifacts_instances[j].getProperty("LogicalName")); dataset.storeResultRow(); } }
Click on Save
Click on the Preview tab to see a preview on the results.
Click on the Script tab and click Save to store the Data collector.