2 Replies Latest reply on Aug 6, 2008 6:27 AM by (thomas_belarbi)

    can't reassign task !

      Hi everybody!

      is here my code :

      try{
      //Set connection properties
      Properties ConnectionProps = new Properties();
      ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "jnp://172.31.196.43:1099");
      ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,Service ClientFactoryProperties.DSC_EJB_PROTOCOL);
      ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE, ServiceClientFactoryProperties.DSC_JBOSS_SERVER_TYPE);
      ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "apink");
      ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");

      //Create a ServiceClientFactory object
      ServiceClientFactory myFactory = ServiceClientFactory.createInstance(ConnectionProps);

      //Create a TaskManager object
      TaskManager myTaskManager = TaskManagerClientFactory.getTaskManager(myFactory);

      //Get the user identifer by calling
      //a user-defined method
      String userID = getUserId(myFactory);

      //Forward task to another user
      myTaskManager.forwardTask(17,userID);
      }
      catch(Exception e)
      {
      e.printStackTrace();
      }
      }

      As you can see, I use the user apink ( because it's the owner of the task N°17 )

      my method getUserId() :

      static private String getUserId(ServiceClientFactory myFactory){
      String oid = "";
      try{

      //Create a DirectoryManagerServiceClient object
      DirectoryManagerServiceClient dirClient = new DirectoryManagerServiceClient(myFactory);

      //Find a local user
      PrincipalSearchFilter psf = new PrincipalSearchFilter();
      psf.setUserId("tblue");
      List principalList = dirClient.findPrincipals(psf);
      Iterator pit = principalList.iterator();

      User testUser = null;
      if (pit.hasNext())
      {
      //Obtain the principals object identifier
      testUser = (User)(pit.next());
      }
      oid = testUser.getOid();
      }
      catch(Exception e)
      {
      e.printStackTrace();
      }

      return oid;
      }

      I have this exception :

      com.adobe.pof.POFException: No Active User in an Active Domain found for Principal ID:

      If I use "administrator" instead of "apink" I have this exception

      com.adobe.idp.taskmanager.dsc.client.task.TaskNotFoundException: Task: 17 was not found, or it is not in the correct state for the operation you are attempting - task not reassigned.

      Anyone have an Idea ?

      Thanks

      Thomas