Class: Pindo::TaskSystem::JPSWorkFlowMessageTask
- Defined in:
- lib/pindo/module/task/model/jps/jps_workflow_message_task.rb
Overview
JPS 工作流消息发送任务使用 commit_log/send_message 接口发送 Git commit 消息到工作流
Instance Attribute Summary collapse
-
#branch ⇒ Object
readonly
Returns the value of attribute branch.
-
#git_commit_desc ⇒ Object
readonly
Returns the value of attribute git_commit_desc.
-
#git_commit_id ⇒ Object
readonly
Returns the value of attribute git_commit_id.
-
#git_commit_time ⇒ Object
readonly
Returns the value of attribute git_commit_time.
-
#project_id ⇒ Object
readonly
Returns the value of attribute project_id.
-
#workflow_id ⇒ Object
readonly
Returns the value of attribute workflow_id.
Attributes inherited from JPSTask
#app_info_obj, #project_name, #workflow_info
Attributes inherited from PindoTask
#callbacks_setup, #context, #created_at, #dependencies, #error, #finished_at, #id, #max_retry_count, #metadata, #name, #priority, #result, #retry_count, #retry_delay, #retry_mode, #skip_count, #started_at, #status, #task_key, #task_manager, #type
Class Method Summary collapse
-
.task_key ⇒ Object
任务键.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ JPSWorkFlowMessageTask
constructor
初始化工作流消息发送任务.
- #validate ⇒ Object
Methods inherited from JPSTask
default_retry_count, default_retry_delay, default_retry_mode, task_type, task_type_name
Methods inherited from PindoTask
#before_retry, #cancel, #cancelled?, #check_cancelled!, #data_param, default_retry_count, default_retry_delay, default_retry_mode, #do_task, #execution_time, #finished?, #get_all_data_params, #get_all_data_params_by_key, #get_all_dependencies_results, #get_data_param, #get_data_param_by_key, #get_dependency_result, #get_dependency_task, #on, #primary_data_param, #release_resource, #release_resources, #required_resources, #reset_for_retry, #retryable?, #running?, #should_retry?, task_type, #with_resource, #with_resources
Constructor Details
#initialize(options = {}) ⇒ JPSWorkFlowMessageTask
初始化工作流消息发送任务
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/pindo/module/task/model/jps/jps_workflow_message_task.rb', line 29 def initialize( = {}) @git_commit_id = [:git_commit_id] @git_commit_time = [:git_commit_time] @git_commit_desc = [:git_commit_desc] @project_id = [:project_id] @workflow_id = [:workflow_id] @branch = [:branch] || 'master' @single = .fetch(:single, true) # 消息发送任务优先级为 LOW,确保在其他任务之后执行 [:priority] ||= TaskPriority::LOW super("JPS 发送工作流消息", ) end |
Instance Attribute Details
#branch ⇒ Object (readonly)
Returns the value of attribute branch.
11 12 13 |
# File 'lib/pindo/module/task/model/jps/jps_workflow_message_task.rb', line 11 def branch @branch end |
#git_commit_desc ⇒ Object (readonly)
Returns the value of attribute git_commit_desc.
10 11 12 |
# File 'lib/pindo/module/task/model/jps/jps_workflow_message_task.rb', line 10 def git_commit_desc @git_commit_desc end |
#git_commit_id ⇒ Object (readonly)
Returns the value of attribute git_commit_id.
10 11 12 |
# File 'lib/pindo/module/task/model/jps/jps_workflow_message_task.rb', line 10 def git_commit_id @git_commit_id end |
#git_commit_time ⇒ Object (readonly)
Returns the value of attribute git_commit_time.
10 11 12 |
# File 'lib/pindo/module/task/model/jps/jps_workflow_message_task.rb', line 10 def git_commit_time @git_commit_time end |
#project_id ⇒ Object (readonly)
Returns the value of attribute project_id.
11 12 13 |
# File 'lib/pindo/module/task/model/jps/jps_workflow_message_task.rb', line 11 def project_id @project_id end |
#workflow_id ⇒ Object (readonly)
Returns the value of attribute workflow_id.
11 12 13 |
# File 'lib/pindo/module/task/model/jps/jps_workflow_message_task.rb', line 11 def workflow_id @workflow_id end |
Class Method Details
.task_key ⇒ Object
任务键
14 15 16 |
# File 'lib/pindo/module/task/model/jps/jps_workflow_message_task.rb', line 14 def self.task_key :jps_workflow_message end |
Instance Method Details
#validate ⇒ Object
44 45 46 47 |
# File 'lib/pindo/module/task/model/jps/jps_workflow_message_task.rb', line 44 def validate # 参数可以从依赖任务获取,这里不做严格验证 true end |