Create a workflow execution item for a plugin step.
487756
public static StepExecutionItem createPluginStepItem(
            final String type,
            final Map configuration,
            final boolean keepgoingOnSuccess,
            final StepExecutionItem handler,
            final String label,
            final List<PluginConfiguration> filterConfigurations
    )
    {

        return new PluginStepExecutionItemImpl(
                type,
                configuration,
                keepgoingOnSuccess,
                handler,
                label,
                filterConfigurations
        );
    }
1025645
static function create( $workflowID, $typeString )
    {
        $row = array(
            "id" => null,
            "version" => 1,
            "workflow_id" => $workflowID,
            "workflow_type_string" => $typeString,
            "description" => "",
            "placement" => eZPersistentObject::newObjectOrder( eZWorkflowEvent::definition(),
                                                               "placement",
                                                               array( "version" => 1,
                                                                      "workflow_id" => $workflowID ) ) );
        return new eZWorkflowEvent( $row );
    }
129449
def run_step(self):
        """"""
        rewriter = StreamRewriter(self.context.iter_formatted_strings)
        super().run_step(rewriter)
131866
def execute_builder(self, entry_point, toolchain, spec):
        

        toolchain(spec)
        if not exists(spec['export_target']):
            logger.error(
                "the entry point '%s' from package '%s' failed to "
                "generate an artifact at '%s'",
                entry_point, entry_point.dist, spec['export_target']
            )
            return {}
        return self.generate_metadata_entry(entry_point, toolchain, spec)
1213565
function WorkflowProcessBeginController($state, workorderService, wfmService, $stateParams) {
  var self = this;

  var workorderId = $stateParams.workorderId;
  workorderService.read(workorderId).then(function(workorder) {
    self.workorder = workorder;
    self.workflow = workorder.workflow;
    self.results = workorder.results;
    self.started = !wfmService.isNew(self.workorder);
    self.completed = wfmService.isCompleted(self.workorder);
  });

  self.getStepForResult = function(result) {
    return wfmService.getStepForResult(result, self.workorder);
  };

  self.begin = function() {
    wfmService.begin(self.workorder)
      .then(function() {
        $state.go('app.workflowProcess.steps', {
          workorderId: workorderId
        });
      })
      .catch(console.error.bind(console));
  };
}
403918
def perform(action, workitem)
      @action, @workitem = action, workitem
      send(action)
      write_output('') # Triggers any remaining buffered output to be sent
      run_callbacks
    rescue MaestroDev::Plugin::PluginError => e
      write_output('') # Triggers any remaining buffered output to be sent
      set_error(e.message)
    rescue Exception => e
      write_output('') # Triggers any remaining buffered output to be sent
      lowerstack = e.backtrace.find_index(caller[0])
      stack = lowerstack ? e.backtrace[0..lowerstack - 1] : e.backtrace
      msg = "Unexpected error executing task: #{e.class} #{e} at\n" + stack.join("\n")
      Maestro.log.warn("#{msg}\nFull stack:\n" + e.backtrace.join("\n"))

      # Let user-supplied exception handler do its thing
      handle_exception(e)
      set_error(msg)
    ensure
      # Older agents expected this method to *maybe* return something
      # .. something that no longer exists, but if we return anything
      # it will be *wrong* :P
      return nil
    end
851334
def add_jobflow_steps(self, jobflow_id, steps):
        
        if type(steps) != types.ListType:
            steps = [steps]
        params = {}
        params['JobFlowId'] = jobflow_id

        # Step args
        step_args = [self._build_step_args(step) for step in steps]
        params.update(self._build_step_list(step_args))

        return self.get_object(
            'AddJobFlowSteps', params, RunJobFlowResponse, verb='POST')
6663
function createStack(app, plugins) {
  if (app.enabled('minimal config')) {
    return es.pipe.apply(es, []);
  }
  function enabled(acc, plugin, name) {
    if (plugin == null) {
      acc.push(through.obj());
    }
    if (app.enabled(name + ' plugin')) {
      acc.push(plugin);
    }
    return acc;
  }
  var arr = _.reduce(plugins, enabled, []);
  return es.pipe.apply(es, arr);
}
1364958
def write_workflow(self, request, opts, cwd, wftype='cwl'):
        """"""

        workflow_url = request.get("workflow_url")

        # link the cwl and json into the cwd
        if workflow_url.startswith('file://'):
            os.link(workflow_url[7:], os.path.join(cwd, "wes_workflow." + wftype))
            workflow_url = os.path.join(cwd, "wes_workflow." + wftype)
        os.link(self.input_json, os.path.join(cwd, "wes_input.json"))
        self.input_json = os.path.join(cwd, "wes_input.json")

        extra_options = self.sort_toil_options(opts.getoptlist("extra"))
        if wftype == 'cwl':
            command_args = ['toil-cwl-runner'] + extra_options + [workflow_url, self.input_json]
        elif wftype == 'wdl':
            command_args = ['toil-wdl-runner'] + extra_options + [workflow_url, self.input_json]
        elif wftype == 'py':
            command_args = ['python'] + extra_options + [workflow_url]
        else:
            raise RuntimeError('workflow_type is not "cwl", "wdl", or "py": ' + str(wftype))

        return command_args
