Java API - updating and versioning changes document status

Using the default lifecycle and API java, when I make an update to a document in the state “approved”, sometimes (seemingly in non-deterministic way), the status of the document changes to “project”. Maybe there is a listener that handles these situations (I ignore its existence), but I do not understand the non-deterministic behavior.

here the code:

HttpAutomationClient client = new HttpAutomationClient(serverURI,0,0);
session = client.getSession(username, password);

Document asset=null;
DocumentService ds = new DocumentService(session);
//get the asset with state="approved"
asset = ds.getDocument(result,"*");
//... change some property like title ...
ds.update(asset);
Document versionedDocument = ds.createVersion(asset,increment.value());
//versionedDocument sometimes has state="project"
client.shutdown();

Thanks in advance, M.

0 votes

0 answers

1394 views

ANSWER

zod
were you able find some solution? am using rest call , i cant change state
05/02/2014