Tabnine Logo
MetadataMapperService.shouldPopulateDefinition
Code IndexAdd Tabnine to your IDE (free)

How to use
shouldPopulateDefinition
method
in
com.netflix.conductor.core.metadata.MetadataMapperService

Best Java code snippets using com.netflix.conductor.core.metadata.MetadataMapperService.shouldPopulateDefinition (Showing top 8 results out of 315)

origin: Netflix/conductor

/**
 * This method is used to get the List of dynamic workflow tasks and their input based on the {@link WorkflowTask#getDynamicForkTasksParam()}
 *
 * @param taskToSchedule:       The Task of type FORK_JOIN_DYNAMIC that needs to scheduled, which has the input parameters
 * @param workflowInstance:     The instance of the {@link Workflow} which represents the workflow being executed.
 * @param dynamicForkTaskParam: The key representing the dynamic fork join json payload which is available in {@link WorkflowTask#getInputParameters()}
 * @throws TerminateWorkflowException : In case of input parameters of the dynamic fork tasks not represented as {@link Map}
 * @return a {@link Pair} representing the list of dynamic fork tasks in {@link Pair#getLeft()} and the input for the dynamic fork tasks in {@link Pair#getRight()}
 */
@SuppressWarnings("unchecked")
@VisibleForTesting
Pair<List<WorkflowTask>, Map<String, Map<String, Object>>> getDynamicForkTasksAndInput(WorkflowTask taskToSchedule, Workflow workflowInstance,
                                            String dynamicForkTaskParam) throws TerminateWorkflowException {
  Map<String, Object> input = parametersUtils.getTaskInput(taskToSchedule.getInputParameters(), workflowInstance, null, null);
  Object dynamicForkTasksJson = input.get(dynamicForkTaskParam);
  List<WorkflowTask> dynamicForkWorkflowTasks = objectMapper.convertValue(dynamicForkTasksJson, ListOfWorkflowTasks);
  for (WorkflowTask workflowTask : dynamicForkWorkflowTasks) {
    if (MetadataMapperService.shouldPopulateDefinition(workflowTask)) {
      workflowTask.setTaskDefinition(metadataDAO.getTaskDef(workflowTask.getName()));
    }
  }
  Object dynamicForkTasksInput = input.get(taskToSchedule.getDynamicForkTasksInputParamName());
  if (!(dynamicForkTasksInput instanceof Map)) {
    throw new TerminateWorkflowException("Input to the dynamically forked tasks is not a map -> expecting a map of K,V  but found " + dynamicForkTasksInput);
  }
  return new ImmutablePair<>(dynamicForkWorkflowTasks, (Map<String, Map<String, Object>>) dynamicForkTasksInput);
}
origin: Netflix/conductor

private WorkflowTask populateWorkflowTaskWithDefinition(WorkflowTask workflowTask) {
  if (shouldPopulateDefinition(workflowTask)) {
    workflowTask.setTaskDefinition(metadataDAO.getTaskDef(workflowTask.getName()));
  } else if (workflowTask.getType().equals(TaskType.SUB_WORKFLOW.name())) {
    populateVersionForSubWorkflow(workflowTask);
  }
  return workflowTask;
}
origin: Netflix/conductor

