10 Replies Latest reply on Mar 17, 2014 3:07 AM by Tomasz U

    How to act on task assigned to group as a group member.

    Tomasz U Newbie

      Hello,

       

      I created a definition and assign human task to group1 using code below.

       

      <bpmn:dataInput id="_jbpm-unique-2_GroupIdInput" name="GroupId" />
      <bpmn:inputSet>
      <bpmn:dataInputRefs>_jbpm-unique-2_GroupIdInput</bpmn:dataInputRefs>
      </bpmn:inputSet>
      <
        <bpmn:targetRef>_jbpm-unique-2_GroupIdInput</bpmn:targetRef>
        <bpmn:assignment>
        <bpmn:from xsi:type="bpmn:tFormalExpression">group1</bpmn:from>
        <bpmn:to xsi:type="bpmn:tFormalExpression">_jbpm-unique-2_GroupIdInput</bpmn:to>
        </bpmn:assignment>
      </bpmn:dataInputAssociation>
      
      

       

      Users and groups are defined in property files:

       

      users.property

       

      user1=password
      user2=password
      

       

      roles.property

       

      user1=admin,manager,users,group1,group3
      user2=admin,manager,users,group2,group3
      user3=admin,manager,users,group1
      

       

      When I try to list tasks:

      /task/query?potentialOwner=user1

      The list is empty, the same for user3. I have to use group1 as potential owner to see this task in this way..

      And when try to start task as user1 or user3 I get:

       

      <response>
          <status>FAILURE</status>
          <error>org.hibernate.WrongClassException: Object with id: group1 was not of the specified subclass: org.jbpm.services.task.impl.model.UserImpl (loaded object was of wrong class class org.jbpm.services.task.impl.model.GroupImpl)</error>
          <stackTrace>javax.persistence.PersistenceException: org.hibernate.WrongClassException: Object with id: group1 was not of the specified subclass: org.jbpm.services.task.impl.model.UserImpl (loaded object was of wrong class class org.jbpm.services.task.impl.model.GroupImpl)
        at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1361)
      

       

      When I send request /task/{taskId}

      potential owner is u:group1. I understand that "u:" means user not group, am I right?

      If so, isn't it a bug?