Transforms current message to a process data command

@param \Prooph\Processing\Processor\Task\TaskListPosition $newTaskListPosition
@param string|NodeName $target
@param array $metadata
@return WorkflowMessage
482549
public function prepareDataProcessing(TaskListPosition $newTaskListPosition, $target, array $metadata = [])
    {
        $type = MessageNameUtils::getTypePartOfMessageName($this->messageName);

        $metadata = ArrayUtils::merge($this->metadata, $metadata);

        return new self(
            $this->payload,
            MessageNameUtils::getProcessDataCommandName($type),
            $this->target, //Target of the last answer is the origin of the new command
            $target,
            $metadata,
            $newTaskListPosition,
            $this->version + 1
        );
    }
623897
public ProcessingInstruction createProcessingInstruction(
          String target, String data) throws DOMException
  {

    error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);

    return null;
  }
494956
void processCommand(final HttpServerExchange exchange, final RequestData requestData, final MCMPAction action) throws IOException {
        if (exchange.getRequestPath().equals("*") || exchange.getRequestPath().endsWith("/*")) {
            processNodeCommand(exchange, requestData, action);
        } else {
            processAppCommand(exchange, requestData, action);
        }
    }
157620
public function addOrReplaceTarget($targetName, &$target)
    {
        $this->log("  +Target: $targetName", Project::MSG_DEBUG);
        $target->setProject($this);
        $this->targets[$targetName] = $target;

        $ctx = $this->getReference(ProjectConfigurator::PARSING_CONTEXT_REFERENCE);
        $current = $ctx->getCurrentTargets();
        $current[$targetName] = $target;
    }
1147486
private static void process(String targetTool, String[] args) {
    if("mkmetric".equals(targetTool)) {
      shift(args);
    } 
    if(!"tsd".equals(targetTool)) {     
      try {
        COMMANDS.get(targetTool).getDeclaredMethod("main", String[].class).invoke(null, new Object[] {args});
      } catch(Exception x) {
          log.error("Failed to call [" + targetTool + "].", x);
          System.exit(-1);
      }     
    } else {
      launchTSD(args);
    }
  }
1228356
public static <DT extends DTask> RPC<DT> call(H2ONode target, DT dtask) {
    return new RPC(target,dtask).call();
  }
108819
protected static function writeFile($target, $content, $tmp)
    {
        $dir = dirname($target);
        if (!is_dir($dir))
            mkdir($dir, 644, true);
        $file = tempnam($tmp, 'hum');
        if (!($fd = fopen($file, 'w')))
            throw new \RuntimeException("create template tmp file failed:$file!");
        fwrite($fd, $content);
        fclose($fd);
        if (file_exists($target))
            unlink($target);
        $ret = rename($file, $target);
        if ($ret)
            chmod($target, 644);
        else
            throw new \RuntimeException("create template failed:$target!");

        return $ret;
    }
1012517
protected function createMessageContent(Twig_Template $template, array $context): MessageContent
    {
        $mimeType = $this->renderBlock($template, 'content_type', $context);
        $content = $mimeType === 'text/html'
            ? new HtmlMessageContent
            : new GenericMessageContent($mimeType);

        $context['_content'] = $content;
        $content->modify(
            $this->renderBlock($template, 'content', $context),
            $this->renderBlock($template, 'text_content', $context) ?: null
        );

        $attachments = array_filter(preg_split('/\s*[,;]\s*/', trim($this->renderBlock($template, 'attachments', $context))));
        foreach ($attachments as $path) {
            $content->attach($path);
        }

        return $content;
    }
1352418
private function executeCallable($target, RequestInterface $request, ResponseInterface $response)
    {
        ob_start();
        $level = ob_get_level();

        try {
            $arguments = array_merge([$request, $response], $this->arguments);
            $target = self::getCallable($target, $arguments);
            $return = call_user_func_array($target, $arguments);

            if ($return instanceof ResponseInterface) {
                $response = $return;
                $return = '';
            }

            $return = Utils\Helpers::getOutput($level).$return;
            $body = $response->getBody();

            if ($return !== '' && $body->isWritable()) {
                $body->write($return);
            }

            return $response;
        } catch (\Exception $exception) {
            Utils\Helpers::getOutput($level);
            throw $exception;
        }
    }
1120640
public void populateMetadata(final Target target) {
        removeAllItems();
        if (target == null) {
            return;
        }
        selectedTargetId = target.getId();
        final List<TargetMetadata> targetMetadataList = targetManagement
                .findMetaDataByControllerId(PageRequest.of(0, MAX_METADATA_QUERY), target.getControllerId())
                .getContent();
        if (targetMetadataList != null && !targetMetadataList.isEmpty()) {
            targetMetadataList.forEach(this::setMetadataProperties);
        }
    }
