1
1
package org .highmed .dsf .bpe .service ;
2
2
3
3
import static org .highmed .dsf .bpe .ConstantsBase .BPMN_EXECUTION_VARIABLE_TARGET ;
4
- import static org .highmed .dsf .bpe .ConstantsPing .BPMN_EXECUTION_VARIABLE_STOP_TIMER ;
5
4
import static org .highmed .dsf .bpe .ConstantsPing .BPMN_EXECUTION_VARIABLE_TIMER_INTERVAL ;
6
5
import static org .highmed .dsf .bpe .ConstantsPing .CODESYSTEM_HIGHMED_PING ;
7
6
import static org .highmed .dsf .bpe .ConstantsPing .CODESYSTEM_HIGHMED_PING_VALUE_TIMER_INTERVAL ;
8
7
import static org .highmed .dsf .bpe .ConstantsPing .TIMER_INTERVAL_DEFAULT_VALUE ;
9
8
9
+ import java .util .Objects ;
10
+
11
+ import org .camunda .bpm .engine .delegate .BpmnError ;
10
12
import org .camunda .bpm .engine .delegate .DelegateExecution ;
11
13
import org .camunda .bpm .engine .variable .Variables ;
12
14
import org .highmed .dsf .bpe .delegate .AbstractServiceDelegate ;
20
22
import org .slf4j .Logger ;
21
23
import org .slf4j .LoggerFactory ;
22
24
23
- public class StartTimer extends AbstractServiceDelegate
25
+ public class SetTargetAndConfigureTimer extends AbstractServiceDelegate
24
26
{
25
- private static final Logger logger = LoggerFactory .getLogger (StartTimer .class );
27
+ private static final Logger logger = LoggerFactory .getLogger (SetTargetAndConfigureTimer .class );
26
28
27
29
private final OrganizationProvider organizationProvider ;
28
30
private final EndpointProvider endpointProvider ;
29
31
30
- public StartTimer (FhirWebserviceClientProvider clientProvider , TaskHelper taskHelper ,
32
+ public SetTargetAndConfigureTimer (FhirWebserviceClientProvider clientProvider , TaskHelper taskHelper ,
31
33
ReadAccessHelper readAccessHelper , OrganizationProvider organizationProvider ,
32
34
EndpointProvider endpointProvider )
33
35
{
@@ -38,11 +40,17 @@ public StartTimer(FhirWebserviceClientProvider clientProvider, TaskHelper taskHe
38
40
}
39
41
40
42
@ Override
41
- protected void doExecute ( DelegateExecution execution ) throws Exception
43
+ public void afterPropertiesSet ( ) throws Exception
42
44
{
43
- logger .debug ("Setting variable '{}' to false" , BPMN_EXECUTION_VARIABLE_STOP_TIMER );
44
- execution .setVariable (BPMN_EXECUTION_VARIABLE_STOP_TIMER , Variables .booleanValue (false ));
45
+ super .afterPropertiesSet ();
46
+
47
+ Objects .requireNonNull (organizationProvider , "organizationProvider" );
48
+ Objects .requireNonNull (endpointProvider , "endpointProvider" );
49
+ }
45
50
51
+ @ Override
52
+ protected void doExecute (DelegateExecution execution ) throws BpmnError , Exception
53
+ {
46
54
String timerInterval = getTimerInterval (execution );
47
55
logger .debug ("Setting variable '{}' to {}" , BPMN_EXECUTION_VARIABLE_TIMER_INTERVAL , timerInterval );
48
56
execution .setVariable (BPMN_EXECUTION_VARIABLE_TIMER_INTERVAL , Variables .stringValue (timerInterval ));
0 commit comments