here I am, back again
I hope that reply help any one who need this.

this is a pice of code that get car POJO from database, assuming that the car 
state now in state #2 which is "2.rent a car from warehouse."

  | 
  | //read definition XML file
  | ProcessDefinition 
carProcessDefinition=ProcessDefinition.parseXmlResource(processDefFileName);
  | 
  | 
  | //create new process instance from this definition
  | ProcessInstance 
carProcessInstance=carProcessDefinition.createProcessInstance();
  | 
  | 
  | //get my car object from database
  | Car car=carService.getCarById(carId);
  | 
  | 
  | //get a state object in this process instance using the POJO object state
  | //carState attribute in the car POJO is string that represent the node name
  | //in the process definition.
  | Node currentNode=(Node)carProcessDefinition.getNode(car.getCarState());
  | 
  | 
  | //now this will set the active (current) node of the process definition to 
equivalent
  | //state of my CarPOJO class
  | carProcessInstance.getRootToken().setNode(currentNode);
  | 
  | 
  | //now we will signal to the next state which is doSomeMaintenance
  | carProcessInstance.signal("doSomeMaintenance");
  | 

Thanks a lot,
Ahmed Adly

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3951074#3951074

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3951074


_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to