Creates a CommunicationLog object. Do not use new() directly, instead use the object manager. This is a class which represents a complete communication. Therefore the created instances must not be shared between processes of different communications.
Please use the object manager as follows for this class:
# Create an object, representing a new communication: my $CommunicationLogObject = $Kernel::OM->Create( 'Kernel::System::CommunicationLog', ObjectParams => { Transport => 'Email', Direction => 'Incoming', } ); # Create an object for an already existing communication: my $CommunicationLogObject = $Kernel::OM->Create( 'Kernel::System::CommunicationLog', ObjectParams => { CommunicationID => 123, } );
Update the status of a communication entry.
my $Success = $CommunicationLogObject->CommunicationStop( Status => 'Successful', # (required) Needs to be either 'Successful', 'Warning' or 'Failed' );
Returns:
1 in case of success, 0 in case of errors
Returns the communication id.
my $CommunicationID = $CommunicationLogObject->CommunicationIDGet();
Returns:
The communication id of the current communication represented by this object.
Returns the used transport.
my $Transport = $CommunicationLogObject->TransportGet();
Returns:
The transport of the current communication represented by this object.
Returns the used direction.
my $Direction = $CommunicationLogObject->DirectionGet();
Returns:
The direction of the current communication represented by this object.
Returns the current Status.
my $Direction = $CommunicationLogObject->StatusGet();
Returns:
The status of the current communication represented by this object.
Starts a log object of a given object type.
my $ObjectID = $CommunicationLogObject->ObjectLogStart( ObjectType => 'Connection' # (required) Can be 'Connection' or 'Message' );
Returns:
1 in case of success, 0 in case of errors
Stops a log object of a given object type.
my $Success = $CommunicationLogObject->ObjectLogStop( ObjectLogType => 'Connection' # (required) Can be 'Connection' or 'Message' ObjectLogID => 123, # (required) The ObjectID of the started object type );
Returns:
1 in case of success, 0 in case of errors
Adds a log entry for a certain log object.
my $Success = $CommunicationLogObject->ObjectLog( ObjectLogType => '...' # (required) To be defined by the related LogObject ObjectLogID => 123, # (required) The ObjectID of the started object type );
Returns:
1 in case of success, 0 in case of errors
Inserts or updates a lookup information.
my $Result = $CommunicationLogObject->ObjectLookupSet( ObjectID => 123, # (required) TargetObjectType => 'Article', # (required) TargetObjectID => 123, # (required) );
Returns:
<undef> - if any error occur 1 - in case of success
Gets the object lookup information.
my $Result = $CommunicationLogObject->ObjectLookupGet( TargetObjectID => '...', TargetObjectType => '...', );
Returns:
<undef> - if any error occur An hashref with object lookup information - in case info exists An empty hasref - in case info doesn't exists
Checks if a given ObjectLogType has an open Object or not.
my $Result = $CommunicationLogObject->IsObjectLogOpen( ObjectLogType => '...', # Required );
Returns:
The ObjectLogID or undef.
Private methods
Create a new communication entry.
my $Success = $CommunicationLogObject->CommunicationStart( Status => 'Processing', # (optional) Needs to be either 'Successful', 'Processing', 'Warning' or 'Failed' # In most of the cases, just 'Processing' will make sense at the very beginning # of a communication (Default: 'Processing'). AccountType => # (optional) The used account type AccountID => # (optional) The used account id );
Returns:
1 in case of success, 0 in case of errors
Recover a Communication object given an CommunicationID or ObjectLogID.
Helper Method for logging.
This software is part of the OTRS project (https://otrs.org/).
This software comes with ABSOLUTELY NO WARRANTY. For details, see the enclosed file COPYING for license information (GPL). If you did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.