Codota Logo
PipelineExecutorTaskDef
Code IndexAdd Codota to your IDE (free)

How to use
PipelineExecutorTaskDef
in
org.guvnor.ala.pipeline.execution

Best Java code snippets using org.guvnor.ala.pipeline.execution.PipelineExecutorTaskDef (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: org.guvnor/guvnor-ala-spi

private void prepareExecution() {
  //mock the execution inputs
  pipeline = mock(Pipeline.class);
  stages = mockStages(PIPELINE_STAGES_SIZE);
  when(pipeline.getStages()).thenReturn(stages);
  when(pipeline.getName()).thenReturn(PIPELINE_ID);
  when(pipelineRegistry.getPipelineByName(PIPELINE_ID)).thenReturn(pipeline);
  taskDef = mock(PipelineExecutorTaskDef.class);
  input = mock(Input.class);
  when(taskDef.getInput()).thenReturn(input);
  when(taskDef.getPipeline()).thenReturn(PIPELINE_ID);
}
origin: org.guvnor/guvnor-ala-spi

public PipelineExecutorTaskImpl(final PipelineExecutorTaskDef taskDef,
                final String executionId) {
  this.taskDef = taskDef;
  setId(executionId);
  taskDef.getStages().forEach(stage -> setStageStatus(stage,
                            Status.SCHEDULED));
}
origin: org.guvnor/guvnor-ala-spi

  protected void assertHasSameInfo(PipelineExecutorTaskDef expectedTaskDef,
                   PipelineExecutorTaskDef taskDef) {
    assertEquals(expectedTaskDef.getInput(),
           taskDef.getInput());
    assertEquals(expectedTaskDef.getPipeline(),
           taskDef.getPipeline());
    assertEquals(expectedTaskDef.getProviderId(),
           taskDef.getProviderId());
    assertEquals(expectedTaskDef.getProviderType(),
           taskDef.getProviderType());
  }
}
origin: org.guvnor/guvnor-ala-services-rest

