}
private void buildSubstitutedTasksViews(ProcessToolContext ctx, List<UserData> substitutedUsers,
Map<UserData,ProcessToolBpmSession> substitutedUserToSession, List<ProcessQueue> userAvailableQueues)
{
final HierarchicalContainer container = new HierarchicalContainer();
container.addContainerProperty("name",String.class,"");
container.addContainerProperty("description",String.class,null);
container.addContainerProperty("queueUserSession",QueueUserSession.class,null);
container.addContainerProperty("enabled",Boolean.class,Boolean.TRUE);
container.addContainerProperty("debugId",String.class,null);
for(UserData substitutedUser: substitutedUsers)
{
ProcessToolBpmSession bpmSessionForSubstituted = substitutedUserToSession.get(substitutedUser);
UserData liferaySubstitutedUser = ctx.getUserDataDAO().loadUserByLogin(substitutedUser.getLogin());
liferaySubstitutedUser.getRoleNames().addAll(substitutedUser.getRoleNames());
ProcessInstanceFilter substAssignedTasks = filterFactory.createOtherUserTaskForSubstitutedUser(liferaySubstitutedUser);
container.addItem(substAssignedTasks);
int total = buildSubstitutedTasks(ctx,bpmSessionForSubstituted,liferaySubstitutedUser,container,substAssignedTasks);
int totalQueues = buildSubstitutedQueues(ctx,userAvailableQueues,bpmSessionForSubstituted,substitutedUser,container,substAssignedTasks);
container.getItem(substAssignedTasks).getItemProperty("name").setValue(getMessage(substAssignedTasks.getName(), liferaySubstitutedUser.getRealName()) + " (" + total + ";" + totalQueues + ")");
container.getItem(substAssignedTasks).getItemProperty("description")
.setValue(getMessage("activity.substitutions.description",liferaySubstitutedUser.getRealName(),total,totalQueues));
/* button id for the refresher */
String buttonId = QueuesPanelRefresherUtil.getSubstitutedRootNodeId(substitutedUser.getLogin());
container.getItem(substAssignedTasks).getItemProperty("debugId").setValue(buttonId);
}
final Tree substitutionsTree = getSubstitutionsTree();
substitutionsTree.setContainerDataSource(container);
VerticalLayout vl = new VerticalLayout();