-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from medizininformatik-initiative/refactor-req…
…uest-process Refactor request process to utilize process parallization of the camunda process engine
- Loading branch information
Showing
11 changed files
with
366 additions
and
350 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
...ormatik_initiative/feasibility_dsf_process/client/listener/SetCorrelationKeyListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package de.medizininformatik_initiative.feasibility_dsf_process.client.listener; | ||
|
||
import dev.dsf.bpe.v1.ProcessPluginApi; | ||
import dev.dsf.bpe.v1.constants.BpmnExecutionVariables; | ||
import dev.dsf.bpe.v1.variables.Target; | ||
import dev.dsf.bpe.v1.variables.Variables; | ||
import org.camunda.bpm.engine.delegate.DelegateExecution; | ||
import org.camunda.bpm.engine.delegate.ExecutionListener; | ||
import org.springframework.beans.factory.InitializingBean; | ||
|
||
import java.util.Objects; | ||
|
||
public class SetCorrelationKeyListener implements ExecutionListener, InitializingBean | ||
{ | ||
private final ProcessPluginApi api; | ||
|
||
public SetCorrelationKeyListener(ProcessPluginApi api) { | ||
this.api = api; | ||
} | ||
|
||
@Override | ||
public void afterPropertiesSet() throws Exception { | ||
Objects.requireNonNull(api, "api"); | ||
} | ||
|
||
@Override | ||
public void notify(DelegateExecution execution) throws Exception { | ||
Variables variables = api.getVariables(execution); | ||
Target target = variables.getTarget(); | ||
|
||
execution.setVariableLocal(BpmnExecutionVariables.CORRELATION_KEY, target.getCorrelationKey()); | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
.../java/de/medizininformatik_initiative/feasibility_dsf_process/message/SendDicRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package de.medizininformatik_initiative.feasibility_dsf_process.message; | ||
|
||
import dev.dsf.bpe.v1.ProcessPluginApi; | ||
import dev.dsf.bpe.v1.activity.AbstractTaskMessageSend; | ||
import dev.dsf.bpe.v1.variables.Variables; | ||
import org.camunda.bpm.engine.delegate.DelegateExecution; | ||
import org.hl7.fhir.r4.model.Reference; | ||
import org.hl7.fhir.r4.model.Task; | ||
import org.hl7.fhir.r4.model.Task.ParameterComponent; | ||
|
||
import java.util.stream.Stream; | ||
|
||
import static com.google.common.base.Preconditions.checkNotNull; | ||
import static de.medizininformatik_initiative.feasibility_dsf_process.variables.ConstantsFeasibility.CODESYSTEM_FEASIBILITY; | ||
import static de.medizininformatik_initiative.feasibility_dsf_process.variables.ConstantsFeasibility.CODESYSTEM_FEASIBILITY_VALUE_MEASURE_REFERENCE; | ||
|
||
public class SendDicRequest extends AbstractTaskMessageSend { | ||
|
||
public SendDicRequest(ProcessPluginApi api) { | ||
super(api); | ||
} | ||
|
||
@Override | ||
protected Stream<ParameterComponent> getAdditionalInputParameters(DelegateExecution execution, | ||
Variables variables) { | ||
return Stream.of(api.getTaskHelper().createInput( | ||
new Reference(checkNotNull(variables.getString("measure-id"), "variable 'measure-id' not set")), | ||
CODESYSTEM_FEASIBILITY, CODESYSTEM_FEASIBILITY_VALUE_MEASURE_REFERENCE)); | ||
} | ||
|
||
@Override | ||
protected void handleIntermediateThrowEventError(DelegateExecution execution, Variables variables, | ||
Exception exception, String errorMessage) { | ||
execution.setVariableLocal("sendError", true); | ||
} | ||
|
||
@Override | ||
protected void addErrorMessage(Task task, String errorMessage) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...va/de/medizininformatik_initiative/feasibility_dsf_process/service/LogReceiveTimeout.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package de.medizininformatik_initiative.feasibility_dsf_process.service; | ||
|
||
import dev.dsf.bpe.v1.ProcessPluginApi; | ||
import dev.dsf.bpe.v1.activity.AbstractServiceDelegate; | ||
import dev.dsf.bpe.v1.variables.Target; | ||
import dev.dsf.bpe.v1.variables.Variables; | ||
import org.camunda.bpm.engine.delegate.BpmnError; | ||
import org.camunda.bpm.engine.delegate.DelegateExecution; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class LogReceiveTimeout extends AbstractServiceDelegate { | ||
|
||
private static final Logger logger = LoggerFactory.getLogger(LogReceiveTimeout.class); | ||
|
||
public LogReceiveTimeout(ProcessPluginApi api) { | ||
super(api); | ||
} | ||
|
||
@Override | ||
protected void doExecute(DelegateExecution execution, Variables variables) throws BpmnError, Exception { | ||
Target target = variables.getTarget(); | ||
logger.warn("Timeout while waiting for result from {} (endpoint url: {}).", | ||
target.getOrganizationIdentifierValue(), | ||
target.getEndpointUrl()); | ||
} | ||
|
||
} |
146 changes: 0 additions & 146 deletions
146
...java/de/medizininformatik_initiative/feasibility_dsf_process/service/SendDicRequests.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.