This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
72:custom_reports_getting_started_creating_data_collector [2019/02/27 17:24]
ext-bkkr [Create a Data Collector]
72:custom_reports_getting_started_creating_data_collector [2019/02/27 17:39] (current)
Line 1: Line 1:
 ====== Creating Stages Data Collector ====== ====== Creating Stages Data Collector ======
-==== Add Collection Interval ​====+==== Create ​Data Collector ​====
-  - Click on the Data Collector to get the context ​menu and select ​**Add collection**  ​interval+  - Log into Stages as a user different to the superuser (administrator). 
-  - Enter the cron expression+      - The user needs at least (RMC) permissions of the domain Reports and Data Collectors. 
-  - Click Save to store the interval.+      - //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.//​ 
 +  - Select your metric in the Processes Application in Stages where you want to add a Data Collector. 
 +  - Select the Data Collectors tab, click on the **+ SIgn** to add a new Data Collector
 +  - Enter a name for this Data Collector and click on the **Script** tab
 +  - Click the **More** button ​to enter the first Column name "​DocumentName"​ and continue with the others. 
 +  - Enter a data collector script.
-====   ====+<​code>​ 
 +var artifacts ​= 
 +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.
 ==== Add a Collection Interval ==== ==== Add a Collection Interval ====
-  - Click on the Data Collector to get the context menu and select **Add collection** interval.+  - Click on the Data Collector to get the context menu and select **Add collection** ​ interval.
   - Enter the cron expression.   - Enter the cron expression.
   - Click Save to store the interval.   - Click Save to store the interval.