1 Reply Latest reply on Mar 19, 2013 12:09 PM by joploya

    UserGroupCallbackManager: Not returning callback

    houston4j Newbie

      Hello,

       

      I'm unable to retrieve an instance of the UserGroupCallback using the UserGroupCallbackManager.

       

      From my understanding this should work by setting the jbpm.usergroup.callback property:

       

      System.setProperty("jbpm.usergroup.callback", "org.jbpm.task.identity.LDAPUserGroupCallbackImpl")

       

      and calling:

       

      UserGroupCallbackManager.getInstance().getCallback()

       

      I get a null when the getCallback() method is executed. UserGroupCallbackManager.getInstance().existsCallback() returns false.

       

      Is additional configuration needed to get the LDAPUserGroupCallbackImpl registered?

        • 1. Re: UserGroupCallbackManager: Not returning callback
          joploya Newbie

          Hello,

           

          At the creation of the knowledge session I use this code to register my usergroupcallback :

          // By Setting the jbpm.usergroup.callback property with the call

                  // back class full name, task service will use this to validate the

                  // user/group exists and its permissions are ok.

                        InputStream usergroupsin = KnowledgeSessionProducer.class.getResourceAsStream(  "/jbpm.usergroup.callback.properties" );

                        if(usergroupsin != null) {

                                  Properties callbackproperties = new Properties();

                                  try {

                                            callbackproperties.load(usergroupsin);

                                            UserGroupCallbackManager.getInstance().setCallbackFromProperties(callbackproperties);

                                            log.debug("Task service registered usergroup callback ...");

                                  } catch (Exception e) {

                                            log.debug("Task service unable to register usergroup callback ...");

                                  }

                        }

           

              if(UserGroupCallbackManager.getInstance().existsCallback()){

                                  System.out.println("userGroupCallBack exists ! :)");

                        }else{

                                  System.out.println("userGroupCallBack don't exist ! :(");

                        }

           

           

           

          and I create a file name : jbpm.usergroup.callback.properties in src/main/resources

          that contain this line :

          jbpm.usergroup.callback=com.st.ams.task.management.AMSUserGroupCallbackImpl

           

          This is the associated log :

          17:06:45,137 DEBUG [com.st.ams.jbpm.knowledge.KnowledgeSessionProducer] (http--127.0.0.1-8080-3) init of KnowledgeSessionProducer ...

          17:06:45,152 DEBUG [com.st.ams.task.management.AMSUserGroupCallbackImpl] (http--127.0.0.1-8080-3) Starting AMSUserGroupCallbackImpl ...

          17:06:45,153 INFO  [org.jbpm.task.identity.UserGroupCallbackManager] (http--127.0.0.1-8080-3) UserGroupCallback registered from properties file: com.st.ams.task.management.AMSUserGroupCallbackImpl

          17:06:45,154 DEBUG [com.st.ams.jbpm.knowledge.KnowledgeSessionProducer] (http--127.0.0.1-8080-3) Task service registered usergroup callback ...

          17:06:45,155 INFO  [stdout] (http--127.0.0.1-8080-3) userGroupCallBack exists !

           

          I hope it will help you.

          Regards,