Kernel::System::ProcessManagement::Process - process lib
All ProcessManagement Process functions.
Don't use the constructor directly, use the ObjectManager instead:
my $ProcessObject = $Kernel::OM->Get('Kernel::System::ProcessManagement::Process');
Get process info my $Process = $ProcessObject->ProcessGet( ProcessEntityID => 'P1', ); Returns: $Process = { 'Name' => 'Process1', 'CreateBy' => '1', 'CreateTime' => '16-02-2012 13:37:00', 'ChangeBy' => '1', 'ChangeTime' => '17-02-2012 13:37:00', 'State' => 'Active', 'StartActivityDialog' => 'AD1', 'StartActivity' => 'A1', 'Path' => { 'A2' => { 'T3' => { ActivityEntityID => 'A4', }, }, 'A1' => { 'T1' => { ActivityEntityID => 'A2', }, 'T2' => { ActivityEntityID => 'A3', }, }, }, };
Get a list of all Processes my $ProcessList = $ProcessObject->ProcessList( ProcessState => ['Active'], # Active, FadeAway, Inactive Interface => ['AgentInterface'], # optional, ['AgentInterface'] or ['CustomerInterface'] or ['AgentInterface', 'CustomerInterface'] or 'all' Silent => 1 # optional, 1 || 0, default 0, if set to 1 does not log errors if there are no processes configured ); Returns: $ProcessList = { 'P1' => 'Process 1', 'P2' => 'Process 2', 'P3' => '', };
Get process startpoint my $Start = $ProcessObject->ProcessStartpointGet( ProcessEntityID => 'P1', ); Returns: $Start = { Activity => 'A1', ActivityDialog => 'AD1', };
Check valid Transitions and Change Ticket's Activity if a Transition was positively checked my $ProcessTransition = $ProcessObject->ProcessTransition( ProcessEntityID => 'P1', ActivityEntityID => 'A1', TicketID => 123, UserID => 123, CheckOnly => 1, # optional Data => { # optional Queue => 'Raw', DynamicField1 => 'Value', Subject => 'Testsubject', #... }, ); Returns: $Success = 1; # undef # if "CheckOnly" is NOT set 1 if Transition was executed and Ticket->ActivityEntityID updated undef if no Transition matched or check failed otherwise $ProcessTransition = { # if option "CheckOnly" is set 'T1' => { ActivityEntityID => 'A1', TransitionAction => [ 'TA1', 'TA2', 'TA3', ], }, };
Set Ticket's ActivityEntityID my $Success = $ProcessObject->ProcessTicketActivitySet( ProcessEntityID => 'P1', ActivityEntityID => 'A1', TicketID => 123, UserID => 123, ); Returns: $Success = 1; # undef 1 if setting the Activity was executed undef if setting failed
Set Ticket's ProcessEntityID my $Success = $ProcessObject->ProcessTicketProcessSet( ProcessEntityID => 'P1', TicketID => 123, UserID => 123, ); Returns: $Success = 1; # undef 1 if setting the Activity was executed undef if setting failed
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.