J'ai un comportement étrange qui se passe.Jbpm ProcessDefinition a toujours la version -1
J'utilise Seam et JBPM. Quand je dis:
ProcessDefinition templateDefinition = Jbpm.instance().getProcessDefinitionFromResource(ap.getJpdl());
//This will return Enkeltanledning.jpdl.xml
templateDefinition.getVersion();
Il retourne toujours -1. Cependant, quand je choisis de la base de données, j'obtenir la version 2.
mysql> select * from JBPM_PROCESSDEFINITION; +-----+--------+-----------------------------+--------------+----------+------------------------+-------------+ | ID_ | CLASS_ | NAME_ | DESCRIPTION_ | VERSION_ | ISTERMINATIONIMPLICIT_ | STARTSTATE_ | +-----+--------+-----------------------------+--------------+----------+------------------------+-------------+ | 1 | P | Enkeltanledning | NULL | 1 | | 1 | | 2 | P | Enkeltanledning | NULL | 2 | | 31 |
Maintenant, j'ai trouvé ce lien: jpdl Et il dit:
Unnamed process definitions will always have version number -1.
Cependant, j'ai mes définitions de processus ne sont pas sans nom, et quand je déboguer templateDefinition je reçois le nom correct Enkeltanledning, donc je sais que c'est le bon fichier jpdl qui a été chargé. Donc, ma question est, pourquoi mon code retourne-t-il toujours -1 en version? La raison pour laquelle j'ai besoin de la version correcte est parce que je fais des vérifications pour voir si j'ai la bonne version, sinon je redéploierai le ProcessDefinition, et comme je reçois toujours -1, il sera toujours redéployé.