Search in sources :

Example 1 with ForkJoinDynamicTaskMapper

use of com.netflix.conductor.core.execution.mapper.ForkJoinDynamicTaskMapper in project conductor by Netflix.

the class TestWorkflowExecutor method init.

@Before
public void init() {
    TestConfiguration config = new TestConfiguration();
    executionDAOFacade = mock(ExecutionDAOFacade.class);
    metadataDAO = mock(MetadataDAO.class);
    queueDAO = mock(QueueDAO.class);
    workflowStatusListener = mock(WorkflowStatusListener.class);
    ExternalPayloadStorageUtils externalPayloadStorageUtils = mock(ExternalPayloadStorageUtils.class);
    executionLockService = mock(ExecutionLockService.class);
    ObjectMapper objectMapper = new JsonMapperProvider().get();
    ParametersUtils parametersUtils = new ParametersUtils();
    Map<String, TaskMapper> taskMappers = new HashMap<>();
    taskMappers.put("DECISION", new DecisionTaskMapper());
    taskMappers.put("DYNAMIC", new DynamicTaskMapper(parametersUtils, metadataDAO));
    taskMappers.put("FORK_JOIN", new ForkJoinTaskMapper());
    taskMappers.put("JOIN", new JoinTaskMapper());
    taskMappers.put("FORK_JOIN_DYNAMIC", new ForkJoinDynamicTaskMapper(parametersUtils, objectMapper, metadataDAO));
    taskMappers.put("USER_DEFINED", new UserDefinedTaskMapper(parametersUtils, metadataDAO));
    taskMappers.put("SIMPLE", new SimpleTaskMapper(parametersUtils));
    taskMappers.put("SUB_WORKFLOW", new SubWorkflowTaskMapper(parametersUtils, metadataDAO));
    taskMappers.put("EVENT", new EventTaskMapper(parametersUtils));
    taskMappers.put("WAIT", new WaitTaskMapper(parametersUtils));
    taskMappers.put("HTTP", new HTTPTaskMapper(parametersUtils, metadataDAO));
    taskMappers.put("LAMBDA", new LambdaTaskMapper(parametersUtils, metadataDAO));
    new SubWorkflow(new JsonMapperProvider().get());
    new Lambda();
    DeciderService deciderService = new DeciderService(parametersUtils, metadataDAO, externalPayloadStorageUtils, taskMappers, config);
    MetadataMapperService metadataMapperService = new MetadataMapperService(metadataDAO);
    workflowExecutor = new WorkflowExecutor(deciderService, metadataDAO, queueDAO, metadataMapperService, workflowStatusListener, executionDAOFacade, config, executionLockService, parametersUtils);
}
Also used : LambdaTaskMapper(com.netflix.conductor.core.execution.mapper.LambdaTaskMapper) SubWorkflowTaskMapper(com.netflix.conductor.core.execution.mapper.SubWorkflowTaskMapper) HashMap(java.util.HashMap) WaitTaskMapper(com.netflix.conductor.core.execution.mapper.WaitTaskMapper) ExternalPayloadStorageUtils(com.netflix.conductor.core.utils.ExternalPayloadStorageUtils) SimpleTaskMapper(com.netflix.conductor.core.execution.mapper.SimpleTaskMapper) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) ExecutionLockService(com.netflix.conductor.service.ExecutionLockService) QueueDAO(com.netflix.conductor.dao.QueueDAO) ForkJoinDynamicTaskMapper(com.netflix.conductor.core.execution.mapper.ForkJoinDynamicTaskMapper) Lambda(com.netflix.conductor.core.execution.tasks.Lambda) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) MetadataDAO(com.netflix.conductor.dao.MetadataDAO) SimpleTaskMapper(com.netflix.conductor.core.execution.mapper.SimpleTaskMapper) LambdaTaskMapper(com.netflix.conductor.core.execution.mapper.LambdaTaskMapper) ForkJoinTaskMapper(com.netflix.conductor.core.execution.mapper.ForkJoinTaskMapper) HTTPTaskMapper(com.netflix.conductor.core.execution.mapper.HTTPTaskMapper) TaskMapper(com.netflix.conductor.core.execution.mapper.TaskMapper) ForkJoinDynamicTaskMapper(com.netflix.conductor.core.execution.mapper.ForkJoinDynamicTaskMapper) UserDefinedTaskMapper(com.netflix.conductor.core.execution.mapper.UserDefinedTaskMapper) WaitTaskMapper(com.netflix.conductor.core.execution.mapper.WaitTaskMapper) JoinTaskMapper(com.netflix.conductor.core.execution.mapper.JoinTaskMapper) SubWorkflowTaskMapper(com.netflix.conductor.core.execution.mapper.SubWorkflowTaskMapper) DecisionTaskMapper(com.netflix.conductor.core.execution.mapper.DecisionTaskMapper) DynamicTaskMapper(com.netflix.conductor.core.execution.mapper.DynamicTaskMapper) EventTaskMapper(com.netflix.conductor.core.execution.mapper.EventTaskMapper) EventTaskMapper(com.netflix.conductor.core.execution.mapper.EventTaskMapper) SubWorkflow(com.netflix.conductor.core.execution.tasks.SubWorkflow) UserDefinedTaskMapper(com.netflix.conductor.core.execution.mapper.UserDefinedTaskMapper) JsonMapperProvider(com.netflix.conductor.common.utils.JsonMapperProvider) ForkJoinTaskMapper(com.netflix.conductor.core.execution.mapper.ForkJoinTaskMapper) DecisionTaskMapper(com.netflix.conductor.core.execution.mapper.DecisionTaskMapper) MetadataMapperService(com.netflix.conductor.core.metadata.MetadataMapperService) HTTPTaskMapper(com.netflix.conductor.core.execution.mapper.HTTPTaskMapper) ForkJoinDynamicTaskMapper(com.netflix.conductor.core.execution.mapper.ForkJoinDynamicTaskMapper) DynamicTaskMapper(com.netflix.conductor.core.execution.mapper.DynamicTaskMapper) ForkJoinTaskMapper(com.netflix.conductor.core.execution.mapper.ForkJoinTaskMapper) JoinTaskMapper(com.netflix.conductor.core.execution.mapper.JoinTaskMapper) ExecutionDAOFacade(com.netflix.conductor.core.orchestration.ExecutionDAOFacade) Before(org.junit.Before)

