Kernel::System::ProcessManagement::DB::Activity
Process Management DB Activity backend
Don't use the constructor directly, use the ObjectManager instead:
my $ActivityObject = $Kernel::OM->Get('Kernel::System::ProcessManagement::DB::Activity');
add new Activity
returns the id of the created activity if success or undef otherwise
my $ID = $ActivityObject->ActivityAdd( EntityID => 'A1' # mandatory, exportable unique identifier Name => 'NameOfActivity', # mandatory Config => $ConfigHashRef, # mandatory, activity configuration to be stored in YAML # format UserID => 123, # mandatory );
Returns:
$ID = 567;
delete an Activity
returns 1 if success or undef otherwise
my $Success = $ActivityObject->ActivityDelete( ID => 123, UserID => 123, );
get Activity attributes
my $Activity = $ActivityObject->ActivityGet( ID => 123, # ID or EntityID is needed EntityID => 'A1', ActivityDialogNames => 1, # default 0, 1 || 0, if 0 returns an ActivityDialogs array # with the activity dialog entity IDs, if 1 returns an # ActivitiDialogs hash with the activity entity IDs as # keys and ActivityDialog Names as values UserID => 123, # mandatory );
Returns:
$Activity = { ID => 123, EntityID => 'A1', Name => 'some name', Config => $ConfigHashRef, ActiviyDialogs => ['AD1','AD2','AD3'], CreateTime => '2012-07-04 15:08:00', ChangeTime => '2012-07-04 15:08:00', }; $Activity = { ID => 123, EntityID => 'P1', Name => 'some name', Config => $ConfigHashRef, ActivityDialogs => { 'AD1' => 'ActivityDialog1', 'AD2' => 'ActivityDialog2', 'AD3' => 'ActivityDialog3', }; CreateTime => '2012-07-04 15:08:00', ChangeTime => '2012-07-04 15:08:00', };
update Activity attributes
returns 1 if success or undef otherwise
my $Success = $ActivityObject->ActivityUpdate( ID => 123, # mandatory EntityID => 'A1' # mandatory, exportable unique identifier Name => 'NameOfProcess', # mandatory Config => $ConfigHashRef, # mandatory, process configuration to be stored in YAML # format UserID => 123, # mandatory );
get an Activity list
my $List = $ActivityObject->ActivityList( UseEntities => 0, # default 0, 1 || 0. if 0 the return hash keys are # the activity IDs otherwise keys are the # activity entity IDs UserID => 1, ); Returns: $List = { 1 => 'Activity1', } or $List = { 'A1' => 'Activity1', }
get an Activity list with all activity details
my $List = $ActivityObject->ActivityListGet( UserID => 1, );
Returns:
$List = [ { ID => 123, EntityID => 'A1', Name => 'some name', Config => $ConfigHashRef, ActiviyDialogs => ['AD1','AD2','AD3'], CreateTime => '2012-07-04 15:08:00', ChangeTime => '2012-07-04 15:08:00', } { ID => 456, EntityID => 'A2', Name => 'some name', Config => $ConfigHashRef, ActiviyDialogs => ['AD3','AD4','AD5'], CreateTime => '2012-07-04 15:09:00', ChangeTime => '2012-07-04 15:09:00', } ];
search activities by process name
my $ActivityEntityIDs = $ActivityObject->ActivitySearch( ActivityName => 'SomeText', # e. g. "SomeText*", "Some*ext" or ['*SomeTest1*', '*SomeTest2*'] ); Returns: $ActivityEntityIDs = [ 'Activity-e11e2e9aa83344a235279d4f6babc6ec', 'Activity-f8194a25ab0ccddefeb4240c281c1f56' ];
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.