Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
77:process_feedback [2022/06/29 08:35] fnpk77:process_feedback [2022/07/04 09:29] fnpk
Line 133: Line 133:
   * ''value'': The value that should be mapped   * ''value'': The value that should be mapped
   * ''target''  and ''targetType'': Defines feedback system specific configuration   * ''target''  and ''targetType'': Defines feedback system specific configuration
 +
 === Script Attribute Mappings === === Script Attribute Mappings ===
  
Line 138: Line 139:
  
 <code javascript> <code javascript>
-var user = currentElement.getProperty("LastChangeUser"); +if(currentElement) { 
-result.mappings.put("lastChangedBy", user); // Add script-attribute-mapping 'lastChangedBy'+    var user = currentElement.getProperty("LastChangeUser"); 
 +    result.mappings.put("lastChangedBy", user); // Add script-attribute-mapping 'lastChangedBy' 
 +}
 result.properties.put("project", "Demo"); // Override property 'project' result.properties.put("project", "Demo"); // Override property 'project'
  
Line 166: Line 169:
 </code> </code>
  
-The script can access the process element of the feedback ''currentElement''.+The script can access to several information of the process: 
 +  * Current process element''currentElement'' (in case of process start page it is null) 
 +  * Current user: ''currentUser'' 
 +  * Logger: ''log'' 
 +  * Pkit: ''pkit'' 
 +      * Current version of process: ''pkit.getCurrentProcess()'' 
 +      * Current workspace: ''pkit.getCurrentProject()'' 
 +      * ...
  
 All results have to be stored to the predefined ''result''  variable. All results have to be stored to the predefined ''result''  variable.