4.18. Actor assignment calls

User Tasks must define either the ActorID or the GroupID parameter, which define the users who can or should execute the User Tasks. It is in the Task List of these users the Task appears.

If the User Task element defines exactly one user, the User Task appears only in the Task List of that particular user. If a User Task is assigned to more than one user, that is, to multiple actors or to a group, it appears in the Task List of all the users and any of the users can claim and execute the User Task. End users define these properties in the Process Designer.

Predefined Administrator user

The Administrator can manipulate the life cycle of all Tasks, even if not being their potential owner. By default, a special user with userId Administrator is the administrator of each Task. It is therefore recommended to always define at least user Administrator when registering the list of valid users with the User Task service.

4.18.1. Connecting to custom directory information services

It is often necessary to establish connection and transfer data from existing systems and services, such as LDAP, to acquire data on actors and groups for User Tasks. This can be done by implementing the UserGroupInfoProducer interface which allows you to create your own implementation for user and group management, and then configuring it over CDI for Business Central. These are the steps required to implement and make this interface active:

  1. Create an implementation of the UserGroupInfoProducer interface and provide your own custom callback (see Section 4.19.1, “Connecting to LDAP”) and user info implementations according to the needs from the producer.

    This implementation must be annotated with the @Selectable qualifier for it to be found by Business Central. The listing below shows an example LDAP implementation:

    import javax.enterprise.context.ApplicationScoped;
    import javax.enterprise.inject.Alternative;
    import javax.enterprise.inject.Produces;
    
    import org.jbpm.services.task.identity.LDAPUserGroupCallbackImpl;
    import org.jbpm.services.task.identity.LDAPUserInfoImpl;
    import org.jbpm.shared.services.cdi.Selectable;
    import org.kie.api.task.UserGroupCallback;
    import org.kie.internal.task.api.UserInfo;
    
    @ApplicationScoped
    @Alternative
    @Selectable
    public class LDAPUserGroupInfoProducer implements UserGroupInfoProducer {
    
      private UserGroupCallback callback = new LDAPUserGroupCallbackImpl(true);
      private UserInfo userInfo = new LDAPUserInfoImpl(true);
    
      @Override
      @Produces
      public UserGroupCallback produceCallback() {
        return callback;
      }
    
      @Override
      @Produces
      public UserInfo produceUserInfo() {
        return userInfo;
      }
    
    }
  2. Package your custom implementations (the LDAPUserGroupInfoProducer, the LDAPUserGroupCallbackImpl and the LDAPUserInfoImpl classes from the example above) into a bean archive (jar with META-INF/beans.xml so it can be found by CDI container). Add this jar file to business-central.war/WEB-INF/lib.
  3. Modify business-central.war/WEB-INF/beans.xml and add the implementation (LDAPUserGroupInfoProducer from the example above) as an alternative to be used by Business Central.

    <beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://docs.jboss.org/cdi/beans_1_0.xsd">
    
        <alternatives>
            <class>com.test.services.producer.LDAPUserGroupInfoProducer</class>
        </alternatives>
    </beans>
    Warning

    The use of a custom UserGroupInfoProducer requires internal APIs, which may be broken in future releases. Using a custom UserGroupInfoProducer is not recommended or supported by Red Hat.

  4. Restart your server and your custom callback implementation should now be used by Business Central.