Executing the last semantic version

When the last semantic version of a decision service is requested to be executed, the decision service with a specified decision service identifier and the latest deployment version in semantic versioning order is selected.

Semantic versioning for decision services

Semantic versioning is a versioning format that is used in a number of open source projects. This format is a formal convention to determine the version number of a new software release and the severity of changes in each new release. For more information about the semantic versioning, see https://semver.org/ External link opens a new window or tab.

You can use the semantic versioning format to version decision services for the decision runtime. You specify versions for your decision services before they are deployed. For more information, see Creating versions.

See the semantic versioning format:
[major].[minor].[patch]-[pre-release]+[build metadata]
The decision runtime supports only a subset of the semantic versioning format, and does not support the build metadata:
Table 1. Supported semantic versioning format in the decision runtime
Version Supported in decision runtime Mandatory or optional Supported type Description
Major Yes Mandatory

Number

It indicates that you make incompatible API changes.

Minor Yes Mandatory

Number

It indicates that you make changes that are compatible with an earlier version.

Patch Yes Mandatory

Number

It indicates that you make bug fixes compatible with an earlier version.

Pre-release Yes Optional

String

If you try to deploy a decision service with a per-release value that is numerical and not a string, you have an HTTP Bad Request return code, and the decision service cannot be deployed.

It indicates the state of a release.

For example, you can set a string rc.2 as your second release candidate. The decision runtime supports only the string format for the pre-release version.

A semantic version with a release value is sorted after a version that does not have a pre-release version. For example, version 2.0.1 is greater than version 2.0.1-rc.2.

Build metadata No - -

If your decision service has a version with build metadata, the information about the build metadata is not taken into account. The decision service is deployed without any error or warning.

The semantic versioning allows you to keep track of changes and evolutions of your decision services; therefore, you can create several releases of a decision services.

When you try to deploy a decision service that does not have a version in semantic versioning format, the decision service is deployed but a warning is returned after its deployment.

When you use the decision runtime REST API for executing a decision service that contains any version in nonsemantic versioning format, a warning is returned for the first nonsemantic version of this decision service.

Using the semantic versioning for execution

The latest deployment version is determined based on the value in the metadata decisionServiceVersion.

For more information about the endpoint to execute the last semantic version of a decision service, see the Last semantic version execution section in the Decision runtime REST API reference in Reference.

The semantic versioning selector selects the latest semantic version of a specific deployment service for the REST API requests. The major, minor, and patch numbers are compared numerically.

For example:
  • Version 2.2.1 is greater than version 2.2.0
  • Version 2.3.0 is greater than version 2.2.1
  • Version 3.0.0 is greater than version 2.3.0

You can also indicate the major and minor numbers to select a specific version of a decision service in the REST API operations.

For example, if you have the same decision service that is deployed with five different versions: 4.0.0, 3.0.0, 2.2.1, 2.2.0, and 2.1.0:
  • If you set the major number to 2 and the minor number to 2, then the semantic versioning selector selects version 2.2.1.
  • If you set only the major number to 3, version 3.0.0 is selected for the decision service.
  • If you set neither the major nor the minor numbers, the last semantic version is selected, which is version 4.0.0.
Important: For more information, see also the Executing the most recently deployed, latest semantic, or last sorted version section in Selecting decision services for execution.