Example 2 with ForkJoinDynamicTaskMapper

use of com.netflix.conductor.core.execution.mapper.ForkJoinDynamicTaskMapper in project conductor by Netflix.

the class TestDeciderOutcomes method init.

@Before
public void init() {
    MetadataDAO metadataDAO = mock(MetadataDAO.class);
    ExternalPayloadStorageUtils externalPayloadStorageUtils = mock(ExternalPayloadStorageUtils.class);
    Configuration configuration = mock(Configuration.class);
    when(configuration.getTaskInputPayloadSizeThresholdKB()).thenReturn(10L);
    when(configuration.getMaxTaskInputPayloadSizeThresholdKB()).thenReturn(10240L);
    TaskDef taskDef = new TaskDef();
    taskDef.setRetryCount(1);
    taskDef.setName("mockTaskDef");
    taskDef.setResponseTimeoutSeconds(60 * 60);
    when(metadataDAO.getTaskDef(anyString())).thenReturn(taskDef);
    ParametersUtils parametersUtils = new ParametersUtils();
    Map<String, TaskMapper> taskMappers = new HashMap<>();
    taskMappers.put("DECISION", new DecisionTaskMapper());
    taskMappers.put("DYNAMIC", new DynamicTaskMapper(parametersUtils, metadataDAO));
    taskMappers.put("FORK_JOIN", new ForkJoinTaskMapper());
    taskMappers.put("JOIN", new JoinTaskMapper());
    taskMappers.put("FORK_JOIN_DYNAMIC", new ForkJoinDynamicTaskMapper(parametersUtils, objectMapper, metadataDAO));
    taskMappers.put("USER_DEFINED", new UserDefinedTaskMapper(parametersUtils, metadataDAO));
    taskMappers.put("SIMPLE", new SimpleTaskMapper(parametersUtils));
    taskMappers.put("SUB_WORKFLOW", new SubWorkflowTaskMapper(parametersUtils, metadataDAO));
    taskMappers.put("EVENT", new EventTaskMapper(parametersUtils));
    taskMappers.put("WAIT", new WaitTaskMapper(parametersUtils));
    taskMappers.put("HTTP", new HTTPTaskMapper(parametersUtils, metadataDAO));
    this.deciderService = new DeciderService(parametersUtils, metadataDAO, externalPayloadStorageUtils, taskMappers, configuration);
}
Also used : Configuration(com.netflix.conductor.core.config.Configuration) SubWorkflowTaskMapper(com.netflix.conductor.core.execution.mapper.SubWorkflowTaskMapper) HashMap(java.util.HashMap) WaitTaskMapper(com.netflix.conductor.core.execution.mapper.WaitTaskMapper) ExternalPayloadStorageUtils(com.netflix.conductor.core.utils.ExternalPayloadStorageUtils) SimpleTaskMapper(com.netflix.conductor.core.execution.mapper.SimpleTaskMapper) UserDefinedTaskMapper(com.netflix.conductor.core.execution.mapper.UserDefinedTaskMapper) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) ForkJoinTaskMapper(com.netflix.conductor.core.execution.mapper.ForkJoinTaskMapper) DecisionTaskMapper(com.netflix.conductor.core.execution.mapper.DecisionTaskMapper) HTTPTaskMapper(com.netflix.conductor.core.execution.mapper.HTTPTaskMapper) ForkJoinDynamicTaskMapper(com.netflix.conductor.core.execution.mapper.ForkJoinDynamicTaskMapper) DynamicTaskMapper(com.netflix.conductor.core.execution.mapper.DynamicTaskMapper) TaskDef(com.netflix.conductor.common.metadata.tasks.TaskDef) JoinTaskMapper(com.netflix.conductor.core.execution.mapper.JoinTaskMapper) ForkJoinTaskMapper(com.netflix.conductor.core.execution.mapper.ForkJoinTaskMapper) ForkJoinDynamicTaskMapper(com.netflix.conductor.core.execution.mapper.ForkJoinDynamicTaskMapper) MetadataDAO(com.netflix.conductor.dao.MetadataDAO) TaskMapper(com.netflix.conductor.core.execution.mapper.TaskMapper) ForkJoinDynamicTaskMapper(com.netflix.conductor.core.execution.mapper.ForkJoinDynamicTaskMapper) SimpleTaskMapper(com.netflix.conductor.core.execution.mapper.SimpleTaskMapper) UserDefinedTaskMapper(com.netflix.conductor.core.execution.mapper.UserDefinedTaskMapper) WaitTaskMapper(com.netflix.conductor.core.execution.mapper.WaitTaskMapper) JoinTaskMapper(com.netflix.conductor.core.execution.mapper.JoinTaskMapper) ForkJoinTaskMapper(com.netflix.conductor.core.execution.mapper.ForkJoinTaskMapper) SubWorkflowTaskMapper(com.netflix.conductor.core.execution.mapper.SubWorkflowTaskMapper) HTTPTaskMapper(com.netflix.conductor.core.execution.mapper.HTTPTaskMapper) DecisionTaskMapper(com.netflix.conductor.core.execution.mapper.DecisionTaskMapper) DynamicTaskMapper(com.netflix.conductor.core.execution.mapper.DynamicTaskMapper) EventTaskMapper(com.netflix.conductor.core.execution.mapper.EventTaskMapper) EventTaskMapper(com.netflix.conductor.core.execution.mapper.EventTaskMapper) Before(org.junit.Before)

