|
1 | 1 | package dev.dsf.bpe.v2.activity;
|
2 | 2 |
|
| 3 | +import org.hl7.fhir.r4.model.Task; |
| 4 | + |
| 5 | +import dev.dsf.bpe.v2.ProcessPluginApi; |
| 6 | +import dev.dsf.bpe.v2.activity.task.BusinessKeyStrategy; |
| 7 | +import dev.dsf.bpe.v2.activity.task.TaskSender; |
| 8 | +import dev.dsf.bpe.v2.activity.values.SendTaskValues; |
| 9 | +import dev.dsf.bpe.v2.error.ErrorBoundaryEvent; |
3 | 10 | import dev.dsf.bpe.v2.error.MessageSendTaskErrorHandler;
|
4 | 11 | import dev.dsf.bpe.v2.error.impl.DefaultMessageSendTaskErrorHandler;
|
| 12 | +import dev.dsf.bpe.v2.variables.Variables; |
5 | 13 |
|
6 | 14 | public interface MessageSendTask extends MessageActivity
|
7 | 15 | {
|
| 16 | + /** |
| 17 | + * Default implementation uses a {@link TaskSender} from |
| 18 | + * {@link #getTaskSender(ProcessPluginApi, Variables, SendTaskValues)} to send {@link Task} resources with the |
| 19 | + * {@link BusinessKeyStrategy} from {@link #getBusinessKeyStrategy()}. No {@link ErrorBoundaryEvent} are thrown by |
| 20 | + * the default implementation. |
| 21 | + * |
| 22 | + * @param api |
| 23 | + * not <code>null</code> |
| 24 | + * @param variables |
| 25 | + * not <code>null</code> |
| 26 | + * @param sendTaskValues |
| 27 | + * not <code>null</code> |
| 28 | + * @throws ErrorBoundaryEvent |
| 29 | + * to trigger custom error handling flow in BPMN, when using {@link DefaultMessageSendTaskErrorHandler} |
| 30 | + * @throws Exception |
| 31 | + * to fail the FHIR {@link Task} and stop the process instance, when using |
| 32 | + * {@link DefaultMessageSendTaskErrorHandler} |
| 33 | + */ |
| 34 | + @Override |
| 35 | + default void execute(ProcessPluginApi api, Variables variables, SendTaskValues sendTaskValues) |
| 36 | + throws ErrorBoundaryEvent, Exception |
| 37 | + { |
| 38 | + getTaskSender(api, variables, sendTaskValues).send(); |
| 39 | + } |
| 40 | + |
8 | 41 | @Override
|
9 | 42 | default MessageSendTaskErrorHandler getErrorHandler()
|
10 | 43 | {
|
|
0 commit comments