rfe #10423: Provide a way to access the instance of the thing that was added, modified, or deleted via workflow. (Eric Kennedy)
This commit is contained in:
parent
36c2a1458c
commit
381219a4c0
2 changed files with 14 additions and 8 deletions
|
|
@ -14,6 +14,7 @@
|
|||
- refixed #10260: WebGUI::Asset::Wobject::Gallery.pm default search date misfunction
|
||||
- fixed #9953: Matrix 2.0 - Not enough tests
|
||||
- fixed #10121: Q and A template doesn't work with default Forum Rich Editor
|
||||
- rfe #10423: Provide a way to access the instance of the thing that was added, modified, or deleted via workflow. (Eric Kennedy)
|
||||
|
||||
7.7.9
|
||||
- fixed #10266: Public Profile overrides Able to be friend
|
||||
|
|
|
|||
|
|
@ -473,14 +473,14 @@ sub deleteThingData {
|
|||
|
||||
return undef unless $self->canEditThingData($thingId, $thingDataId);;
|
||||
|
||||
$self->deleteCollateral("Thingy_".$thingId,"thingDataId",$thingDataId);
|
||||
|
||||
my ($onDeleteWorkflowId) = $db->quickArray("select onDeleteWorkflowId from Thingy_things where thingId=?"
|
||||
,[$thingId]);
|
||||
if ($onDeleteWorkflowId){
|
||||
$self->triggerWorkflow($onDeleteWorkflowId);
|
||||
$self->triggerWorkflow($onDeleteWorkflowId, $thingId,$thingDataId);
|
||||
}
|
||||
|
||||
$self->deleteCollateral("Thingy_".$thingId,"thingDataId",$thingDataId);
|
||||
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
|
@ -598,13 +598,13 @@ sub editThingDataSave {
|
|||
my ($onAddWorkflowId) = $session->db->quickArray("select onAddWorkflowId from Thingy_things where thingId=?"
|
||||
,[$thingId]);
|
||||
if ($onAddWorkflowId){
|
||||
$self->triggerWorkflow($onAddWorkflowId);
|
||||
$self->triggerWorkflow($onAddWorkflowId,$thingId,$newThingDataId);
|
||||
}
|
||||
}else{
|
||||
my ($onEditWorkflowId) = $session->db->quickArray("select onEditWorkflowId from Thingy_things where thingId=?"
|
||||
,[$thingId]);
|
||||
if ($onEditWorkflowId){
|
||||
$self->triggerWorkflow($onEditWorkflowId);
|
||||
$self->triggerWorkflow($onEditWorkflowId,$thingId,$newThingDataId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1390,7 +1390,7 @@ sub purge {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 triggerWorkflow ( workflowId )
|
||||
=head2 triggerWorkflow ( workflowId, thingId, thingDataId )
|
||||
|
||||
Runs the specified workflow when this Thingy changes.
|
||||
|
||||
|
|
@ -1404,12 +1404,17 @@ sub triggerWorkflow {
|
|||
|
||||
my $self = shift;
|
||||
my $workflowId = shift;
|
||||
WebGUI::Workflow::Instance->create($self->session, {
|
||||
my $thingId = shift ;
|
||||
my $thingDataId = shift ;
|
||||
my $workflowInstance = WebGUI::Workflow::Instance->create($self->session, {
|
||||
workflowId=>$workflowId,
|
||||
className=>"WebGUI::Asset::Wobject::Thingy",
|
||||
methodName=>"new",
|
||||
parameters=>$self->getId
|
||||
})->start;
|
||||
});
|
||||
$workflowInstance->setScratch("thingId", $thingId);
|
||||
$workflowInstance->setScratch("thingDataId",$thingDataId);
|
||||
$workflowInstance->start;
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue