[jboss-user] [jBPM] - Re: How to use task and state in jbpm 4.4

Samrat Roy do-not-reply at jboss.com
Tue May 10 05:55:12 EDT 2011


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]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110510/08942e8f/attachment.html 


More information about the jboss-user mailing list