Reading and changing the status of a business object
The getState & setState methods are used to get and set the status of a business object, that is, these methods set the status transitions of the business objects. These new methods replace the previous set of methods whereby one method was used for each status transition. The sample code below shows you how to use the GetState and SetState methods to check the current status of any business object in Planon ProCenter.
final UsrMoveOrderClientStub instance = new UsrMoveOrderClientStub();
final String sessionId = instance.login( aArgs[0], aArgs[1] );
// Read the Order using the primary key got
UsrMoveOrder aOrder = instance.read(sessionId,orderId[0]);
//get the current state
instance.getState(final aSessionId, aOrder);
// Set a State
String aTargetState= “UsrTechnicallyCompleted” ;
// UsrTechnicallyCompleted::System name of the target state
instance.setState(sessionId,aOrder,aTargetState);