Target and Targets
Target
A target is a container for all information necessary to send messages to other DSF instances. This information includes:
- Organization Identifier: Identifier of an Organization Resource. It can be acquired through the API's
OrganizationProvideror by querying a FHIR server. Querying the DSF FHIR server should be done using theDsfClientprovided by the API'sDsfClientProviderwhile aFhirClientprovided by the API'sFhirClientProvidermay be used for other types of FHIR servers. - Endpoint Identifier: Identifier of an Endpoint Resource with the
managingOrganizationbeing the same organization as the one from theOrganization Identifierabove. It can be acquired through the API'sOrganizationProvideror by querying a FHIR server. Querying the DSF FHIR server should be done using theDsfClientprovided by the API'sDsfClientProviderwhile aFhirClientprovided by the API'sFhirClientProvidermay be used for other types of FHIR servers. - Endpoint URL: The URL of the endpoint. The Endpoint Resource provides this value through its
addressfield. - Correlation Key: Optional value used to correlate messages, that are sent to this target, to their correct process instances. More information on this mechanism can be found in Message Correlation.
Targets
Targets is a container class for a collection of Target objects. It also provides utility methods for manipulating the underlying collection.
Creating Target/Targets
Creating Target instances requires the target's organization identifier, endpoint identifier, and endpoint address. These values can be obtained from the DSF FHIR server's web interface or by querying the FHIR server via an instance of DsfClient or a generic FHIR client. By clicking the Show Bookmarks button in the top right corner and selecting Endpoint, a list of all Endpoints available to the FHIR server will be displayed. Instances of DsfClient or a generic FHIR client can be accessed via the process plugin API.
Targets can be created by using the Variables' createTarget method or by using Process Plugin API's TargetProvider instance. The methods provided by Variables allow creating specific Target instances and Targets instances based on collections of Target instances. For cases where for example, all member organizations of a particular parent organization should be targeted, the Process Plugin API's TargetProvider instance offers various different utility methods.
Setting Target/Targets
Targets should be set in a Service Task before a Message Activity.
Targets should be set either through the Variables' setTarget or setTargets methods. When modelling parallel subprocesses where each execution sends messages to its own target, the Target can be set automatically for each execution by using ${targets.entries} as the Collection value for the parallel subprocess and target as the Element variable value in the Camunda Modeler. This requires having called setTargets before entering the parallel subprocess.