Change performer with java code

Posted by akhela on 01-Oct-2012 11:54

Hi,

we need to change perfomer of a process Instance with java code,

I'm using BizLogic API to do that, but it seems not working,

reassignInstance(Long piid, String newPerformer, Integer dtValue) { 
     try{
      blServer  = BLClientUtil.getBizLogicServer();  
      blUser = COConfigurationLoader.getInstance().getBootConfigValue(COConfigurationLoader.SBM_USER);
      blPwd  = PService.self().decrypt(COConfigurationLoader.getInstance().getBootConfigValue(COConfigurationLoader.SBM_PWD));
      blSession = blServer.connect(blUser, blPwd);  
     
      blProcessInstance = blServer.getProcessInstance(blSession, piid);
      blWorkItem = blProcessInstance.getAssignedWorkItemList();        
     
      blWorkItem.reAssign(newPerformer);
      blWorkItem.save();
      blServer.disConnect(blSession);
      return "Ok";
     }catch(Exception e){
      return "Ko";
     }

Could someone help me?

thanks in advanced

Federico

All Replies

Posted by vpandey on 01-Oct-2012 12:09

Hello Fedrico,

This part of the complete snippet appears to be problematic:

      blWorkItem = blProcessInstance.getAssignedWorkItemList();        
      blWorkItem.reAssign(newPerformer);

This is should be:

      blWorkItemList = blProcessInstance.getAssignedWorkItemList();   \\ WorkItemList reference variable

      List obj=blWorkItemList.getList()

      for(int i=0;i
      ((blWorkItem)obj.get(i)).reAssign(newPerformer);

Could you please try it out, please ignore any typos.

Posted by vpandey on 01-Oct-2012 12:13

please modify this

for(int i=0;i


to

for(int i=0;i

Posted by akhela on 02-Oct-2012 03:30

Hi Vikas,

thanks for your answer,

I have had to use this method

blWorkItemList = blProcessInstance.getWorkItemList();

because this

blWorkItemList = blProcessInstance.getAssignedWorkItemList();

returned an empty list!

For you, Is it the same? It's working fine now...

bye

Federico

This thread is closed