1260818
def _add_workflow(mcs, field_name, state_field, attrs):
        """"""
        attrs[field_name] = StateProperty(state_field.workflow, field_name)
979425
function taskRunner (ui) {

    return function (item, cb) {

        ui.logger.debug("Starting Step: " + item.step);

        /**
         * Give each step access to the UI Instance
         */
        item.fn(ui, function (err, out) {
            if (err) {
                return cb(err);
            }
            if (out) {
                handleOut(ui, out);
            }
            ui.logger.debug("{green:Step Complete: " + item.step);
            cb();
        });
    };
}
484214
private void executeAction(PluginAction action, boolean async, Object data) {
        if (hasListeners() || action == PluginAction.LOAD) {
            PluginEvent event = new PluginEvent(this, action, data);

            if (async) {
                EventUtil.post(event);
            } else {
                onAction(event);
            }
        }
    }
403498
def set_step_items(glob):
    
    a = glob['args']
    l = glob['logger']
    enabled = getattr(a, a._collisions.get("step") or "step", False)
    # Step context manager, for defining a block of code that can be paused at
    #  its start and end
    class Step(object):
        def __init__(self, message=None, at_end=False):
            self.message = message
            self.at_end = at_end
            
        def __enter__(self):
            if enabled:
                if self.message:
                    l.step(self.message)
                if not self.at_end:
                    std_input("Press enter to continue", {'color': STEP_COLOR,
                                                          'bold': True})
                return self
        
        def __exit__(self, *args):
            if enabled and self.at_end:
                std_input("Press enter to continue", {'color': STEP_COLOR,
                                                      'bold': True})
    glob['Step'] = Step
    # stepping function, for stopping the execution and displaying a message if
    #  any defined
    def step(message=None):
        if enabled:
            if message:
                l.step(message)
            std_input("Press enter to continue", {'color': STEP_COLOR,
                                                  'bold': True})
    glob['step'] = step
848320
def execute(self):
        """"""
        if self._cli_arguments['cfn']:
            generate_sample_cfn_module(self.env_root)
        elif self._cli_arguments['sls']:
            generate_sample_sls_module(self.env_root)
        elif self._cli_arguments['sls-tsc']:
            generate_sample_sls_tsc_module(self.env_root)
        elif self._cli_arguments['stacker']:
            generate_sample_stacker_module(self.env_root)
        elif self._cli_arguments['tf']:
            generate_sample_tf_module(self.env_root)
        elif self._cli_arguments['cdk-tsc']:
            generate_sample_cdk_tsc_module(self.env_root)
        elif self._cli_arguments['cdk-py']:
            generate_sample_cdk_py_module(self.env_root)
        elif self._cli_arguments['cdk-csharp']:
            generate_sample_cdk_cs_module(self.env_root)
238095
def execute(self):
        """"""
        self._collect_garbage()  # Make sure everything is clean
        # TODO (john): Check if dataflow has any 'logical inconsistencies'
        # For example, if there is a forward partitioning strategy but
        # the number of downstream instances is larger than the number of
        # upstream instances, some of the downstream instances will not be
        # used at all

        # Each operator instance is implemented as a Ray actor
        # Actors are deployed in topological order, as we traverse the
        # logical dataflow from sources to sinks. At each step, data
        # producers wait for acknowledge from consumers before starting
        # generating data.
        upstream_channels = {}
        for node in nx.topological_sort(self.logical_topo):
            operator = self.operators[node]
            # Generate downstream data channels
            downstream_channels = self._generate_channels(operator)
            # Instantiate Ray actors
            handles = self.__generate_actors(operator, upstream_channels,
                                             downstream_channels)
            if handles:
                self.actor_handles.extend(handles)
            upstream_channels.update(downstream_channels)
        logger.debug("Running...")
        return self.actor_handles
133369
def call_plugins(self, step):
        '''
        
        '''
        for plugin in self.plugins:
            try:
                getattr(plugin, step)()
            except AttributeError:
                self.logger.debug("{} doesn't exist on plugin {}".format(step, plugin))
            except TypeError:
                self.logger.debug("{} on plugin {} is not callable".format(step, plugin))
141257
def run_pipeline_steps(steps, context):
    
    logger.debug("starting")
    assert isinstance(
        context, dict), "context must be a dictionary, even if empty {}."

    if steps is None:
        logger.debug("No steps found to execute.")
    else:
        step_count = 0

        for step in steps:
            step_instance = Step(step)
            step_instance.run_step(context)
            step_count += 1

        logger.debug(f"executed {step_count} steps")

    logger.debug("done")