Package org.flowable.engine.impl.runtime
Class ProcessInstanceStartEventSubscriptionBuilderImpl
java.lang.Object
org.flowable.engine.impl.runtime.ProcessInstanceStartEventSubscriptionBuilderImpl
- All Implemented Interfaces:
ProcessInstanceStartEventSubscriptionBuilder
public class ProcessInstanceStartEventSubscriptionBuilderImpl
extends Object
implements ProcessInstanceStartEventSubscriptionBuilder
A default implementation for the process start event subscription builder.
- Author:
- Micha Kiener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
protected String
protected final RuntimeServiceImpl
protected String
-
Constructor Summary
ConstructorsConstructorDescriptionProcessInstanceStartEventSubscriptionBuilderImpl
(RuntimeServiceImpl runtimeService) -
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 process 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.protected void
Mark the subscription to not use the latest process definition automatically, should there be a new version deployed after the subscription was created.boolean
processDefinitionKey
(String processDefinitionKey) Set the process definition to be started using a manually added subscription by its key.Creates the event subscription with the registered combination of correlation parameter values and saves it.Set the tenant id for the subscription.
-
Field Details
-
runtimeService
-
processDefinitionKey
-
tenantId
-
correlationParameterValues
-
doNotUpdateToLatestVersionAutomatically
protected boolean doNotUpdateToLatestVersionAutomatically
-
-
Constructor Details
-
ProcessInstanceStartEventSubscriptionBuilderImpl
-
-
Method Details
-
processDefinitionKey
public ProcessInstanceStartEventSubscriptionBuilder processDefinitionKey(String processDefinitionKey) Description copied from interface:ProcessInstanceStartEventSubscriptionBuilder
Set the process definition to be started using a manually added subscription by its key. By default, always the latest version is used to start a new process instance, unless you useProcessInstanceStartEventSubscriptionBuilder.doNotUpdateToLatestVersionAutomatically()
to mark the builder to stick to exactly the current version of the process 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 process definition key was not set or is null.- Specified by:
processDefinitionKey
in interfaceProcessInstanceStartEventSubscriptionBuilder
- Parameters:
processDefinitionKey
- the key of the process 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:ProcessInstanceStartEventSubscriptionBuilder
Mark the subscription to not use the latest process 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 process 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 process 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 interfaceProcessInstanceStartEventSubscriptionBuilder
- Returns:
- the builder to be used for method chaining
-
addCorrelationParameterValue
public ProcessInstanceStartEventSubscriptionBuilder addCorrelationParameterValue(String parameterName, Object parameterValue) Description copied from interface:ProcessInstanceStartEventSubscriptionBuilder
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 process start (along with all registered correlation parameter values of course).- Specified by:
addCorrelationParameterValue
in interfaceProcessInstanceStartEventSubscriptionBuilder
- 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 ProcessInstanceStartEventSubscriptionBuilder addCorrelationParameterValues(Map<String, Object> parameters) Description copied from interface:ProcessInstanceStartEventSubscriptionBuilder
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 interfaceProcessInstanceStartEventSubscriptionBuilder
- 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:ProcessInstanceStartEventSubscriptionBuilder
Set the tenant id for the subscription.- Specified by:
tenantId
in interfaceProcessInstanceStartEventSubscriptionBuilder
- Parameters:
tenantId
- the id of the tenant- Returns:
- the builder to be used for method chaining
-
getProcessDefinitionKey
-
getCorrelationParameterValues
-
isDoNotUpdateToLatestVersionAutomatically
public boolean isDoNotUpdateToLatestVersionAutomatically() -
getTenantId
-
subscribe
Description copied from interface:ProcessInstanceStartEventSubscriptionBuilder
Creates the event subscription with the registered combination of correlation parameter values and saves it.- Specified by:
subscribe
in interfaceProcessInstanceStartEventSubscriptionBuilder
-
checkValidInformation
protected void checkValidInformation()
-