1 2 3 Previous Next 33 Replies Latest reply on Apr 24, 2007 8:41 AM by Sanket Shirodkar Go to original post
      • 31. Re: Assign a task to 2 users, how please?
        Mohamed Abbes Newbie

        hello
        i don't understand please exact response
        regard

        • 32. Re: Assign a task to 2 users, how please?
          JAVIER ROSADO Newbie

          Yes, the new list display the tasks pending of the group, but when i run a task of one of members of group just execute the task of the user that is logged and after this the another user when loggin don't see his task of the group.
          I think this method only assign the task to first user that execute it.
          public String assignTaskInstance(){
          long id = JsfHelper.getId("taskInstanceId");
          TaskInstance taskInst = taskMgmtSession.loadTaskInstance(id);
          taskInst.setActorId(userBean.getUserName());
          return "home";
          }

          PD:Sorry with mi english.....

          "alv21" wrote:
          i had same problem but i resolved it. There is no bugs in jBPM about group assignment, just websale example does not implement it.
          talking about websale example, if you use "group(groupName)" in a task or swimlane assignment, and logging with some of groupName members you will not find any tasks in their tasklist. This is correct because in that tasklist (that of websale example) you will find only task assigned to user logged. If you want to see a tasklist with tasks assigned to user's group, you have to write in home.jsp another list table. See my example below:

          
          <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
          <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
          
          <f:view>
          
          <jsp:include page="header1.jsp" />
          Home
          <jsp:include page="header2.jsp" />
          
          <b><h:messages /></b>
          
          <h4>Tasklist assigned</h4>
          <h:dataTable value="#{homeBean.taskInstances}" var="taskInstance" headerClass="tableheader" columnClasses="tablecell">
           <h:column >
           <f:facet name="header">
           <h:outputText value="Task Form Link" />
           </f:facet>
           <h:commandLink action="#{homeBean.selectTaskInstance}">
           <f:param name="taskInstanceId" value="#{taskInstance.id}"/>
           <h:outputText value="#{taskInstance.name}" />
           </h:commandLink>
           </h:column>
           <h:column>
           <f:facet name="header">
           <h:outputText value="Process" />
           </f:facet>
           <h:outputText value="#{taskInstance.taskMgmtInstance.taskMgmtDefinition.processDefinition.name}" />
           </h:column>
           <h:column>
           <f:facet name="header">
           <h:outputText value="Version" />
           </f:facet>
           <h:outputText value="#{taskInstance.taskMgmtInstance.taskMgmtDefinition.processDefinition.version}" />
           </h:column>
          </h:dataTable>
          
          <!-- author Ciro -->
          <h4>Tasklist assignable</h4>
          <h:dataTable value="#{homeBean.pooledTaskInstances}" var="pooledTaskInstance" headerClass="tableheader" columnClasses="tablecell">
           <h:column >
           <f:facet name="header">
           <h:outputText value="Task Form Link" />
           </f:facet>
           <h:commandLink action="#{homeBean.assignTaskInstance}">
           <f:param name="taskInstanceId" value="#{pooledTaskInstance.id}"/>
           <h:outputText value="#{pooledTaskInstance.name}" />
           </h:commandLink>
           </h:column>
           <h:column>
           <f:facet name="header">
           <h:outputText value="Process" />
           </f:facet>
           <h:outputText value="#{pooledTaskInstance.taskMgmtInstance.taskMgmtDefinition.processDefinition.name}" />
           </h:column>
           <h:column>
           <f:facet name="header">
           <h:outputText value="Version" />
           </f:facet>
           <h:outputText value="#{pooledTaskInstance.taskMgmtInstance.taskMgmtDefinition.processDefinition.version}" />
           </h:column>
          </h:dataTable>
          
          <h4>Start New Process Execution</h4>
          
          ...
          
          


          then write related methods in homeBean.java:

          
          ...
          
           public List getTaskInstances() {
           return taskMgmtSession.findTaskInstances(userBean.getUserName());
           }
          
           //author Ciro
           public List getPooledTaskInstances() {
           Session session=null;
           String user = userBean.getUserName();
           JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
           session=jbpmContext.getSession();
           Query query= session.createQuery("select membership.group.name " +
           "from org.jbpm.identity.Membership as membership " +
           "where membership.user.name='"+user+"'");
           List list=query.list();
           List l;
           if(!list.isEmpty())l=taskMgmtSession.findPooledTaskInstances(list);
           else l=list;
           return l;
           }
          
           public List getLatestProcessDefinitions() {
           return graphSession.findLatestProcessDefinitions();
           }
          
           /**
           * selects a task.
           */
           public String selectTaskInstance() {
           // Get the task instance id from request parameter
           long taskInstanceId = JsfHelper.getId("taskInstanceId");
           TaskInstance taskInstance = taskMgmtSession.loadTaskInstance(taskInstanceId);
           taskBean.initialize(taskInstance);
           return "task";
           }
          
           //author Ciro
           public String assignTaskInstance(){
           long id = JsfHelper.getId("taskInstanceId");
           TaskInstance taskInst = taskMgmtSession.loadTaskInstance(id);
           taskInst.setActorId(userBean.getUserName());
           return "home";
           }
          
          ...
          
          


          regards,
          Ciro


          • 33. Re: Assign a task to 2 users, how please?
            Sanket Shirodkar Newbie

            hi,

            i have a very simple doubt

            i am using jbpm starters kit 3.1.4

            can anyone tell me how(or the procedure) by which i can get a task assigned to a user into his personal task list ( the user(ernie,bert,etc) in my case belongs to a set of pooled users).

            as per my info any of the pooled users cannot perform the task until the task is assigned to the task list of any one of the pooled actors...

            any help regarding this?

            1 2 3 Previous Next