Skip to content

Instantly share code, notes, and snippets.

View avasyukov's full-sized avatar

Alexey Vasyukov avasyukov

View GitHub Profile
<type name="alvexcourse:approveTask">
<parent>bpm:workflowTask</parent>
</type>
<type name="alvexcourse:approveTask">
<!-- Parent changed from bpm:workflowTask to bpm:activitiOutcomeTask -->
<parent>bpm:activitiOutcomeTask</parent>
<!-- Custom property with constraint that defines possible outcome options -->
<properties>
<property name="alvexcourse:okOutcome">
<type>d:text</type>
<default>OK</default>
<constraints>
<constraint type="LIST" name="alvexcourse:okOutcomeConstraint">
listconstraint.alvexcourse_okOutcomeConstraint.OK = Approve document
workflowtask.outcome.OK = Document approved
<show id="alvexcourse:okOutcome" />
<field id="alvexcourse:okOutcome" set="response">
<control template="/org/alfresco/components/form/controls/workflow/activiti-transitions.ftl" />
</field>
// model.data will contain the data to be used for our report
model.data = [];
// Get managees of current user
var managees = orgchart.getPerson( person.properties.userName ).managees;
// Loop through all managees
for each(var user in managees)
{
// Find how many nodes in repository each managee has created
// model.data will contain the data to be used for our report
model.data = [];
// Get managees of current user
var managees = orgchart.getPerson( person.properties.userName ).managees;
for each(var user in managees)
{
// Find how many nodes in repository has each managee created
var nodes = search.luceneSearch("-TYPE:\"cm:folder\" AND @modifier:" + user.getUserName() + "");
// Create the list of available users and push it into model
// UI control will be created automatically
var userConstraint = [];
// Loop through managees and add them all to constraint
for each( user in managees )
{
// 'Label' is what user will see in user interface, 'value' is what will be passed to report script
userConstraint.push( { "label": user.firstName + ' ' + user.lastName, "value": user.userName } );
}
// UI config is stored here
// Get user list from request parameter
var reqUsers = args['user'].split(',');
var users = [];
// Loop through complete list of managees
for each(var user in managees )
{
// Check if we are to include this managee into report or not
for each( ruser in reqUsers )
{
// We need this user, if he/she was specified in request parameters or if request asks for 'any user'