<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Re: Can guvnor maintain multiple versions of a BPMN definition with same id?
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/swiderski.maciej">Maciej Swiderski</a> in <i>jBPM</i> - <a href="https://community.jboss.org/message/826993#826993">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><blockquote class="jive-quote"><p>mvermand wrote:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Hi,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>In jBPM4.4 you can deploy a jPDL with the same name multiple times. The different versions automatically get a different version number and processInstances will keep using the version that was current when the processInstance started.</p><p>You do not need to select specified Process Definitions upon engine startup. All is retrieved from the database as needed.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>In jBPM5.4 things seem to be different. If I am correct the Knowledge base needs to be filled at startup with all Process Definitions which are needed by any running process.</p><p>If I need multiple versions of the same Process Definition in the kBase to complete process instances started with a different version, it seems I cannot use the same id for the different "versions" of the "same" process definition.</p><p>Adding two process definitions with the same id&#160; but a different version number does not seem to work.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>1) Am I right so far?</p></blockquote><p>that is correct, you cannot have same process id for different process definitions within same kbase. If you try to do that one will override the other and the order of override will be same as the order of adding resources to knowledge base.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><blockquote class="jive-quote"><p>mvermand wrote:</p><p>If (1) == yes then </p><p>2) what it the use of the version number?</p></blockquote><p>you can still use version number as part of the runtime, so the scenario is:</p><ul><li style="text-align: start;">create process definition with id abc, name process1 and version 1</li><li style="text-align: start;">create process definition with id abcd, name process1, version 2</li></ul><p style="text-align: start;">with that you can have both versions running in the same kbase and ksession as the ids are unique. Then you can use some helper classes to start process by name that will take into account the version number and ensure that the latest version will be used. See <a class="jive-link-external-small" href="http://docs.jboss.org/jbpm/v5.4/javadocs/org/jbpm/process/instance/StartProcessHelper.html">this helper</a> class for details</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><blockquote class="jive-quote"><p>mvermand wrote:</p><p>3) will everything work if I change the ProcessDefinitions with as id the original processDefinition id concattenated with the version number?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></blockquote><p>it will work fine as long as you have them separated. Consider case that you model process version 1 deploy it to runtime start process of it and then you go and change the exact same process definition that will cause the situation where new process definition will be replaced. Most important piece of information is when you do new version of the process make a copy of the origin process def and work on the copy to produce new version, don't change the existing one as it will impact currently running instances of that process id.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><blockquote class="jive-quote"><p>mvermand wrote:</p><p>4) does Guvnor support automatic version management?: create BPMN with id a.b.c , start processInstance for this BPMN, change BPMN (keep id, but increment version), start second processInstance. ProcessInstance 1 will keep using version 1 of BPMN, ProcessInstance 2 will use the updated version of the BPMN</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></blockquote><p>see comment above. And in general, Guvnor is authoring tool based on JCR so it does support versioning of assets it maintains, but it's not the same versioning you have in mind. It keeps versions of the asset modifications, like history of what has changed and when, etc. It does not affect the runtime engine. To keep the isolation between running instances and version of the process make sure that you have process definition versions in separate files, that way all will work properly as it will be able to refer to the version it needs</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><blockquote class="jive-quote"><p>mvermand wrote:</p><p>If (4) == no then how does Guvnor handle changes to BPMN definitions? </p><p>Are you supposed to upgrade all running versions of a Process Definition?</p></blockquote><p>Again Guvnor does not deal with it, there is KnowledgeAgent that transfers the build packages to runtime environment as soon as they are ready to update the kbase in the runtime. With that all rules given above apply and might be that you would need to upgrade the process instance if that is the strategy you have chosen - for example you need to change given version of the process definition instead of creating new one.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>HTH</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/826993#826993">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>