dynamicForkJoinWorkflowTask.setName(dynamicForkJoinTask.getTaskName());
dynamicForkJoinWorkflowTask.setType(dynamicForkJoinTask.getType());
if (MetadataMapperService.shouldPopulateDefinition(dynamicForkJoinWorkflowTask)) {
  dynamicForkJoinWorkflowTask.setTaskDefinition(
      metadataDAO.getTaskDef(dynamicForkJoinTask.getTaskName()));
origin: Netflix/conductor

public Workflow populateWorkflowWithDefinitions(Workflow workflow) {
  WorkflowDef workflowDefinition = Optional.ofNullable(workflow.getWorkflowDefinition())
      .orElseGet(() -> {
        WorkflowDef wd = lookupForWorkflowDefinition(workflow.getWorkflowName(), workflow.getWorkflowVersion());
        workflow.setWorkflowDefinition(wd);
        return wd;
      });
  workflowDefinition.collectTasks().forEach(
      workflowTask -> {
        if (shouldPopulateDefinition(workflowTask)) {
          workflowTask.setTaskDefinition(metadataDAO.getTaskDef(workflowTask.getName()));
        } else if (workflowTask.getType().equals(TaskType.SUB_WORKFLOW.name())) {
          populateVersionForSubWorkflow(workflowTask);
        }
      }
  );
  checkNotEmptyDefinitions(workflowDefinition);
  return workflow;
}
origin: com.netflix.conductor/conductor-core

/**
 * This method is used to get the List of dynamic workflow tasks and their input based on the {@link WorkflowTask#getDynamicForkTasksParam()}
 *
 * @param taskToSchedule:       The Task of type FORK_JOIN_DYNAMIC that needs to scheduled, which has the input parameters
 * @param workflowInstance:     The instance of the {@link Workflow} which represents the workflow being executed.
 * @param dynamicForkTaskParam: The key representing the dynamic fork join json payload which is available in {@link WorkflowTask#getInputParameters()}
 * @throws TerminateWorkflowException : In case of input parameters of the dynamic fork tasks not represented as {@link Map}
 * @return a {@link Pair} representing the list of dynamic fork tasks in {@link Pair#getLeft()} and the input for the dynamic fork tasks in {@link Pair#getRight()}
 */
@SuppressWarnings("unchecked")
@VisibleForTesting
Pair<List<WorkflowTask>, Map<String, Map<String, Object>>> getDynamicForkTasksAndInput(WorkflowTask taskToSchedule, Workflow workflowInstance,
                                            String dynamicForkTaskParam) throws TerminateWorkflowException {
  Map<String, Object> input = parametersUtils.getTaskInput(taskToSchedule.getInputParameters(), workflowInstance, null, null);
  Object dynamicForkTasksJson = input.get(dynamicForkTaskParam);
  List<WorkflowTask> dynamicForkWorkflowTasks = objectMapper.convertValue(dynamicForkTasksJson, ListOfWorkflowTasks);
  for (WorkflowTask workflowTask : dynamicForkWorkflowTasks) {
    if (MetadataMapperService.shouldPopulateDefinition(workflowTask)) {
      workflowTask.setTaskDefinition(metadataDAO.getTaskDef(workflowTask.getName()));
    }
  }
  Object dynamicForkTasksInput = input.get(taskToSchedule.getDynamicForkTasksInputParamName());
  if (!(dynamicForkTasksInput instanceof Map)) {
    throw new TerminateWorkflowException("Input to the dynamically forked tasks is not a map -> expecting a map of K,V  but found " + dynamicForkTasksInput);
  }
  return new ImmutablePair<>(dynamicForkWorkflowTasks, (Map<String, Map<String, Object>>) dynamicForkTasksInput);
}
origin: com.netflix.conductor/conductor-core

private WorkflowTask populateWorkflowTaskWithDefinition(WorkflowTask workflowTask) {
  if (shouldPopulateDefinition(workflowTask)) {
    workflowTask.setTaskDefinition(metadataDAO.getTaskDef(workflowTask.getName()));
  } else if (workflowTask.getType().equals(TaskType.SUB_WORKFLOW.name())) {
    populateVersionForSubWorkflow(workflowTask);
  }
  return workflowTask;
}
origin: com.netflix.conductor/conductor-core

dynamicForkJoinWorkflowTask.setName(dynamicForkJoinTask.getTaskName());
dynamicForkJoinWorkflowTask.setType(dynamicForkJoinTask.getType());
if (MetadataMapperService.shouldPopulateDefinition(dynamicForkJoinWorkflowTask)) {
  dynamicForkJoinWorkflowTask.setTaskDefinition(
      metadataDAO.getTaskDef(dynamicForkJoinTask.getTaskName()));
origin: com.netflix.conductor/conductor-core

public Workflow populateWorkflowWithDefinitions(Workflow workflow) {
  WorkflowDef workflowDefinition = Optional.ofNullable(workflow.getWorkflowDefinition())
      .orElseGet(() -> {
        WorkflowDef wd = lookupForWorkflowDefinition(workflow.getWorkflowName(), workflow.getWorkflowVersion());
        workflow.setWorkflowDefinition(wd);
        return wd;
      });
  workflowDefinition.collectTasks().forEach(
      workflowTask -> {
        if (shouldPopulateDefinition(workflowTask)) {
          workflowTask.setTaskDefinition(metadataDAO.getTaskDef(workflowTask.getName()));
        } else if (workflowTask.getType().equals(TaskType.SUB_WORKFLOW.name())) {
          populateVersionForSubWorkflow(workflowTask);
        }
      }
  );
  checkNotEmptyDefinitions(workflowDefinition);
  return workflow;
}
com.netflix.conductor.core.metadataMetadataMapperServiceshouldPopulateDefinition

Popular methods of MetadataMapperService

  • populateTaskDefinitions
  • lookupLatestWorkflowDefinition
  • lookupWorkflowDefinition
  • checkNotEmptyDefinitions
  • lookupForWorkflowDefinition
  • populateVersionForSubWorkflow
  • populateWorkflowTaskWithDefinition
  • populateWorkflowWithDefinitions
  • <init>

Popular in Java

  • Finding current android device location
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now