Skip to content

Commit 6663964

Browse files
committed
improved javadoc, overridden default execute in MessageSendTask
Added throws ErrorBoundaryEvent to default execute method of MessageSendTask to document that custom error handling flows can be implemented in BPMN by throwing ErrorBoundaryEvent
1 parent d35e8c1 commit 6663964

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

dsf-bpe/dsf-bpe-process-api-v2/src/main/java/dev/dsf/bpe/v2/activity/MessageSendTask.java

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,43 @@
11
package dev.dsf.bpe.v2.activity;
22

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;
310
import dev.dsf.bpe.v2.error.MessageSendTaskErrorHandler;
411
import dev.dsf.bpe.v2.error.impl.DefaultMessageSendTaskErrorHandler;
12+
import dev.dsf.bpe.v2.variables.Variables;
513

614
public interface MessageSendTask extends MessageActivity
715
{
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+
841
@Override
942
default MessageSendTaskErrorHandler getErrorHandler()
1043
{

dsf-bpe/dsf-bpe-process-api-v2/src/main/java/dev/dsf/bpe/v2/activity/ServiceTask.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dev.dsf.bpe.v2.activity;
22

3+
import org.hl7.fhir.r4.model.Task;
4+
35
import dev.dsf.bpe.v2.ProcessPluginApi;
46
import dev.dsf.bpe.v2.error.ErrorBoundaryEvent;
57
import dev.dsf.bpe.v2.error.ServiceTaskErrorHandler;
@@ -8,6 +10,17 @@
810

911
public interface ServiceTask extends Activity
1012
{
13+
/**
14+
* @param api
15+
* not <code>null</code>
16+
* @param variables
17+
* not <code>null</code>
18+
* @throws ErrorBoundaryEvent
19+
* to trigger custom error handling flow in BPMN, when using {@link DefaultServiceTaskErrorHandler}
20+
* @throws Exception
21+
* to fail the FHIR {@link Task} and stop the process instance, when using
22+
* {@link DefaultServiceTaskErrorHandler}
23+
*/
1124
void execute(ProcessPluginApi api, Variables variables) throws ErrorBoundaryEvent, Exception;
1225

1326
@Override

0 commit comments

Comments
 (0)