Operation#

NAME#

Kernel::GenericInterface::Operation - GenericInterface Operation interface

DESCRIPTION#

Operations are called by web service requests from remote systems.

PUBLIC INTERFACE#

new()#

create an object.

use Kernel::GenericInterface::Debugger;
use Kernel::GenericInterface::Operation;

my $DebuggerObject = Kernel::GenericInterface::Debugger->new(
    DebuggerConfig   => {
        DebugThreshold => 'debug',
        TestMode       => 0,           # optional, in testing mode the data will not be written to the DB
        # ...
    },
    WebserviceID      => 12,
    CommunicationType => Provider, # Requester or Provider
    RemoteIP          => 192.168.1.1, # optional
);

my $OperationObject = Kernel::GenericInterface::Operation->new(
    DebuggerObject => $DebuggerObject,
    Operation      => 'TicketCreate',            # the name of the operation in the web service
    OperationType  => 'Ticket::TicketCreate',    # the local operation backend to use
    WebserviceID   => $WebserviceID,             # ID of the currently used web service
);

Run()#

perform the selected Operation.

my $Result = $OperationObject->Run(
    Data => {                               # data payload before Operation
        ...
    },
);

$Result = {
    Success         => 1,                   # 0 or 1
    ErrorMessage    => '',                  # in case of error
    Data            => {                    # result data payload after Operation
        ...
    },
};

HandleError()#

handle error data of the configured remote web service.

my $Result = $OperationObject->HandleError(
    Data => {                               # data payload
        ...
    },
);

$Result = {
    Success         => 1,                   # 0 or 1
    ErrorMessage    => '',                  # in case of error
    Data            => {                    # data payload after Invoker
        ...
    },
};