http://sourceforge.net/apps/mediawiki/xprocess/index.php?title=Reporting (the Recursive Solution). Existing actions can still be used but those that have a tendency to generate large amounts of data may need to be rewritten in order to get the benefit of the new mechanism.
The following example reworks the Work Log for Person action.
- Editor tab – a text area for the OGNL Expression
- Details Tab:
- Action Name - the name of the action
- Applicable to - What it is applicable to (any element is the default)
- UI Action - should it appear on context menu for element its applicable to?
- On this tab are a further two tabs; Parameters: add the Parameters that will be presented to the user when the Action is run. These parameter values are sent into the OGNL expression when run. We will come onto the Export tab later.
- Test Action Tab:
- On the Test Action Tab you can choose an Element to run the Action on to test it and enter the parameters for that action. It is recommended that you create test Elements for this, as the Action may change that Elements data.
- The lower part of this tab shows the output when the test it run
#project = projects.isEmpty() ? null : projects.iterator().next(),#from= (#project != null) ? #project.getDayProperty("fromDateForReport") :null,#to = (#project != null) ?#project.getDayProperty("toDateForReport") : null,#dailyrecords = getWorkLog(#from,#to,null)
#output = '"' +day + '","' +assignment.task.project.label + '","' +assignment.task.label + '","' +assignment.requiredResource.roleType.label + '","' +time/60.0 + '","' +logEntry + '","' +confirmed + '"',#output = #output + '\n',#output
#project = projects.isEmpty() ? null : projects.iterator().next(),#from= (#project != null) ? #project.getDayProperty("fromDateForReport") :null,#to = (#project != null) ?#project.getDayProperty("toDateForReport") : null,#output = 'Work Log for: ' + label + '\n'+ 'From: ' + ((#from==null) ? 'earliest booked time in data source': #andfrom) + ' To: ' + ((#to==null) ? #$today : #to) +'\n'+ 'Date,Project,Task,Role,Hours,Log Entry,Confirmed\n',#output
- Make the Action applicable to Person
- Click on the Export tab and tick the Export Action checkbox. Give it a .csv extension
- On the FetchSet Field click on the '…' and select the ' Get DailyRecords for Person' Action
- Now click on the Add button in the Subordinate section, and select the ' Generate Work Log Details' Action
- Hit Ctrl+S to save the Action