Petals-SE-Flowable 1.4.0+

compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (9)

View Page History
h1. Using the mode "service"

h2. About deployment/undeployment and versioning

h3. Deployment

A service unit embeds process definition(s). So when deploying a service unit, its process definition(s) are automatically deployed, and the associated consumer services are registered. unit:
* its process definition(s) are automatically deployed,
* and the associated services providers are registered.

A process definition can be undeployed only when no more process instance is in progress and when no more historic process instance exists. That's why process definition are not undeployed when undeploying a service unit. You can undeploy a process instance using the administrative JMX operation '{{undeployProcessDefinition}}'.
When you redeploy a service unit, the embedded process definition(s) will not be redeployed because the process definition is already deployed for the given version of the process definition. In this way, we can push some changes outside process definition as service consumer parameters (timeout, ...). If some changes are needed into process definition(s), it is needed to increment the associated BPMN version.

Next, if you redeploy the service unit, the embedded process definition(s) will not be redeployed because the process definition is already deployed for the given version. In this way, we can push some changes outside process definition as service consumer parameters (timeout, ...). If some changes are needed into process definition(s), it is needed to increment the association version.

According to changes into your process definition, it can be required to create new version of your associated service providers:
* if your changes concern all BPMN object except service task, you can undeploy your service unit and next you can deploy new version of your service unit including the new version of your process definition. Process instances started before the deployment continue to work fine because all service consumers can be resolved against your new service unit (service consumers are the same),
* if your changes include changes about service tasks, it will be needed to create new version of your service providers. All process instances in progress require to keep deployed your initial service unit to correctly invoke services. Your new process definition will be deployed with its own service unit. So we will have two service units deployed concurrently, so:
** names of service provider associated to service unit must be different,
** and service unit names must be different to be abler to deploy them on the same Petals ESB containe.

{note}When a Petals ESB node restarts, all service units previously deployed are redeployed. As process definition versions are the same no redeployment of process definitions occurs.{note}

h3. Undeployment

A version of a process definition can be undeployed only if no more associated process instance exists, in progress or ended. If process instances exist, they must be purged before process definition undeployment.
A process definition can be undeployed only when no more process instance is in progress and when no more historic process instance exists. That's why process definition are not undeployed when undeploying a service unit. You can undeploy a process instance using the administrative JMX operation '{{undeployProcessDefinition}}' after to have purged associated process instances.

Several administrative JMX operations can help you:
| {{undeployProcessDefinition}} | Undeploy a process definition. |

h3. Versioning

Process definition must be deployed as long as an associated process instance is in progress, and/or historic process instances exist. So, once a Flowable service unit has been deployed you must think to its potential changes to be able:
* to continue to execute process instances in progress,
* to continue to access process instance historics,
* to deploy minor changes: minor changes of process definition and/or minor changes of the JBI part. A change is considered as minor when the service provider interfaces are not changed,
* to deploy major changes: major changes of the service providers and process definition. A change is considered as major when a service provider interface is changed.

To apply minor changes, you will replace the deployed service unit. So you will undeploy the service unit before to deploy the new version.

To apply major changes, as the service provider interfaces change, you will need to deploy concurrently the new version. So you need only to deploy the new version.

When deploying a process definition, Flowable requires a 'process defintion resource home' from which some resources can be resolved relatively to the BPMN file of the pocess definition, for exemple WSDLs of the service providers invoked through service tasks. This 'process defintion resource home' is set as an URI containing the service unit name and the BPMN file name.
So when deploying a new minor version of a service unit, the new service unit *MUST* have the same service name than the previous one to be able to continue to execute process instances created with the previous version.
For a new major version, you can set a new service unit name because no process instance is already in progress.

Usually, the service unit name is set by the Maven Petals plugin bulding the service assembly. By default, the service unit name is defined as '<artifact-id>-<version>'. With this template, the service unit name will change for any version. So you *MUST* configure the template to have a different value for each major version. For example, you can use the following template '<artifact-id>-<version.major>.<version.minor>' for a version naming convention defined as '<major>.<minor>.<increment>'.

h2. Creating a service-unit for a process definition