2.6.3. KIE container aliases
An alias for a KIE container (deployment unit) is a proxy in the KIE Server instance that helps in handling different versions of the same container deployment. You can link a single alias to different versions of a container. When a container is upgraded, the linked alias automatically points to the new version of the container. For information about creating a KIE container alias, see 「Creating a deployment unit in Business Central」.
For example, if a client application is changing every time a new version of a container is deployed, then the client application can point to the container alias. When a new container version is deployed, the associated alias is updated and all the requests are routed automatically to the new container without changing the client application.
Consider an example project that contains a single process and uses the following properties:
-
GroupId
: org.jbpm -
ArtifactId
: my-project -
Version
: 1.0 -
containerID
: my-project
When you update, build, and deploy the above project, the associated project is updated in the KIE Server with the latest version and contains the following properties:
-
GroupId
: org.jbpm -
ArtifactId
: my-project -
Version
: 2.0
If you want to deploy the latest version of the project, you need to update the containerID
as my-project2
because the my-project
container points to the old version.
Every project version contains a different containerID
name. The associated client applications need to be aware of all versions of the projects they interact with.
Container aliases also help you manage KIE containers. You can set the container aliases explicitly when creating a container, or implicitly based on the associated ArtifactId
name. You can add a single alias to multiple containers if required. If you do not specify a container alias, then the ArtifactId
of a project is set as the container alias by default.
When you set an alias for multiple containers that contain different GroupId
and ArtifactId
names, then you can use the same alias every time to interact with the KIE Server.
You typically use container aliases in the following use cases:
- Starting a new process instance on the client application with the latest version of the process
- Interacting with an existing process of a specific version
- Interacting with an existing task in a process
- Interacting with a process definition image and form
For example, after you deploy the 1.0 version of a project, you send a POST request to the following KIE Server REST API endpoint to start the process in the project:
/http://localhost:8230/kie-server/services/rest/server/containers/my-project/processes/evaluation/instances
The sent request starts a new process instance from org.jbpm:my-project:1.0
in which my-project
is defined as the container alias. Later, when you deploy the 2.0 version of the project and send the same request, a new instance starts from org.jbpm:my-project:2.0
. You can deploy the latest version of the process without adding the containerID
name.