Transition#

NAME#

Kernel::System::ProcessManagement::DB::Transition

DESCRIPTION#

Process Management DB Transition backend

PUBLIC INTERFACE#

new()#

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

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

TransitionAdd()#

add new Transition

returns the id of the created Transition if success or undef otherwise

my $ID = $TransitionObject->TransitionAdd(
    EntityID    => 'T1',                                            # mandatory, exportable unique identifier
    Name        => 'NameOfTransition',                              # mandatory
    Config   => {                                                   # mandatory, transition configuration to be stored in YAML format
        Scope         => 'Process',                                 # mandatory, default 'Global' (Process|Global)
        ScopeEntityID => 'Process-9690ae9ae455d8614d570149b8ab1199' # ScopeEntityID, used if specific scope is set e.g. 'Process'
    },
    UserID      => 123,                                             # mandatory
);

Returns:

$ID = 567;

TransitionDelete()#

delete an Transition

returns 1 if success or undef otherwise

my $Success = $TransitionObject->TransitionDelete(
    ID      => 123,
    UserID  => 123,
);

TransitionGet()#

get Transition attributes

my $Transition = $TransitionObject->TransitionGet(
    ID            => 123,            # ID or EntityID is needed
    EntityID      => 'T1',
    UserID        => 123,            # mandatory
);

Returns:

$Transition = {
    ID           => 123,
    EntityID     => 'T1',
    Name         => 'some name',
    Config         => {
        Scope         => 'Process',
        ScopeEntityID => 'Process-9690ae9ae455d8614d570149b8ab1199',
    },
    CreateTime   => '2012-07-04 15:08:00',
    ChangeTime   => '2012-07-04 15:08:00',
};

TransitionUpdate()#

update Transition attributes

returns 1 if success or undef otherwise

my $Success = $TransitionObject->TransitionUpdate(
    ID          => 123,                                                 # mandatory
    EntityID    => 'T1',                                                # mandatory, exportable unique identifier
    Name        => 'NameOfTransition',                                  # mandatory
    Config   => {                                                       # mandatory, transition configuration to be stored in YAML format
        Scope         => 'Global',                                      # mandatory, default 'Global' (Process|Global)
        ScopeEntityID => 'Process-9690ae9ae455d8614d570149b8ab1199',    # ScopeEntityID, used if specific scope is set e.g. 'Process'
    }

    UserID      => 123,                                                 # mandatory
);

TransitionList()#

get an Transition list

my $List = $TransitionObject->TransitionList(
    UseEntities => 0,                       # default 0, 1 || 0. if 0 the return hash keys are
                                            #    the transition IDs otherwise keys are the
                                            #    transition entity IDs
    UserID      => 1,
);

Returns:

$List = {
    1 => 'NameOfTransition',
}

or

$List = {
    'T1' => 'NameOfTransition',
}

TransitionListGet()#

get a Transition list with all Transition details

my $List = $TransitionObject->TransitionListGet(
    UserID => 1,
);

Returns:

$List = [
    {
        ID         => 123,
        EntityID   => 'T1',
        Name       => 'some name',
        Config     => $ConfigHashRef,
        CreateTime => '2012-07-04 15:08:00',
        ChangeTime => '2012-07-04 15:08:00',
    }
    {
        ID         => 456,
        EntityID   => 'T2',
        Name       => 'some name',
        Config     => $ConfigHashRef,
        CreateTime => '2012-07-04 15:09:00',
        ChangeTime => '2012-07-04 15:09:00',
    }
];