Aggregations

DecisionTaskMapper (com.netflix.conductor.core.execution.mapper.DecisionTaskMapper)2 DynamicTaskMapper (com.netflix.conductor.core.execution.mapper.DynamicTaskMapper)2 EventTaskMapper (com.netflix.conductor.core.execution.mapper.EventTaskMapper)2 ForkJoinDynamicTaskMapper (com.netflix.conductor.core.execution.mapper.ForkJoinDynamicTaskMapper)2 ForkJoinTaskMapper (com.netflix.conductor.core.execution.mapper.ForkJoinTaskMapper)2 HTTPTaskMapper (com.netflix.conductor.core.execution.mapper.HTTPTaskMapper)2 JoinTaskMapper (com.netflix.conductor.core.execution.mapper.JoinTaskMapper)2 SimpleTaskMapper (com.netflix.conductor.core.execution.mapper.SimpleTaskMapper)2 SubWorkflowTaskMapper (com.netflix.conductor.core.execution.mapper.SubWorkflowTaskMapper)2 TaskMapper (com.netflix.conductor.core.execution.mapper.TaskMapper)2 UserDefinedTaskMapper (com.netflix.conductor.core.execution.mapper.UserDefinedTaskMapper)2 WaitTaskMapper (com.netflix.conductor.core.execution.mapper.WaitTaskMapper)2 ExternalPayloadStorageUtils (com.netflix.conductor.core.utils.ExternalPayloadStorageUtils)2 MetadataDAO (com.netflix.conductor.dao.MetadataDAO)2 HashMap (java.util.HashMap)2 Before (org.junit.Before)2 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 TaskDef (com.netflix.conductor.common.metadata.tasks.TaskDef)1 JsonMapperProvider (com.netflix.conductor.common.utils.JsonMapperProvider)1