You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we add validation by default as a prerequisite to saving a WIP template, that could be a frustrating experience for a builder. In that regard, I think it should be a separate capability and having an optional dry-run param for the RestCreateWorkflowAction to validate prior to saving makes sense.
I think validation goes more with the "execution" portion, but we should be able to do the validation before saving. Which means we sort of need a "save-and-execute" single API call.
Which brings back up the possibility of combining APIs.
We have
POST _plugins/_flow_framework/workflow
{
// use case template
}
followed by
POST _plugins/_flow_framework/workflow/<workflow_id>/_provision
{}
This works well for a "save WIP and finally execute when done" but in the case we have a completed/debugged template that we always want to execute, we could do that all-in-one with:
POST _plugins/_flow_framework/workflow/_provision
{
// use case template
}
Now, throw a validation param in there and we have a one-liner just like we want:
POST _plugins/_flow_framework/workflow/_provision?dryrun=true
{
// use case template
}
It's also possible to add provision=true as a param to the existing create API rather than having a new API.
+1 to this approach :
// Request
POST _plugins/_flow_framework/workflow?provision=true
{
// use case template
}
// Response
{"workflow_id":"<workflowId>"}
From what I can gather, the sequence would be as follows :
User invokes the above API with provision=true
This hits our RestCreateWorkflowAction, which passes the request to the CreateWorkflowTransportAction
The CreateWorkflowTransportAction indexes the template into the Global Context index and responds to the action listener with a workflow_id
Once we get the response back in the ResCreateWorkflowAction, we check if provision param is true and then invoke ProvisionWokflowTransportAction, which will handle validation/executing the workflow
The ProvisionWorkflowTrasportAction will respond with a workflow_id or an error if validation/execution fails
Originally posted by @dbwiddis in #88 (comment)
The text was updated successfully, but these errors were encountered: