Subscribe

Multiple Input Dependencies for User Input

[ Edited ]

I have a need for mulitple input dependencies to grey or hide a field in WFA. Example: I want to grey out a field if the user chose a specific value for two of the fields above it. Right now the best that we can do is hide it but it doesn't stop the user from expanding it and selecting it so we need it compeletely disabled/greyed out.

Re: Multiple Input Dependencies for User Input

@ninja  @JoelEdstrom

 

I want to grey out a field if the user chose a specific value for two of the fields above it.

-----

 

WFA allows a limited User-Input dependency. I know it will not cover a lot of cases, but lets see.  

 

A given user-input can have dependency on one of the other User-Inputs. Only one, not more. And you need to specify the valid values for the parent/dependee User-Input. The dependent/child User-Input will be greyed out if the parent User-Input is provided with a value other than the one specified.

 

Example:

 

Here the User-Input wfa_name has dependency on other user-input wfa_ip and the valid values applicable are 10.20.30.40, 10.20.30.41 

 

So when the value for wfa_ip are either 10.20.30.40, 10.20.30.41 , the user-input wfa_name is available. Else for other values of wfa_ip, wfa_name will be greyed out and nothing will be sent to the command for execution.

 

 

 

WFA_UI_dependency.png

 

 

Now you can't make a User-Input dependent on 2 or more other user-inputs. So what can you do? I can suggest some options

 

1. Try to see if a chain dependency can work for you. User-Input A-> B and B->C

 

2. Dependency capability prevents the executor for providing values. But if you are okay that executor can provides value, but  workflow will fail in preview/planning and execution is not proceeded. 

 

Povide elaborated display Name for the User-Inputs and also descripition. This would allow the workflow executors to read and userstand the inputs they may give. Provide MVEL expressions in Advanced tab selecting "execute this command : if the following expression is true"

 

And to Abort the workflow execution if the given set of User-Inputs are not among the provided value. The error message can be provided to the executor to understand what was wrong.

 

sinhaa

 

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

Re: Multiple Input Dependencies for User Input

We have a huge dependency chain already. I also have other workflows that even if they choose something for a field I have mvel or command stop it or ignore the input. It become a pain though.

 

We have a workflow with 39 fields where it only provides half of the fields if certain criteria is met. It's a big workflow which we might decide to break up into multiple workflows but for now it's just not working out with the single input dependency even when deciding to break it into multiple workflows.

 

It would help if we could use a conditional statement in the "Dependency" area versus a single drop down.

Re: Multiple Input Dependencies for User Input

@ninja

 

It would help if we could use a conditional statement in the "Dependency" area versus a single drop down.

------

I agree. The things is this user-input dependency can be in many different ways, and it would certainly be extremely difficult to cover them all. WFA in future will certainly look to provide mosr support on this feature.

 

Lets look at your case, If your aim to have User-Input dependency is

 

1. to prevent the workflow executor ( essentially an operator ) from making a mistake while providing inputs, then User-Input Display Name and Description which appear as tool-tips will help him. I would expect a novice Operator to read the Usr-Input description.

 

2. to prevent any malicious act, then along with point (1), the workflow designer can write MVEL expressions to prevent this. Though the operator can't be prevented from providing the input

values, the MVEL can certainly fail the workflow during preview/planning in such  a case. Operator can't do anything which Admin/Architect do not want him to.

 

 

sinhaa

 

 

 

 

 

 

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