Update Oclib for event generation
This commit is contained in:
@@ -106,19 +106,19 @@ func (template *Template) CreateEventContainer(exec *workflow_execution.Workflow
|
||||
container := Container{Image: "natsio/nats-box"}
|
||||
container.Command = []string{"sh", "-c"} // all is bash
|
||||
|
||||
var event *native_tools.WorkflowEventParams
|
||||
var event native_tools.WorkflowEventParams
|
||||
b, err := json.Marshal(nt.Params)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
err = json.Unmarshal(b, event)
|
||||
err = json.Unmarshal(b, &event)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
if event != nil {
|
||||
container.Args = append(container.Args, "nats pub --server "+conf.GetConfig().NatsURL+":4222 "+tools.WORKFLOW_EVENT.GenerateKey(tools.WORKFLOW_EVENT.String())+" '{\"workflow_id\":\""+event.WorkflowResourceID+"\"}'")
|
||||
if event.WorkflowResourceID != "" {
|
||||
container.Args = append(container.Args, "nats pub --server "+conf.GetConfig().NatsURL+":4222 "+tools.WORKFLOW_EVENT.GenerateKey()+" '{\"workflow_id\":\""+event.WorkflowResourceID+"\"}'")
|
||||
container.Args = []string{strings.Join(container.Args, " ")}
|
||||
template.Container = container
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user