Kernel::GenericInterface::Invoker::SolMan::Common

NAME

Kernel::GenericInterface::Invoker::SolMan::Common – common invoker functions

PUBLIC INTERFACE

new()

usually, you want to create an instance of this by using Kernel::GenericInterface::Invoker->new();

PrepareRequest()

prepare the invocation of the configured remote web service.

    my $Result = $InvokerObject->PrepareRequest(
        Data => {                                               # data payload
            TicketID  => 123,
            ArticleID => 123,                                   # optional
        },
    );

Result example: { Data => { Ticket => { Title => 'some ticket title', Queue => 'some queue name', Lock => 'some lock name', # optional Type => 'some type name', # optional Service => 'some service name', # optional SLA => 'some SLA name', # optional State => 'some state name', Priority => 'some priority name', Owner => 'some user login', # optional Responsible => 'some user login', # optional CustomerUser => 'some customer user login', PendingTime => { # optional Year => 2011, Month => 12 Day => 03, Hour => 23, Minute => 05, },

                DynamicField => [                                   # optional
                    {
                        Name   => 'some name',
                        Value  => 'Value',                          # value type depends on the dynamic field
                    },
                    # ...
                ],

                Article => {
                    SenderType       => 'some sender type name',    # optional
                    AutoResponseType => 'some auto response type',  # optional
                    From             => 'some from string',         # optional
                    Subject          => 'some subject',
                    Body             => 'some body'

                    ContentType      => 'some content type',        # ContentType or MimeType and Charset is requieed
                    MimeType         => 'some mime type',
                    Charset          => 'some charset',
                    TimeUnit         => 123,                        # optional

                    Attachment => [
                        {
                            Content     => 'content'                    # base64 encoded
                            ContentType => 'some content type'
                            Filename    => 'some fine name'
                        },
                        # ...
                    ],

                    DynamicField => [                                   # optional
                        {
                            Name   => 'some name',
                            Value  => 'Value',                          # value type depends on the dynamic field
                        },
                        # ...
                    ],

                },
            },

            # Data specificly for SolMan - all data above is taken from OTRSTicketInvoker->PrepareRequest()

            Owner => {
                UserEmail     => 'mail address',
                UserFirstname => 'Admin',
                UserLastname  => 'OTRS',
                # ...
            },

            CustomerUser => {
                UserEmail     => 'mail address',
                UserFirstname => 'first name',
                UserLastname  => 'last name',
                # ...
            },

            SolMan => {
                IncidentId       => '20170101410000001',
                IncidentGuid     => '20170101410000001',
                LocalSystemGuid  => '123ABC123ABC123ABC123ABC123ABC12',
                RemoteSystemGuid => 'ABC123ABC123ABC123ABC123ABC123AB',
            },
        },
    };

HandleResponse()

Handle response from remote web service.

    my $Result = $InvokerObject->HandleResponse(
        Data => {                                               # data payload
            Error => {
                ErrorCode    => '123',                              # in case of an error
                ErrorMessage => 'an error occured',                 # in case of an error
            },
            IncidentId   => '20170101410000001',                # incident id of remote system if no error occured
        },
    );

GetRemoteSystemGuid()

Tries to read SolMan system guid from web service configuration. If the system guid is not stored, reads it synchronously via a web service request and stores it. Then it returns system guid.

    my $RemoteSystemGuid = $SolManCommonObject->GetRemoteSystemGuid();

    $RemoteSystemGuid = '123ABC123ABC123ABC123ABC123ABC12';  # or undef in case of a problem

GetLocalSystemGuid()

Creates local system guid for SolMan communication, based on OTRS SystemID.

    my $SystemGuid = $SolManCommonObject->GetLocalSystemGuid();

    $SystemGuid = '123ABC123ABC123ABC123ABC123ABC12';

SetSystemGuid()

Stores local and/or remote system guid in system configuration.

    my $Success = $SolManCommonObject->SetSystemGuid(
        LocalSystemGuid  => '123ABC123ABC123ABC123ABC123ABC12',     # optional
        RemoteSystemGuid => 'ABC123ABC123ABC123ABC123ABC123AB',     # optional
    );
Scroll to Top