Samrat Roy [http://community.jboss.org/people/whizkid.samrat] created the 
discussion

"Re: How to use task and state in jbpm 4.4"

To view the discussion, visit: http://community.jboss.org/message/604407#604407

--------------------------------------------------------------
and this is how you get the task id's of the tasks allocated to a user  before 
you display them on a jsp .. 

Keep the task id in a hidden field if you so desire. 

public List<ApproveLeaveModel> getPersonalList(String username) {
        List<ApproveLeaveModel> approvalList = new 
ArrayList<ApproveLeaveModel>();
        List<Task> personalTaskList = taskService.findPersonalTasks(username);  
// finds personal tasks alloted to a user. 

        for(Task t : personalTaskList){
            String tId = t.getId();
            Set<String> variableNames = taskService.getVariableNames(tId);
            Map<String,Object> variables = taskService.getVariables(tId, 
variableNames);
            Integer reqId= (Integer)variables.get("requestId");
            String requestId = reqId.toString();
            if(requestId!=null){
                ApproveLeaveModel alm  = 
leaveModuleDao.getLeaveRequestbyId(requestId);
                alm.setTaskId(tId);
                approvalList.add(alm);
            }
        }
        return approvalList;
    }
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/604407#604407]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to