Class CaseInstanceStartEventSubscriptionBuilderImpl
java.lang.Object
org.flowable.cmmn.engine.impl.runtime.CaseInstanceStartEventSubscriptionBuilderImpl
- All Implemented Interfaces:
CaseInstanceStartEventSubscriptionBuilder
public class CaseInstanceStartEventSubscriptionBuilderImpl
extends Object
implements CaseInstanceStartEventSubscriptionBuilder
A default implementation for the case start event subscription builder.
- Author:
- Micha Kiener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
protected final CmmnRuntimeServiceImpl
protected boolean
protected String
-
Constructor Summary
ConstructorsConstructorDescriptionCaseInstanceStartEventSubscriptionBuilderImpl
(CmmnRuntimeServiceImpl cmmnRuntimeService) -
Method Summary
Modifier and TypeMethodDescriptionaddCorrelationParameterValue
(String parameterName, Object parameterValue) Adds a specific correlation parameter value for the subscription, which means this value needs to exactly match the event payload in order to trigger the case start (along with all registered correlation parameter values of course).addCorrelationParameterValues
(Map<String, Object> parameters) Registers a list of correlation parameter values for the subscription.caseDefinitionKey
(String caseDefinitionKey) Set the case definition to be started using a manually added subscription by its key.protected void
Mark the subscription to not use the latest case definition automatically, should there be a new version deployed after the subscription was created.boolean
Creates the event subscription with the registered combination of correlation parameter values and saves it.Set the tenant id for the subscription.
-
Field Details
-
cmmnRuntimeService
-
caseDefinitionKey
-
tenantId
-
correlationParameterValues
-
doNotUpdateToLatestVersionAutomatically
protected boolean doNotUpdateToLatestVersionAutomatically
-
-
Constructor Details
-
CaseInstanceStartEventSubscriptionBuilderImpl
-
-
Method Details
-
caseDefinitionKey
Description copied from interface:CaseInstanceStartEventSubscriptionBuilder
Set the case definition to be started using a manually added subscription by its key. By default, always the latest version is used to start a new case instance, unless you useCaseInstanceStartEventSubscriptionBuilder.doNotUpdateToLatestVersionAutomatically()
to mark the builder to stick to exactly the current version of the case definition and don't update it, if a new version would be deployed later on. This method is mandatory and will throw an exception when trying to register a subscription where the case definition key was not set or is null.- Specified by:
caseDefinitionKey
in interfaceCaseInstanceStartEventSubscriptionBuilder
- Parameters:
caseDefinitionKey
- the key of the case definition to be started a new instance of when the subscription has a match at runtime- Returns:
- the builder to be used for method chaining
-
doNotUpdateToLatestVersionAutomatically
Description copied from interface:CaseInstanceStartEventSubscriptionBuilder
Mark the subscription to not use the latest case definition automatically, should there be a new version deployed after the subscription was created. This means, adding the subscription will always stick to the current version of the case definition, and it will NOT be updated automatically should there be a new version deployed later on. By default, when this method is not invoked on the builder, the subscription will be updated automatically to the latest version when a new version of the case definition is deployed. The subscription can still be updated to the latest version by manually migrating it to whatever version you want.- Specified by:
doNotUpdateToLatestVersionAutomatically
in interfaceCaseInstanceStartEventSubscriptionBuilder
- Returns:
- the builder to be used for method chaining
-
addCorrelationParameterValue
public CaseInstanceStartEventSubscriptionBuilder addCorrelationParameterValue(String parameterName, Object parameterValue) Description copied from interface:CaseInstanceStartEventSubscriptionBuilder
Adds a specific correlation parameter value for the subscription, which means this value needs to exactly match the event payload in order to trigger the case start (along with all registered correlation parameter values of course).- Specified by:
addCorrelationParameterValue
in interfaceCaseInstanceStartEventSubscriptionBuilder
- Parameters:
parameterName
- the name of the correlation parameterparameterValue
- the value of the correlation parameter- Returns:
- the builder to be used for method chaining
-
addCorrelationParameterValues
public CaseInstanceStartEventSubscriptionBuilder addCorrelationParameterValues(Map<String, Object> parameters) Description copied from interface:CaseInstanceStartEventSubscriptionBuilder
Registers a list of correlation parameter values for the subscription. The result is the same as registering them one after the other.- Specified by:
addCorrelationParameterValues
in interfaceCaseInstanceStartEventSubscriptionBuilder
- Parameters:
parameters
- the map of correlation parameter values to be registered for the subscription- Returns:
- the builder to be used for method chaining
-
tenantId
Description copied from interface:CaseInstanceStartEventSubscriptionBuilder
Set the tenant id for the subscription.- Specified by:
tenantId
in interfaceCaseInstanceStartEventSubscriptionBuilder
- Parameters:
tenantId
- the id of the tenant- Returns:
- the builder to be used for method chaining
-
getCaseDefinitionKey
-
getCorrelationParameterValues
-
isDoNotUpdateToLatestVersionAutomatically
public boolean isDoNotUpdateToLatestVersionAutomatically() -
getTenantId
-
subscribe
Description copied from interface:CaseInstanceStartEventSubscriptionBuilder
Creates the event subscription with the registered combination of correlation parameter values and saves it.- Specified by:
subscribe
in interfaceCaseInstanceStartEventSubscriptionBuilder
-
checkValidInformation
protected void checkValidInformation()
-