Class AbstractTaskMessageSend
- All Implemented Interfaces:
org.camunda.bpm.engine.delegate.JavaDelegate
,org.springframework.beans.factory.InitializingBean
- instantiatesCanonical with the URL (including version) of the Activity to start or continue.
- messageName with the with the BPMN message-name of the start event, intermediate message catch event or message receive task.
- profile with the URL (including version) of the profile (StructureDefinition) that the Task resource used should conform to.
Configure BPMN message send tasks, intermediate message throw events and message end event with an implementation of type 'Java class' with the fully qualified class name of the class extending this abstract implementation.
Configure your service task implementation as a Bean
in your spring Configuration
class with scope
"prototype"
.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addErrorMessage
(org.hl7.fhir.r4.model.Task task, String errorMessage) void
protected final String
createAndSaveAlternativeBusinessKey
(org.camunda.bpm.engine.delegate.DelegateExecution execution, Variables variables) Generates an alternative business-key and stores it as a process variable with nameBpmnExecutionVariables.ALTERNATIVE_BUSINESS_KEY
protected void
protected org.hl7.fhir.r4.model.IdType
doSend
(FhirWebserviceClient client, org.hl7.fhir.r4.model.Task task) Override this method to modify the remote task create behavior, e.g. to implement retriesfinal void
execute
(org.camunda.bpm.engine.delegate.DelegateExecution execution) protected Stream
<org.hl7.fhir.r4.model.Task.ParameterComponent> getAdditionalInputParameters
(org.camunda.bpm.engine.delegate.DelegateExecution execution, Variables variables) Override this method to add additional input parameters to the task resource being send.protected String
getInstantiatesCanonical
(org.camunda.bpm.engine.delegate.DelegateExecution execution, Variables variables) Retrieves the instantiatesCanonical value used for Task resources send by this class via the injected field instantiatesCanonical.protected String
getMessageName
(org.camunda.bpm.engine.delegate.DelegateExecution execution, Variables variables) Retrieves the messageName value used for Task resources send by this class via the injected field messageName.protected String
getProfile
(org.camunda.bpm.engine.delegate.DelegateExecution execution, Variables variables) Retrieves the profile value used for Task resources send by this class via the injected field profile.protected org.hl7.fhir.r4.model.Reference
getRecipient
(Target target) protected org.hl7.fhir.r4.model.Reference
protected void
handleEndEventError
(org.camunda.bpm.engine.delegate.DelegateExecution execution, Variables variables, Exception exception, String errorMessage) protected void
handleIntermediateThrowEventError
(org.camunda.bpm.engine.delegate.DelegateExecution execution, Variables variables, Exception exception, String errorMessage) protected void
handleSendTaskError
(org.camunda.bpm.engine.delegate.DelegateExecution execution, Variables variables, Exception exception, String errorMessage) protected void
sendTask
(org.camunda.bpm.engine.delegate.DelegateExecution execution, Variables variables, Target target, String instantiatesCanonical, String messageName, String businessKey, String profile, Stream<org.hl7.fhir.r4.model.Task.ParameterComponent> additionalInputParameters) final void
setInstantiatesCanonical
(org.camunda.bpm.engine.impl.el.FixedValue instantiatesCanonical) Deprecated.only for process engine field injectionfinal void
setMessageName
(org.camunda.bpm.engine.impl.el.FixedValue messageName) Deprecated.only for process engine field injectionfinal void
setProfile
(org.camunda.bpm.engine.impl.el.FixedValue profile) Deprecated.only for process engine field injection
-
Field Details
-
api
-
-
Constructor Details
-
AbstractTaskMessageSend
- Parameters:
api
- notnull
-
-
Method Details
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
setInstantiatesCanonical
@Deprecated public final void setInstantiatesCanonical(org.camunda.bpm.engine.impl.el.FixedValue instantiatesCanonical) Deprecated.only for process engine field injection- Parameters:
instantiatesCanonical
- notnull
-
getInstantiatesCanonical
protected String getInstantiatesCanonical(org.camunda.bpm.engine.delegate.DelegateExecution execution, Variables variables) Retrieves the instantiatesCanonical value used for Task resources send by this class via the injected field instantiatesCanonical.Override this method to use a different mechanism for retrieving the value for instantiatesCanonical. For example via a process variable. Note: A non empty value e.g 'disable' still needs to be injected in the BPMN file in order to comply with the validation performed during plugin loading.
- Parameters:
execution
- notnull
variables
- notnull
- Returns:
- instantiatesCanonical value used for Task resources send by this class
-
setMessageName
Deprecated.only for process engine field injection- Parameters:
messageName
- notnull
-
getMessageName
protected String getMessageName(org.camunda.bpm.engine.delegate.DelegateExecution execution, Variables variables) Retrieves the messageName value used for Task resources send by this class via the injected field messageName.Override this method to use a different mechanism for retrieving the value for messageName. For example via a process variable. Note: A non empty value e.g 'disable' still needs to be injected in the BPMN file in order to comply with the validation performed during plugin loading.
- Parameters:
execution
- notnull
variables
- notnull
- Returns:
- messageName value used for Task resources send by this class
-
setProfile
Deprecated.only for process engine field injection- Parameters:
profile
- notnull
-
getProfile
protected String getProfile(org.camunda.bpm.engine.delegate.DelegateExecution execution, Variables variables) Retrieves the profile value used for Task resources send by this class via the injected field profile.Override this method to use a different mechanism for retrieving the value for profile. For example via a process variable. Note: A non empty value e.g 'disable' still needs to be injected in the BPMN file in order to comply with the validation performed during plugin loading.
- Parameters:
execution
- notnull
variables
- notnull
- Returns:
- profile value used for Task resources send by this class
-
execute
public final void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception - Specified by:
execute
in interfaceorg.camunda.bpm.engine.delegate.JavaDelegate
- Throws:
Exception
-
doExecute
protected void doExecute(org.camunda.bpm.engine.delegate.DelegateExecution execution, Variables variables) throws Exception - Throws:
Exception
-
handleIntermediateThrowEventError
-
handleEndEventError
-
handleSendTaskError
-
addErrorMessage
-
getAdditionalInputParameters
protected Stream<org.hl7.fhir.r4.model.Task.ParameterComponent> getAdditionalInputParameters(org.camunda.bpm.engine.delegate.DelegateExecution execution, Variables variables) Override this method to add additional input parameters to the task resource being send.- Parameters:
execution
- the delegate execution of this process instance- Returns:
Stream
ofTask.ParameterComponent
s to be added as input parameters
-
createAndSaveAlternativeBusinessKey
protected final String createAndSaveAlternativeBusinessKey(org.camunda.bpm.engine.delegate.DelegateExecution execution, Variables variables) Generates an alternative business-key and stores it as a process variable with nameBpmnExecutionVariables.ALTERNATIVE_BUSINESS_KEY
Use this method in combination with overriding
sendTask(DelegateExecution, Variables, Target, String, String, String, String, Stream)
to use an alternative business-key with the communication target.@Override protected void sendTasksendTask(DelegateExecution execution, Variables variables, Target target, String instantiatesCanonical, String messageName, String businessKey, String profile, Stream<ParameterComponent> additionalInputParameters) { String alternativeBusinesKey = createAndSaveAlternativeBusinessKey(); super.sendTask(execution, target, instantiatesUri, messageName, alternativeBusinesKey, profile, additionalInputParameters); }
Return tasks from the target using the alternative business-key will correlate with this process instance.- Parameters:
execution
- notnull
- Returns:
- the alternative business-key stored as variable
BpmnExecutionVariables.ALTERNATIVE_BUSINESS_KEY
- See Also:
-
sendTask
protected void sendTask(org.camunda.bpm.engine.delegate.DelegateExecution execution, Variables variables, Target target, String instantiatesCanonical, String messageName, String businessKey, String profile, Stream<org.hl7.fhir.r4.model.Task.ParameterComponent> additionalInputParameters) - Parameters:
execution
- notnull
variables
- notnull
target
- notnull
instantiatesCanonical
- notnull
, not emptymessageName
- notnull
, not emptybusinessKey
- notnull
, not emptyprofile
- notnull
, not emptyadditionalInputParameters
- may benull
-
doSend
protected org.hl7.fhir.r4.model.IdType doSend(FhirWebserviceClient client, org.hl7.fhir.r4.model.Task task) Override this method to modify the remote task create behavior, e.g. to implement retries@Override protected void doSend(FhirWebserviceClient client, Task task) { client.withMinimalReturn().withRetry(2).create(task); }
- Parameters:
client
- notnull
task
- notnull
- Returns:
- id of created task
-
getRecipient
-
getRequester
protected org.hl7.fhir.r4.model.Reference getRequester()
-