Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
72:custom_reports_getting_started_example [2019/02/15 19:40] ext-bkkr72:custom_reports_getting_started_example [2024/02/15 00:00] (current) – external edit 127.0.0.1
Line 34: Line 34:
 </code> </code>
  
-We use the global variable pkit to call the method <font inherit/Courier New,Courier,monospace;;inherit;;inherit>getCurrentProject()</font> to get a handle on the project of the current metric. The method returns the current project.+We use the global variable pkit to call the method getCurrentProject() to get a handle on the project of the current metric. The method returns the current project.
  
-Now we call the method <font inherit/Courier New,Courier,monospace;;inherit;;inherit>getEntities()</font> with the parameter "<font inherit/Courier New,Courier,monospace;;inherit;;inherit>containsProcess@SYSTEM</font>" to retrieve the process on this project. The return is an array, but we mostly want to get the current view, we use the first one by [0].+Now we call the method getEntities() with the parameter "containsProcess@SYSTEM" to retrieve the process on this project. The return is an array, but we mostly want to get the current view, we use the first one by [0].
  
-And now we try to get all Artifacts which are available in the process. So we call <font inherit/Courier New,Courier,monospace;;inherit;;inherit>getEntities()</font> with the parameter "<font inherit/Courier New,Courier,monospace;;inherit;;inherit>containsArtifact@SYSTEM</font>" to retrieve the artifacts on this process. As a result we get an array of all artifacts in the variable <font inherit/Courier New,Courier,monospace;;inherit;;inherit>artifacts</font>.+And now we try to get all Artifacts which are available in the process. So we call getEntities() with the parameter "containsArtifact@SYSTEM" to retrieve the artifacts on this process. As a result we get an array of all artifacts in the variable artifacts.
  
 <code> <code>
Line 46: Line 46:
 </code> </code>
  
-Now we iterate through all artifacts to get the instances of the artifacts, that means the configuration management controlled files. So we call <font inherit/Courier New,Courier,monospace;;inherit;;inherit>getEntities()</font> with the parameter "<font inherit/Courier New,Courier,monospace;;inherit;;inherit>containsInstance@SYSTEM</font>" to retrieve the instances. As a result we get an array of all instances in the variable <font inherit/Courier New,Courier,monospace;;inherit;;inherit>artifacts_instances</font>.+Now we iterate through all artifacts to get the instances of the artifacts, that means the configuration management controlled files. So we call getEntities() with the parameter "containsInstance@SYSTEM" to retrieve the instances. As a result we get an array of all instances in the variable artifacts_instances.
  
 <code> <code>
Line 55: Line 55:
 </code> </code>
  
-Now we do the same with the revisions of an instance. Each instance has several revisions. But as you can see later we use only one revision, the latest one. As a result we have a variable with all revisions <font inherit/Courier New,Courier,monospace;;inherit;;inherit>artifacts_revisions</font>.+Now we do the same with the revisions of an instance. Each instance has several revisions. But as you can see later we use only one revision, the latest one. As a result we have a variable with all revisions artifacts_revisions.
  
 <code> <code>
Line 66: Line 66:
 </code> </code>
  
-Now we check if a revision exists for an instance. If not then we fill the State column by calling the method <font inherit/Courier New,Courier,monospace;;inherit;;inherit>dataset.setColumnValue()</font> with a string "<font inherit/Courier New,Courier,monospace;;inherit;;inherit>no version</font>". Otherwise we use the value of the first revision. We get the State property of a revision by calling the method <font inherit/Courier New,Courier,monospace;;inherit;;inherit>getProperty()</font> with the paramter "<font inherit/Courier New,Courier,monospace;;inherit;;inherit>state</font>".+Now we check if a revision exists for an instance. If not then we fill the State column by calling the method dataset.setColumnValue() with a string "no version". Otherwise we use the value of the first revision. We get the State property of a revision by calling the method getProperty() with the paramter "state".
  
 <code> <code>
Line 75: Line 75:
 We retrieve the document name from the property "LogicalName" and store it in the column with the name "DocumentName". We retrieve the document name from the property "LogicalName" and store it in the column with the name "DocumentName".
  
-The last action to perform is to save the row by calling the method <font inherit/Courier New,Courier,monospace;;inherit;;inherit>dataset.storeResultRow()</font> with the two columns "<font inherit/Courier New,Courier,monospace;;inherit;;inherit>State</font>" and "<font inherit/Courier New,Courier,monospace;;inherit;;inherit>DocumentName</font>". And we have to this for all artifact's and revisions.+The last action to perform is to save the row by calling the method dataset.storeResultRow() with the two columns "State" and "DocumentName". And we have to this for all artifact's and revisions.
  
 <code> <code>