Scheduled Complex Workflow Event

This commit is contained in:
mr
2026-03-12 11:26:24 +01:00
parent dbc41f0326
commit ce3425e9eb

View File

@@ -9,6 +9,7 @@ import (
oclib "cloud.o-forge.io/core/oc-lib"
"cloud.o-forge.io/core/oc-lib/dbs"
"cloud.o-forge.io/core/oc-lib/models/common/enum"
"cloud.o-forge.io/core/oc-lib/models/resources/native_tools"
"cloud.o-forge.io/core/oc-lib/models/workflow_execution"
"cloud.o-forge.io/core/oc-lib/tools"
@@ -91,10 +92,10 @@ func (s *ScheduleManager) getExecution(from time.Time, to time.Time) (exec_list
}
func (s *ScheduleManager) ExecuteWorkflow(resp tools.NATSResponse) {
var m map[string]string
json.Unmarshal(resp.Payload, &m)
var event native_tools.WorkflowEventParams
json.Unmarshal(resp.Payload, &event)
access := oclib.NewRequestAdmin(oclib.LibDataEnum(oclib.WORKFLOW), nil)
if d := access.LoadOne(fmt.Sprintf("%v", m["workflow_id"])); d.Err == "" {
if d := access.LoadOne(fmt.Sprintf("%v", event.WorkflowResourceID)); d.Err == "" {
eventExec := &workflow_execution.WorkflowExecution{
WorkflowID: d.Data.GetID(),
ExecDate: time.Now(),