com.fivefaces.cloud.workflow.AWSOnPremWorkflowService Maven / Gradle / Ivy
package com.fivefaces.cloud.workflow;
import com.amazonaws.services.stepfunctions.model.DescribeExecutionResult;
import com.fivefaces.cloud.workflow.awsonprem.StateMachineService;
import com.fivefaces.cloud.workflow.awsonprem.model.ExecutionResult;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;
@Profile("WORKFLOW_AWS_ON_PREM")
@Slf4j
@Service
@RequiredArgsConstructor
public class AWSOnPremWorkflowService implements WorkflowService {
private final StateMachineService stateMachineService;
@Override
public WorkflowExecutionResult instantiateWorkflow(final String functionName, final String jsonInput) {
ExecutionResult result = stateMachineService.instantiateWorkflow(functionName, jsonInput);
return new WorkflowExecutionResult(result.getExecutionId(), result.getStatus().name(), result.getOutput(), result.getDebug());
}
@Override
public WorkflowExecutionResult instantiateSyncWorkflow(final String functionName, final String jsonInput) {
ExecutionResult result = stateMachineService.instantiateSyncWorkflow(functionName, jsonInput);
return new WorkflowExecutionResult(result.getExecutionId(), result.getStatus().name(), result.getOutput(), result.getDebug());
}
@Override
public DescribeExecutionResult getExecutionResult(String executionArn) {
return null;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy