it is only set if you use persistency. Otherwise it is indeed always 0.
Setting the id is a hibernate thing. If you do want to use it in some way, you could use in-memory hsqldb.
An other stupid question then.
I think i am using persisantcy becuase i can see things happening in the database.
Is it a property that needs to be set on the processInstance?
Or has it something to do with the process logging?
Or something totally different.
My question is not correct i think.
Here is the code that saves the process instance.
Am i correct when the context is closed the processInstance is removed from the database.
And if i do not want that.
I want to keep track of my processInstances. How do i do that?
So the second time around when this code is executed i want to have a processInstance id of 2.
bpmContext context1 = null;
ProcessDefinition pd = ProcessDefinition.parseXmlResource("FileSplitter.par/processdefinition.xml");
context1 = this.jbpmConfiguration.createJbpmContext();
ProcessInstance instance = new ProcessInstance(pd);
} catch (Exception e)
Ok firther on my quest.
I isee the process instance id's increasing.
But when i close the jbpmContext and rerun the program the processInstance id's start from 0.
Is it possible to increase them even if i close the jbpmContext?
Searching further on my own.
Ok stupid me found it
when you do a jbpmConfiguration.createSchema(); the processInstance are dropped.
But still a bit in the dark. When do you use the jbpmConfiguration.createSchema() and drop schema.
And does anyone add javadoc to the code. And if not i want to add my findings in the java doc as a total nit wit.
I use createScheme() just in unittests so I'm sure I have a clean database.
Normally you would do this while installing jBPM (by using the generated sql and have the DBA run it for you.
You could add some javadoc to the code, but better would be to start an 'after getting started' page on the wiki with some advanced api usage.
with regard to the javadoc, post patches in the developer forum. If Tom thinks they are ok, he can grant you write access eventually.
btw, thanks for reporting back and being so investigative. Refreshing from time to time.