if (pipelineExecutorTrace.getTask().getTaskDef().getProviderId() != null) {
  item.setProviderId(pipelineExecutorTrace.getTask().getTaskDef().getProviderId().getId());
  item.setProviderTypeName(pipelineExecutorTrace.getTask().getTaskDef().getProviderId().getProviderType().getProviderTypeName());
  item.setProviderVersion(pipelineExecutorTrace.getTask().getTaskDef().getProviderId().getProviderType().getVersion());
List<PipelineStageItem> stageItems = pipelineExecutorTrace.getTask().getTaskDef().getStages().stream()
    .map(stage -> {
      String stageError = null;
  item.setRuntimeName(pipelineExecutorTrace.getTask().getTaskDef().getInput().get(RuntimeConfig.RUNTIME_NAME));
origin: org.kie.workbench/kie-wb-common-ala-spi

when(taskDef.getInput()).thenReturn(input);
when(taskDef.getStages()).thenReturn(stages);
origin: org.guvnor/guvnor-ala-spi

private void setId(final String executionId) {
  this.executionId = executionId;
  getTaskDef().getInput().put(PIPELINE_EXECUTION_ID,
                executionId);
}
origin: org.kie.workbench/kie-wb-common-ala-spi

@JsonIgnore
@Override
public String getPipelineId() {
  return getTask().getTaskDef().getPipeline();
}
origin: org.guvnor/guvnor-ala-services-rest

  @Override
  public boolean test(PipelineExecutorTrace pipelineExecutorTrace) {
    if (pipelineExecutionId != null) {
      return pipelineExecutionId.equals(pipelineExecutorTrace.getTaskId());
    }
    if (runtimeId != null) {
      return (pipelineExecutorTrace.getTask().getOutput() instanceof RuntimeId) &&
          runtimeId.equals(((RuntimeId) pipelineExecutorTrace.getTask().getOutput()).getId());
    }
    if (runtimeName != null) {
      return (pipelineExecutorTrace.getTask().getOutput() instanceof RuntimeId) &&
          runtimeName.equals(((RuntimeId) pipelineExecutorTrace.getTask().getOutput()).getName());
    }
    if (providerId != null) {
      if (pipelineExecutorTrace.getTask().getTaskDef().getProviderId() == null) {
        return false;
      } else if (!providerId.equals(pipelineExecutorTrace.getTask().getTaskDef().getProviderId().getId())) {
        return false;
      }
    }
    if (pipelineId != null) {
      if (!pipelineId.equals(pipelineExecutorTrace.getPipelineId())) {
        return false;
      }
    }
    return true;
  }
}
origin: org.guvnor/guvnor-ala-spi

when(taskDef.getInput()).thenReturn(input);
when(taskDef.getStages()).thenReturn(stages);
origin: org.kie.workbench/kie-wb-common-ala-spi

private void setId(final String executionId) {
  this.executionId = executionId;
  getTaskDef().getInput().put(PIPELINE_EXECUTION_ID,
                executionId);
}
origin: org.guvnor/guvnor-ala-spi

@JsonIgnore
@Override
public String getPipelineId() {
  return getTask().getTaskDef().getPipeline();
}
origin: org.kie.workbench/kie-wb-common-ala-spi

private void prepareExecution() {
  //mock the execution inputs
  pipeline = mock(Pipeline.class);
  stages = mockStages(PIPELINE_STAGES_SIZE);
  when(pipeline.getStages()).thenReturn(stages);
  when(pipeline.getName()).thenReturn(PIPELINE_ID);
  when(pipelineRegistry.getPipelineByName(PIPELINE_ID)).thenReturn(pipeline);
  taskDef = mock(PipelineExecutorTaskDef.class);
  input = mock(Input.class);
  when(taskDef.getInput()).thenReturn(input);
  when(taskDef.getPipeline()).thenReturn(PIPELINE_ID);
}
origin: org.kie.workbench/kie-wb-common-ala-spi

  protected void assertHasSameInfo(PipelineExecutorTaskDef expectedTaskDef,
                   PipelineExecutorTaskDef taskDef) {
    assertEquals(expectedTaskDef.getInput(),
           taskDef.getInput());
    assertEquals(expectedTaskDef.getPipeline(),
           taskDef.getPipeline());
    assertEquals(expectedTaskDef.getProviderId(),
           taskDef.getProviderId());
    assertEquals(expectedTaskDef.getProviderType(),
           taskDef.getProviderType());
  }
}
origin: org.kie.workbench/kie-wb-common-ala-spi

public PipelineExecutorTaskImpl(final PipelineExecutorTaskDef taskDef,
                final String executionId) {
  this.taskDef = taskDef;
  setId(executionId);
  taskDef.getStages().forEach(stage -> setStageStatus(stage,
                            Status.SCHEDULED));
}
origin: org.guvnor/guvnor-ala-spi

@Test
public void testExecuteSync() {
  when(taskManagerHelper.generateTaskId()).thenReturn(TASK_ID);
  taskManager.init();
  //prepare the input parameters.
  prepareExecution();
  String result = taskManager.execute(taskDef,
                    PipelineExecutorTaskManager.ExecutionMode.SYNCHRONOUS);
  assertEquals(TASK_ID,
         result);
  //verify the task to execute was properly initialized.
  verify(taskManagerHelper,
      times(1)).createTask(taskDef);
  //verify the pipeline was properly executed.
  verify(pipelineExecutor,
      times(1)).execute(eq(taskDef.getInput()),
               eq(pipeline),
               any(Consumer.class),
               eq(taskManager.localListener));
  //verify the pipeline executor registry was properly updated.
  verify(pipelineExecutorRegistry,
      times(1)).register(pipelineExecutorTraceCaptor.capture());
  assertEquals(PIPELINE_ID,
         pipelineExecutorTraceCaptor.getValue().getPipelineId());
  assertEquals(TASK_ID,
         pipelineExecutorTraceCaptor.getValue().getTaskId());
}
origin: org.guvnor/guvnor-ala-spi

Pipeline pipeline = mock(Pipeline.class);
when(pipeline.getStages()).thenReturn(mock(List.class));
when(taskDef.getPipeline()).thenReturn(PIPELINE_ID);
origin: org.guvnor/guvnor-ala-spi

@Before
public void setUp() {
  super.setUp();
  error = mock(Throwable.class);
  when(error.getMessage()).thenReturn(ERROR_MESSAGE);
  pipelineExecutorExceptionCaptor = ArgumentCaptor.forClass(PipelineExecutorException.class);
  pipeline = mock(Pipeline.class);
  stages = mockStages(PIPELINE_STAGES_SIZE);
  when(pipeline.getStages()).thenReturn(stages);
  when(pipeline.getName()).thenReturn(PIPELINE_ID);
  when(pipelineRegistry.getPipelineByName(PIPELINE_ID)).thenReturn(pipeline);
  //pick an arbitrary stage for events testing.
  stage = stages.get(0);
  taskDef = mock(PipelineExecutorTaskDef.class);
  input = mock(Input.class);
  when(taskDef.getInput()).thenReturn(input);
  when(taskDef.getPipeline()).thenReturn(PIPELINE_ID);
  task = spy(taskManagerHelper.createTask(taskDef,
                      TASK_ID));
  taskEntry = mock(PipelineExecutorTaskManagerImpl.TaskEntry.class);
  when(taskEntry.getTask()).thenReturn(task);
  //emulate there's a running task.
  taskManager.currentTasks.put(TASK_ID,
                 taskEntry);
  taskManager.init();
}
origin: org.kie.workbench/kie-wb-common-ala-spi

  public void setTaskInStoppedStatus(final PipelineExecutorTaskImpl task) {
    task.setPipelineStatus(PipelineExecutorTask.Status.STOPPED);
    task.getTaskDef().getStages()
        .stream()
        .filter(stage -> PipelineExecutorTask.Status.RUNNING.equals(task.getStageStatus(stage)) ||
            PipelineExecutorTask.Status.SCHEDULED.equals(task.getStageStatus(stage)))
        .forEach(stage -> task.setStageStatus(stage,
                           PipelineExecutorTask.Status.STOPPED));
    task.clearErrors();
    task.setOutput(null);
  }
}
origin: org.kie.workbench/kie-wb-common-ala-spi

