cancel
Showing results for 
Search instead for 
Did you mean: 

how process instance know, the next step to execute

meenakshi
Champ in-the-making
Champ in-the-making
Hi,

I would like to know how bpm files processed.
When We  Configure xml file like below then what happens .
  <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
  <property name="deploymentResources" >
      <list>
         <value>classpath*:/com/workflow/bpmn/*.bpmn20.xml</value>
      </list>
   </property>
</bean>

Does bpm files parsed and stored in database and when next step to process in process instance , it will see the next step from database or from the war file ?
When 2 versions of bpm files are available then, how it sees the next step to process, because in war file there will be only one file for giving deployment key and I observed that if there are some process instances available for old version of bpm, and you complete the task , then it takes the next step of old version . If it is processed from the war file then how it knows the old version of bpm , because war is having only new bpm and if it is stored in the database , then which table holds the bpm file, I see only the name of the bpm file.

Thanks a lot
Meenakshi

9 REPLIES 9

balsarori
Champ on-the-rise
Champ on-the-rise
I would recommend that you read 6.3. Versioning of process definitions section of the user guide

http://activiti.org/userguide/index.html

ACT_RE_PROCDEF table contains the basic information of process definitions, the actual bpm file is stored in the ACT_GE_BYTEARRAY table. Process instances information are saved in ACT_HI_PROCINST table which contains a reference to the process definition (including the specific version) used.

meenakshi
Champ in-the-making
Champ in-the-making
Thanks for the answer!
So whenever server is restarted the bytecode taken from the database, parsed and loaded in to the memory?

balsarori
Champ on-the-rise
Champ on-the-rise
Only when needed. Whenever bytecode (xml of a process definition) is requested or needed it's fetched from the database, parsed and loaded into memory.

meenakshi
Champ in-the-making
Champ in-the-making
What does mean by whenever needed? Do you mean when taskService.complete() called that time also it happens? It takes the corresponding process, parse, load and then see which step to execute next?

balsarori
Champ on-the-rise
Champ on-the-rise
Means that not all process definitions are loaded to memory at once. Only when an operation that involves dealing with a process definition that isn't loaded it gets fetched from the database, parsed, and loaded to memory.

meenakshi
Champ in-the-making
Champ in-the-making
Operation means taskService.complete(taskId)   or something else?

jbarrez
Star Contributor
Star Contributor
Any operation that need a process definition. Complete task is but one example

meenakshi
Champ in-the-making
Champ in-the-making
Thanks!
So whenever I invoke the sub workflow through callActivity , that time sub workflow will be parsed and loaded into the memory, Is this not the performance hit?
And in multi jvm environment, how it works , if one JVM is already loaded one bpm in memory and second time , if it goes to second JVM, then even if it is second time operation and not loaded in second jvm it will again parse and load in memory?

trademak
Star Contributor
Star Contributor
It's only happening on the first occurrence, and the parsing is quite fast.
In a multi JVM environment, all engines will have their own process definition cache, so yes, every engine loads the process definition.

Best regards,