
######
Entity
######


****
NAME
****


Kernel::System::ProcessManagement::DB::Entity


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


Process Management DB Entity backend


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


new()
=====


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


.. code-block:: perl

     my $EntityObject = $Kernel::OM->Get('Kernel::System::ProcessManagement::DB::Entity');



EntityIDGenerate()
==================


generate unique Entity ID


.. code-block:: perl

     my $EntityID = $EntityObject->EntityIDGenerate(
         EntityType     => 'Process',       # mandatory, 'Process' || 'Activity' || 'ActivityDialog'
                                            #    || 'Transition' || 'TransitionAction'
         UserID         => 123,             # mandatory
     );


Returns:


.. code-block:: perl

     $EntityID = 'P1';



EntitySyncStateSet()
====================


set sync state for an entity.


.. code-block:: perl

     my $Success = $EntityObject->EntitySyncStateSet(
         EntityType       => 'Process',      # 'Process' || 'Activity' || 'ActivityDialog'
                                             #   || 'Transition' || 'TransitionAction', type of the
                                             #   entity
         EntityID         => 'P1',
         SyncState        => 'not_sync',     # the sync state to set
         UserID           => 123,
     );



EntitySyncStateGet()
====================


gets the sync state of an entity


.. code-block:: perl

     my $EntitySyncState = $EntityObject->EntitySyncStateGet(
         EntityType       => 'Process',      # 'Process' || 'Activity' || 'ActivityDialog'
                                             #   || 'Transition' || 'TransitionAction', type of the
                                             #   entity
         EntityID         => 'P1',
         UserID           => 123,
     );


If sync state was found, returns:


.. code-block:: perl

     $EntitySyncState = {
         EntityType       => 'Process',
         EntityID         => 'P1',
         SyncState        => 'not_sync',
         CreateTime       => '2011-02-08 15:08:00',
         ChangeTime       => '2011-02-08 15:08:00',
     };


If no sync state was found, returns undef.


EntitySyncStateDelete()
=======================


deletes sync state of an entity.


.. code-block:: perl

     my $Success = $EntityObject->EntitySyncStateDelete(
         EntityType       => 'Process',      # 'Process' || 'Activity' || 'ActivityDialog'
                                             #   || 'Transition' || 'TransitionAction', type of the
                                             #   entity
         EntityID         => 'P1',
         UserID           => 123,
     );



EntitySyncStatePurge()
======================


deletes all entries .


.. code-block:: perl

     my $Success = $EntityObject->EntitySyncStatePurge(
         UserID           => 123,
     );



EntitySyncStateList()
=====================


gets a list of sync states.


.. code-block:: perl

     my $EntitySyncStateList = $EntityObject->EntitySyncStateList(
         EntityType       => 'Process',      # optional, 'Process' || 'Activity' || 'ActivityDialog'
                                             #   || 'Transition' || 'TransitionAction', type of the
                                             #   entity
         SyncState        => 'not_sync',     # optional, only entries with this sync state
         UserID           => 123,
     );


Returns:


.. code-block:: perl

     $EntitySyncStateList = [
         {
             EntityType       => 'Process',
             EntityID         => 'P1',
             SyncState        => 'sync_started',
             CreateTime       => '2011-02-08 15:08:00',
             ChangeTime       => '2011-02-08 15:08:00',
         },
         # ...
     ];