@Test
public void testExecuteSync() {
  when(taskManagerHelper.generateTaskId()).thenReturn(TASK_ID);
  taskManager.init();
  //prepare the input parameters.
  prepareExecution();
  String result = taskManager.execute(taskDef,
                    PipelineExecutorTaskManager.ExecutionMode.SYNCHRONOUS);
  assertEquals(TASK_ID,
         result);
  //verify the task to execute was properly initialized.
  verify(taskManagerHelper,
      times(1)).createTask(taskDef);
  //verify the pipeline was properly executed.
  verify(pipelineExecutor,
      times(1)).execute(eq(taskDef.getInput()),
               eq(pipeline),
               any(Consumer.class),
               eq(taskManager.localListener));
  //verify the pipeline executor registry was properly updated.
  verify(pipelineExecutorRegistry,
      times(1)).register(pipelineExecutorTraceCaptor.capture());
  assertEquals(PIPELINE_ID,
         pipelineExecutorTraceCaptor.getValue().getPipelineId());
  assertEquals(TASK_ID,
         pipelineExecutorTraceCaptor.getValue().getTaskId());
}
origin: org.kie.workbench/kie-wb-common-ala-spi

Pipeline pipeline = mock(Pipeline.class);
when(pipeline.getStages()).thenReturn(mock(List.class));
when(taskDef.getPipeline()).thenReturn(PIPELINE_ID);
org.guvnor.ala.pipeline.executionPipelineExecutorTaskDef

Javadoc

This class defines the information for performing the execution of a Pipeline by using the PipelineExecutorTaskManager.

Most used methods

  • getInput
  • getStages
  • getPipeline
  • getProviderId
  • getProviderType

Popular in Java

  • Start an intent from android
  • getSharedPreferences (Context)
  • getContentResolver (Context)
  • runOnUiThread (Activity)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Table (org.hibernate.mapping)
    A relational table
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now