This is an old revision of the document!


Creating Stages Data Collector

Create a Data Collector

  1. Log into Stages as a user different to the superuser (administrator).
    1. The User needs at least RMC permissions of the domain Reports and Data Collectors
      1. Note: Otherwise you cannot get the Data collector running, because the Data collector is running in the context of the user who saved the collector the last time. For security reasons the superuser context is disabled.
  2. Select your metric in the Processes Application in Stages where you want to add a Data collector.
  3. Select the Data Collectors tab, click on the + sign to add a new Data collector.
  4. Enter a <font inherit/Courier New,Courier,monospace;;inherit;;inherit>name</font>for this Data collector and click on the Script tab.
  5. Click the More button to enter the first column name “DocumentName” and continue with the others.
  6. Enter a data collector script
**var**  artifacts =
<font inherit/inherit;;#2980b9;;inherit>pkit</font>.<font inherit/inherit;;#c0392b;;inherit>getCurrentProject</font>().<font inherit/inherit;;#c0392b;;inherit>getEntities</font>("<font inherit/inherit;;#2980b9;;inherit>containsProcess@SYSTEM</font>")
[<font inherit/inherit;;#2980b9;;inherit>0</font>].<font inherit/inherit;;#c0392b;;inherit>getEntities</font>("<font inherit/inherit;;#2980b9;;inherit>containsArtifact@SYSTEM</font>");

**for ** (i = <font inherit/inherit;;#2980b9;;inherit>0</font>; i <<font inherit/inherit;;#2980b9;;inherit>artifacts</font>.<font inherit/inherit;;#c0392b;;inherit>length</font>; <font inherit/inherit;;#2ecc71;;inherit>i++</font>) {
**var **artifacts_instances =
 artifacts[i].<font inherit/inherit;;#c0392b;;inherit>getEntities</font>("<font inherit/inherit;;#2980b9;;inherit>containsInstance@SYSTEM</font>");
**for ** (j = <font inherit/inherit;;#2980b9;;inherit>0</font>; j <<font inherit/inherit;;#2980b9;;inherit>artifacts_instances</font>.<font inherit/inherit;;#c0392b;;inherit>length</font>; <font inherit/inherit;;#2ecc71;;inherit>j++</font>) {
 **var **artifacts_revisions =
 artifacts_instances[j].<font inherit/inherit;;#c0392b;;inherit>getEntities</font>("<font inherit/inherit;;#2980b9;;inherit>containsRevision@SYSTEM</font>");
**if ** (<font inherit/inherit;;#2980b9;;inherit>artifacts_revisions</font>.<font inherit/inherit;;#c0392b;;inherit>length</font>== <font inherit/inherit;;#2980b9;;inherit>0</font>) {
 <font inherit/inherit;;#2980b9;;inherit>dataset</font>.<font inherit/inherit;;#c0392b;;inherit>setColumnValue</font>("<font inherit/inherit;;#2980b9;;inherit>State</font>", "<font inherit/inherit;;#2980b9;;inherit>no version</font>");
 } **else **{
 <font inherit/inherit;;#2980b9;;inherit>dataset</font>.<font inherit/inherit;;#c0392b;;inherit>setColumnValue</font>("<font inherit/inherit;;#2980b9;;inherit>State</font>",
 artifacts_revisions[<font inherit/inherit;;#2980b9;;inherit>0</font>].<font inherit/inherit;;#c0392b;;inherit>getProperty</font>("<font inherit/inherit;;#2980b9;;inherit>state</font>"));
 }
 <font inherit/inherit;;#2980b9;;inherit>dataset</font>.<font inherit/inherit;;#c0392b;;inherit>setColumnValue</font>("<font inherit/inherit;;#2980b9;;inherit>DocumentName</font>",
 artifacts_instances[j].getProperty("LogicalName"));
 <font inherit/inherit;;#2980b9;;inherit>dataset</font>.<font inherit/inherit;;#c0392b;;inherit>storeResultRow</font>();
 }
}
  1. Click on the Save
  2. Click on the Preview tab to see a preview on the results.
  3. Click on the Script tab and click Save to store the Data collector.

Add a Collection Interval

  1. Click on the Data Collector to get the context menu and select Add collection interval.
  2. Enter the cron expression.
  3. Click Save to store the interval.