CommonNodeAbstract

Overview #

CommonNodeAbstract is the base class for custom nodes. Custom nodes are general-purpose processing components that transform data without necessarily making HTTP requests.

Purpose:

  • Data transformation
  • Business logic
  • Filtering and validation
  • Custom processing steps

Location: orchesty-php-sdk/src/CustomNode/CommonNodeAbstract.php

Class Hierarchy #

CommonNodeAbstract

Implements: CommonNodeInterface

Uses traits:

  • CommonNodeTrait - Application management

Abstract Methods #

getName() #

abstract public function getName(): string

Returns unique identifier for the node.

processAction() #

abstract public function processAction(ProcessDto $dto): ProcessDto

Main processing method. Receives data, processes it, returns modified data.

Parameters:

ParameterTypeDescription
$dtoProcessDtoInput data

Returns: ProcessDto - Modified data

Usage Example #

<?php declare(strict_types=1);

namespace YourApp\CustomNode;

use Hanaboso\CommonsBundle\Process\ProcessDto;
use Hanaboso\PipesPhpSdk\CustomNode\CommonNodeAbstract;

final class DataTransformerNode extends CommonNodeAbstract
{
    public function getName(): string
    {
        return 'data-transformer';
    }

    public function processAction(ProcessDto $dto): ProcessDto
    {
        // Get input data
        $data = $dto->getJsonData();
        
        // Transform
        $transformed = [
            'fullName' => sprintf('%s %s', $data['firstName'], $data['lastName']),
            'email' => strtolower($data['email']),
            'timestamp' => time(),
        ];
        
        // Set output
        $dto->setJsonData($transformed);
        
        return $dto;
    }
}

Service Registration #

services:
    hbpf.custom_node.data-transformer:
        class: YourApp\CustomNode\DataTransformerNode
        arguments:
            - '@hbpf.application_install.repository'
        tags: ['hbpf.custom_node']

See Also #

© 2025 Orchesty Solutions. All rights reserved.