
####
Base
####


****
NAME
****


Kernel::System::ProcessManagement::TransitionValidation::Base - Base Module for Transition Validation Module


***********
DESCRIPTION
***********


All Base functions.


****************
PUBLIC INTERFACE
****************


new()
=====


Don't use the constructor directly, use the ObjectManager instead:


.. code-block:: perl

     my $TransitionValidationBaseObject = $Kernel::OM->Get('Kernel::System::ProcessManagement::TransitionValidation::Base');



Validate()
==========


Validates Data.


.. code-block:: perl

     my $Match = $TransitionValidationBaseObject->Validate(
         Data => {
             # TicketData
             TicketID          => 1,
             DynamicField_Make => [
                'Test1',
                'Test2',
                'Test3'
             ],
             # [...]
         },
         FieldName    => 'DynamicField_Make',
         'Transition' => {
             'Name'      => 'Transition 2',
             'Condition' => {
                 'Type'             => 'and',
                 'ConditionLinking' => 'and',
                 'Condition 1'      => {
                     'Fields' => {
                         'DynamicField_Make' => $VAR1->{'Condition'}
                     },
                 },
             },
         },
         TransitionName     => 'Transition 2',
         TransitionEntityID => 'T1903007681700000',
 
         Condition          => {
             Match => 'Test4',
             Type  => 'String',
         },
         ConditionName    => 'Condition 1',
         ConditionType    => 'and',
         ConditionLinking => 'and',
     );


Returns:


.. code-block:: perl

     my $Valid = 1;        # or undef, only returns 1 if Queue is 'Raw'



CheckValueGet()
===============


Returns the value of field (FieldName, field to be checked) from Data
and also uses template generator to replace smart tags.


.. code-block:: perl

     my $CheckValue = $TransitionValidationBaseObject->CheckValueGet(
         Data       => {
             Queue => 'Raw',
             # ...
         },
         FieldName => 'Queue',
     );
 
     Returns:
 
     my $CheckValue = 'Raw';


Smart tags are also supported in simple structure.


.. code-block:: perl

     my $CheckValue = $TransitionValidationBaseObject->CheckValueGet(
         Data       => {
             Queue => 'Raw',
             DynamicField_Queue => 'Postmaster',
             # ...
         },
         FieldName => '<OTRS_TICKET_DynamicField_Queue>',
     );


Returns:


.. code-block:: perl

     my $CheckValue = 'Postmaster';


Smart tags are also supported in complex structure.


.. code-block:: perl

     my $CheckValue = $TransitionValidationBaseObject->CheckValueGet(
         Data       => {
             Queue => 'Raw',
             DynamicField_Queue => '<OTRS_TICKET_DynamicField_Junk>',
             DynamicField_Junk => 'Junk',
             # ...
         },
         FieldName => '<OTRS_TICKET_DynamicField_Queue>',
     );


Returns:


.. code-block:: perl

     my $CheckValue = 'Junk';



MatchValueGet()
===============


Actually the value that must match is stored in Match ($Param{Condition}->{Match}).
Since module validations contain the module itself, the value is stored in Value ($Param{Condition}->{Value}).
Uses template generator to replace smart tags.


.. code-block:: perl

     my $MatchValue = $TransitionValidationBaseObject->MatchValueGet(
         Data       => {
             Queue => 'Poster',
             # ...
         },
         MatchValue => 'Raw',
     );


Returns:


.. code-block:: perl

     my $MatchValue = 'Raw';


Smart tags are also supported in simple structure.


.. code-block:: perl

     my $MatchValue = $TransitionValidationBaseObject->MatchValueGet(
         Data       => {
             Queue => 'Raw',
             DynamicField_Queue => 'Postmaster',
             # ...
         },
         MatchValue => '<OTRS_TICKET_DynamicField_Queue>',
     );


Returns:


.. code-block:: perl

     my $MatchValue = 'Postmaster';



ValueValidate()
===============


Description.


.. code-block:: perl

     my $Value = $TransitionValidationBaseObject->ValueValidate(
         Value => 123,
     );


Returns:


.. code-block:: perl

     my $Value = 1;



Equal()
=======



.. code-block:: perl

     my $Match = $TransitionValidationBaseObject->Equal(
         $CheckValue,
         $MatchValue,
     );


Returns:


.. code-block:: perl

     my $Match = 1;



NotEqual()
==========



.. code-block:: perl

     my $Match = $TransitionValidationBaseObject->NotEqual(
         $CheckValue,
         $MatchValue,
     );


Returns:


.. code-block:: perl

     my $Match = 1;



GreaterThan()
=============



.. code-block:: perl

     my $Match = $TransitionValidationBaseObject->GreaterThan(
         $CheckValue,
         $MatchValue,
     );


Returns:


.. code-block:: perl

     my $Match = 1;



LessThan()
==========



.. code-block:: perl

     my $Match = $TransitionValidationBaseObject->LessThan(
         $CheckValue,
         $MatchValue,
     );


Returns:


.. code-block:: perl

     my $Match = 1;



GreaterThanOrEqual()
====================



.. code-block:: perl

     my $Match = $TransitionValidationBaseObject->GreaterThanOrEqual(
         $CheckValue,
         $MatchValue,
     );


Returns:


.. code-block:: perl

     my $Match = 1;



LessThanOrEqual()
=================



.. code-block:: perl

     my $Match = $TransitionValidationBaseObject->LessThanOrEqual(
         $CheckValue,
         $MatchValue,
     );


Returns:


.. code-block:: perl

     my $Match = 1;



Contains()
==========



.. code-block:: perl

     my $Match = $TransitionValidationBaseObject->Contains(
         $CheckValue,
         $MatchValue,
     );


Returns:


.. code-block:: perl

     my $Match = 1;



NotContains()
=============



.. code-block:: perl

     my $Match = $TransitionValidationBaseObject->NotContains(
         $CheckValue,
         $MatchValue,
     );


Returns:


.. code-block:: perl

     my $Match = 1;




