-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,22 @@ | ||
module Api | ||
class RequestTasksController < BaseController | ||
include Api::Mixins::ResourceCancel | ||
|
||
# execute queues the work. | ||
# this is typically called from within the workflow | ||
def execute_resource(type, id, _data) | ||
api_resource(type, id, "Executing") do |task| | ||
task.execute_queue | ||
end | ||
end | ||
|
||
# for a workflow/automate task, this kicks off the workflow | ||
# that workflow will call execute directly | ||
# for other types of request tasks, this queues deliver | ||
def deliver_resource(type, id, _data) | ||
api_resource(type, id, "Delivering") do |task| | ||
task.deliver_queue | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters