Differences
This shows you the differences between two versions of the page.
Last revisionBoth sides next revision | |||
72:custom_reports_accessing_data_reading_process_rolereport [2019/02/27 20:03] – created ext-bkkr | 72:custom_reports_accessing_data_reading_process_rolereport [2019/02/27 20:47] – ext-bkkr | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Creating a Role Report ====== | ====== Creating a Role Report ====== | ||
+ | |||
+ | This example shows how to collect all roles in a process and their assigned users. | ||
+ | |||
+ | 1. Create a Report with a Stages Data Source and a Data Set | ||
+ | |||
+ | 2. Create the following Data Set result columns: | ||
+ | |||
+ | ^Name^Type| | ||
+ | |Username|String| | ||
+ | |Fullname|String| | ||
+ | |LicenseType|String| | ||
+ | |Name|String| | ||
+ | |EmailAddress|String| | ||
+ | |Indented|String| | ||
+ | |||
+ | 3. Copy the Data Set script from the example into your Data Set. | ||
+ | |||
+ | **Example** | ||
+ | < | ||
+ | function getChilds(element, | ||
+ | { | ||
+ | var children_level = mylevel + 1; | ||
+ | var myelements = | ||
+ | | ||
+ | for each (myelement in myelements) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | function getIndex(myelement) { | ||
+ | do { | ||
+ | var parent = | ||
+ | | ||
+ | if (parent[0].getProperty(" | ||
+ | | ||
+ | } | ||
+ | | ||
+ | } while (parent[0].getProperty(" | ||
+ | | ||
+ | } | ||
+ | function addSpaces (n) { | ||
+ | var string = ""; | ||
+ | for (var i=0; i<n; i++) { | ||
+ | | ||
+ | } | ||
+ | | ||
+ | } | ||
+ | function getUsers(myelement, | ||
+ | var myUsers = myelement.getEntities(" | ||
+ | for each (myUser in myUsers) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | if (myUsers.length==0) | ||
+ | | ||
+ | } | ||
+ | function saveColumn(element, | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | var currentProject = pkit.getCurrentProject(); | ||
+ | var process = currentProject.getEntities(" | ||
+ | var assocs = process.getPkitClass().getAssociations(); | ||
+ | for each (assoc in assocs) { | ||
+ | if (assoc.getName().match(/ | ||
+ | var elements = process.getEntities(assoc.getName()); | ||
+ | if (elements.length> | ||
+ | | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | \\ | ||