8
8
import org .hl7 .fhir .r4 .model .Organization ;
9
9
import org .hl7 .fhir .r4 .model .OrganizationAffiliation ;
10
10
11
+ import dev .dsf .bpe .v2 .constants .BpmnExecutionVariables ;
11
12
import dev .dsf .bpe .v2 .constants .CodeSystems .OrganizationRole ;
12
13
import dev .dsf .bpe .v2 .constants .NamingSystems .OrganizationIdentifier ;
14
+ import dev .dsf .bpe .v2 .variables .Target ;
13
15
import dev .dsf .bpe .v2 .variables .Targets ;
14
16
15
17
public interface TargetProvider
@@ -31,8 +33,31 @@ interface Predicate
31
33
boolean test (OrganizationAffiliation affiliation , Organization member , Endpoint endpoint );
32
34
}
33
35
36
+ /**
37
+ * <i>A <b>correlationKey</b> should be used if return messages i.e. Task resources from multiple organizations
38
+ * with the same message-name are expected in a following multi instance message receive task or intermediate
39
+ * message catch event in a multi instance subprocess.<br>
40
+ * Note: The correlationKey needs to be set as a {@link BpmnExecutionVariables#CORRELATION_KEY} variable in the
41
+ * message receive task or intermediate message catch event of a subprocess before incoming messages i.e. Task
42
+ * resources can be correlated. Within a BPMN file this can be accomplished by setting an input variable with
43
+ * name: {@link BpmnExecutionVariables#CORRELATION_KEY}, type:</i> <code>string or expression</code><i>, and
44
+ * value: </i><code>${target.correlationKey}</code>.
45
+ * <p>
46
+ * <i>A <b>correlationKey</b> should also be used when sending a message i.e. Task resource back to an
47
+ * organization waiting for multiple returns.</i>
48
+ *
49
+ * @return {@link Targets} including correlation keys
50
+ * @see Target#getCorrelationKey()
51
+ */
34
52
Targets withCorrelationKey ();
35
53
54
+ /**
55
+ * <i>{@link Targets} without correlation key can be used when sending out multiple messages without expecting
56
+ * replies.</i>
57
+ *
58
+ * @return {@link Targets} without correlation keys
59
+ * @see Target#getCorrelationKey()
60
+ */
36
61
Targets withoutCorrelationKey ();
37
62
38
63
/**
@@ -46,16 +71,40 @@ interface Predicate
46
71
Builder filter (Predicate predicate );
47
72
}
48
73
74
+ /**
75
+ * @param parentOrganizationIdentifier
76
+ * not <code>null</code>
77
+ * @return {@link Targets} builder for all active members of the given parent organization
78
+ */
49
79
Builder create (Identifier parentOrganizationIdentifier );
50
80
81
+ /**
82
+ * @param parentOrganizationIdentifierValue
83
+ * not <code>null</code>
84
+ * @return {@link Targets} builder for all active members of the given parent organization
85
+ */
51
86
default Builder create (String parentOrganizationIdentifierValue )
52
87
{
53
88
return create (parentOrganizationIdentifierValue == null ? null
54
89
: OrganizationIdentifier .withValue (parentOrganizationIdentifierValue ));
55
90
}
56
91
92
+ /**
93
+ * @param parentOrganizationIdentifier
94
+ * not <code>null</code>
95
+ * @param memberOrganizationRole
96
+ * not <code>null</code>
97
+ * @return {@link Targets} builder for all active members of the given parent organization with the given role
98
+ */
57
99
Builder create (Identifier parentOrganizationIdentifier , Coding memberOrganizationRole );
58
100
101
+ /**
102
+ * @param parentOrganizationIdentifierValue
103
+ * not <code>null</code>
104
+ * @param memberOrganizationRoleCode
105
+ * not <code>null</code>
106
+ * @return {@link Targets} builder for all active members of the given parent organization with the given role
107
+ */
59
108
default Builder create (String parentOrganizationIdentifierValue , String memberOrganizationRoleCode )
60
109
{
61
110
return create (
@@ -64,9 +113,29 @@ default Builder create(String parentOrganizationIdentifierValue, String memberOr
64
113
memberOrganizationRoleCode == null ? null : OrganizationRole .withCode (memberOrganizationRoleCode ));
65
114
}
66
115
116
+ /**
117
+ * @param parentOrganizationIdentifier
118
+ * not <code>null</code>
119
+ * @param memberOrganizationRole
120
+ * not <code>null</code>
121
+ * @param memberOrganizationIdentifier
122
+ * not <code>null</code>, array <code>null</code> values will be ignored
123
+ * @return {@link Targets} builder for all active members of the given parent organization with the given role,
124
+ * filtered by the given member organization
125
+ */
67
126
Builder create (Identifier parentOrganizationIdentifier , Coding memberOrganizationRole ,
68
127
Identifier ... memberOrganizationIdentifier );
69
128
129
+ /**
130
+ * @param parentOrganizationIdentifierValue
131
+ * not <code>null</code>
132
+ * @param memberOrganizationRoleCode
133
+ * not <code>null</code>
134
+ * @param memberOrganizationIdentifierValue
135
+ * not <code>null</code>, array <code>null</code> values will be ignored
136
+ * @return {@link Targets} builder for all active members of the given parent organization with the given role,
137
+ * filtered by the given member organization
138
+ */
70
139
default Builder create (String parentOrganizationIdentifierValue , String memberOrganizationRoleCode ,
71
140
String ... memberOrganizationIdentifierValue )
72
141
{
0 commit comments