JBoss Community

Re: getProcess in ProcessInstanceImpl throws a NullPointerException

created by Sandra Renaud in jBPM - View the full discussion

Sorry but I don't understand your answer.

 

I recurrently throws this error when I work with WorkflowProcessInstance.

 

This is the code that failed :

 

WorkflowProcessInstance wpi = (WorkflowProcessInstance)kSession.getProcessInstance(processInstanceId);

wpi.setVariable(key, object);

 

or

 

  WorkflowProcessInstance wpi = (WorkflowProcessInstance)kSession.getProcessInstance(processInstanceId);

                    if((wpi == null) || (wpi.getVariable(key) == null)){

       //This case never appears because of persistent sessions

                                   System.out.println("workflow process instance is null :-(");

                    }else{

                                   System.out.println("workflow process instance is NOT null :-)");

                                   retObj = wpi.getVariable(key);

 

                                   //node info

                                   System.out.println("list of node instance : ");

                                   for(NodeInstance iNode : wpi.getNodeInstances()){

            Node node = iNode.getNode();

        }

  }

Reply to this message by going to Community

Start a new discussion in jBPM at Community