diff --git a/app/models/service_template_transformation_plan_request.rb b/app/models/service_template_transformation_plan_request.rb index 53d22b034f7e..5d92b2635bf3 100644 --- a/app/models/service_template_transformation_plan_request.rb +++ b/app/models/service_template_transformation_plan_request.rb @@ -28,4 +28,13 @@ def cancel update_attributes(:cancelation_status => MiqRequest::CANCEL_STATUS_REQUESTED) miq_request_tasks.each(&:cancel) end + + def update_request_status + super + if request_state == 'finished' && status == 'Ok' + call_automate_event_queue("request_completed_with_success") + elsif request_state == 'finished' && status != 'Ok' + call_automate_event_queue("request_completed_with_failure") + end + end end