Skip to content

Commit

Permalink
Added code for skipping execution irrespective of the activity has ou…
Browse files Browse the repository at this point in the history
…tput or not (#194)
  • Loading branch information
abhide-tibco authored Feb 5, 2024
1 parent cfb6cae commit dce3eed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion instance/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func hasOutputInterceptor(taskInst *TaskInst) bool {

id := taskInst.flowInst.Name() + "-" + taskInst.task.ID()
taskInterceptor := master.interceptor.GetTaskInterceptor(id)
if taskInterceptor != nil && len(taskInterceptor.Outputs) > 0 {
if taskInterceptor != nil && taskInterceptor.SkipExecution {
return true
}
}
Expand Down
15 changes: 8 additions & 7 deletions support/interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,14 @@ func (pi *Interceptor) GetTaskInterceptor(taskID string) *TaskInterceptor {
// Also, a 'Skip' flag can be enabled to inform the runtime that the task should not
// execute.
type TaskInterceptor struct {
ID string `json:"id"`
Skip bool `json:"skip,omitempty"`
Inputs map[string]interface{} `json:"inputs,omitempty"`
Outputs map[string]interface{} `json:"outputs,omitempty"`
Assertions []Assertion `json:"assertions,omitempty"`
Result int `json:"result,omitempty"`
Message string `json:"message"`
ID string `json:"id"`
Skip bool `json:"skip,omitempty"`
Inputs map[string]interface{} `json:"inputs,omitempty"`
Outputs map[string]interface{} `json:"outputs,omitempty"`
Assertions []Assertion `json:"assertions,omitempty"`
SkipExecution bool `json:"skipExecution"`
Result int `json:"result,omitempty"`
Message string `json:"message"`
}

type Assertion struct {
Expand Down

0 comments on commit dce3eed

Please sign in to comment.