Data Infrastructure Management Software Discussions

Highlighted

Getting Command Failure as a Return Parameter

I'm trying to set up some logic around a workflow so that when one of the commands fails, it proceeds to a specific command while skipping another and vice versa when it succeeds. Does WFA provide an execution status so that I can conditionally redirect to certain commands? Or do I have to do something like code it in a try/catch within the  command itself and use the Add-WfaWorkflowParameter?

 

Thanks

2 REPLIES 2

Re: Getting Command Failure as a Return Parameter

Hi,

 

Could you please provide specific details of the objective and the use case for it? It's possible to use conditional logic and MVEL expressions to enable\disable commands based on input criteria and variable existence. It's possible to invoke a child workflow using the REST API within command code. You can query a workflows execution status using the REST API and also use:

 

  • Add-WfaWorkflowParameter
  • Get-WfaWorkflowParameter

To pass information between commands in a workflow but it depends on your use case. It might be more appropriate search for an object and use conditional logic in the preceeding command to enable or disable them depending if the object was found. It depends on the technical requirement

 

/Matt

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Re: Getting Command Failure as a Return Parameter

Matt,

 

I see what you're saying.

 

Basically I have a command A, and I want to execute command B if A fails in any generic way, and C if it succeeds. I was curious if WFA provides some sort of global return paramater indicating the status of the workflow, so that I can conditionally execute B and C based on an MVEL expression like "if wrokflowstatus == 1" or "if workflowstatus == 0".

 

Thanks

Forums