Skip to content

Commit

Permalink
Use new X-Request-ID
Browse files Browse the repository at this point in the history
  • Loading branch information
valb3r committed May 12, 2021
1 parent 236fab6 commit abcba51
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

import de.adorsys.opba.protocol.bpmnshared.dto.context.BaseContext;
import de.adorsys.opba.protocol.bpmnshared.dto.context.ContextMode;
import de.adorsys.opba.protocol.bpmnshared.util.logResolver.LogResolver;
import de.adorsys.opba.protocol.bpmnshared.service.context.ContextUtil;
import de.adorsys.opba.protocol.bpmnshared.util.logResolver.LogResolver;
import lombok.RequiredArgsConstructor;
import org.flowable.engine.delegate.BpmnError;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.JavaDelegate;
import org.springframework.transaction.annotation.Transactional;

import java.util.UUID;

/**
* Class that provides generic functionality for Services that can be called in Validation({@link ContextMode#MOCK_REAL_CALLS}
* execution mode and Real ASPSP API calls ({@link ContextMode#REAL_CALLS}.
Expand All @@ -31,6 +33,7 @@ public void execute(DelegateExecution execution) {

logResolver.log("execute: execution ({}) with context ({})", execution, context);

doUpdateXRequestId(execution, context);
doPrepareContext(execution, context);
doValidate(execution, context);

Expand All @@ -45,6 +48,13 @@ public void execute(DelegateExecution execution) {
logResolver.log("done execution ({}) with context ({})", execution, context);
}

/**
* Used to update X-Request-ID.
*/
protected void doUpdateXRequestId(DelegateExecution execution, T context) {
context.setRequestId(UUID.randomUUID().toString());
}

/**
* Used to update BPMN context before any execution.
*/
Expand Down

0 comments on commit abcba51

Please sign in to comment.