189726
public static function do_process_action($target, $action, $courseid = null) {
        global $DB;
        // TODO: this code should be in some grade_tree static method
        $targettype = substr($target, 0, 2);
        $targetid = substr($target, 2);
        // TODO: end

        if ($targettype !== 'cg') {
            // The following code only works with categories.
            return true;
        }

        if (!$courseid) {
            debugging('Function grade_report_grader::do_process_action() now requires additional argument courseid',
                DEBUG_DEVELOPER);
            if (!$courseid = $DB->get_field('grade_categories', 'courseid', array('id' => $targetid), IGNORE_MISSING)) {
                return true;
            }
        }

        $collapsed = static::get_collapsed_preferences($courseid);

        switch ($action) {
            case 'switch_minus': // Add category to array of aggregatesonly
                if (!in_array($targetid, $collapsed['aggregatesonly'])) {
                    $collapsed['aggregatesonly'][] = $targetid;
                    static::set_collapsed_preferences($courseid, $collapsed);
                }
                break;

            case 'switch_plus': // Remove category from array of aggregatesonly, and add it to array of gradesonly
                $key = array_search($targetid, $collapsed['aggregatesonly']);
                if ($key !== false) {
                    unset($collapsed['aggregatesonly'][$key]);
                }
                if (!in_array($targetid, $collapsed['gradesonly'])) {
                    $collapsed['gradesonly'][] = $targetid;
                }
                static::set_collapsed_preferences($courseid, $collapsed);
                break;
            case 'switch_whole': // Remove the category from the array of collapsed cats
                $key = array_search($targetid, $collapsed['gradesonly']);
                if ($key !== false) {
                    unset($collapsed['gradesonly'][$key]);
                    static::set_collapsed_preferences($courseid, $collapsed);
                }

                break;
            default:
                break;
        }

        return true;
    }
628802
protected void insertInstructionImpl(String target, String data) {
        getDocument().insertBefore(
            getDocument().createProcessingInstruction(target, data),
            xmlNode);
    }
313860
public function iParseAndProcess($template, TableNode $table)
    {
        $data = [];

        foreach ($table->getRows() as $row) {
            $data[$row[0]] = $row[1];
        }

        $this->result = $this->template->parse($template)->process($data);
    }
757762
public void startSnapshotWithTargets(Collection<SnapshotDataTarget> targets, long now)
    {
        // TRAIL [SnapSave:9] 5 [all SP] Start snapshot by putting task into the site queue.
        //Basically asserts that there are no tasks with null targets at this point
        //getTarget checks and crashes
        for (SnapshotTableTask t : m_snapshotTableTasks.values()) {
            t.getTarget();
        }

        ArrayList<SnapshotDataTarget> targetsToClose = Lists.newArrayList();
        for (final SnapshotDataTarget target : targets) {
            if (target.needsFinalClose()) {
                targetsToClose.add(target);
            }
        }
        m_snapshotTargets = targetsToClose;

        // Queue the first snapshot task
        VoltDB.instance().schedulePriorityWork(
                new Runnable() {
                    @Override
                    public void run()
                    {
                        m_siteTaskerQueue.offer(new SnapshotTask());
                    }
                },
                (m_quietUntil + (5 * m_snapshotPriority) - now),
                0,
                TimeUnit.MILLISECONDS);
        m_quietUntil += 5 * m_snapshotPriority;
    }
380586
public function receiveMessage($message, WorkflowEngine $workflowEngine)
    {
        if ($message instanceof WorkflowMessage) {
            if (MessageNameUtils::isProcessingCommand($message->messageName())) {
                $this->perform($workflowEngine, $message);
                return;
            }

            $this->assertTaskEntryExists($message->processTaskListPosition());

            $this->recordThat(TaskEntryMarkedAsDone::at($message->processTaskListPosition()));

            $this->perform($workflowEngine, $message);
            return;
        }

        if ($message instanceof LogMessage) {
            $this->assertTaskEntryExists($message->processTaskListPosition());

            $this->recordThat(LogMessageReceived::record($message));

            if ($message->isError()) {
                $this->recordThat(TaskEntryMarkedAsFailed::at($message->processTaskListPosition()));
            } elseif ($this->isSubProcess() && $this->syncLogMessages) {
                //We only sync non error messages, because errors are always synced and then they would be received twice
                $messageForParent = $message->reconnectToProcessTask($this->parentTaskListPosition);
                $workflowEngine->dispatch($messageForParent);
            }
        }
    }
65454
public function translate($source, $target, $text)
    {
        return $this->getResponse($this->getRequest('', $text, $source, $target));
    }
350038
public static function to( $model, $target, $position )
	{
		$instance = new static( $model, $target, $position );

		return $instance->perform();
	}