Skip required validation on submitTask

Hi!

I have a task view with some inputs with validation - required = true. It’s ok for completeTask action (completing task without filling this inputs would be incorrect), but I want to skip it for submitTask action. If there’s no validation, submit action acts as desired (just save data and keep task alive), but if there is any validation, user can’t submit task if required inputs are empty.

I am trying something with property bindings expression and data flow implementation for submitTask flow, but I’m afraid I don’t have enough skills to do that…

Inputs are located on the document associated to task (TaskData), something like this:
#{Vr03codificarviewdefaultviewview.vr03codificar.taskData.vrcodificatesoreria.decideCodificador}

but I don’t know how to change the validation property for this input…

Any idea would be appreciate… In that direction or any other way to do that, of course :happy:

Thanks!!!

Marta

If I understood, you have some Business Data sent as part of the task, lets say a simple document:

DocumentName
Element1 ( Optional)
Element2 (Optional)

You can submit a task with this 2 elements empty because they are optional.

Now in your task view, you can add some CAF validation to ensure user enters valid data before completing the task.

For this refer to http://techcommunity.softwareag.com/ecosystem/documentation/webmethods/wmsuite8_ga/Designer/8-0-SP1_Designer_CAF_Development_Help.pdf and check page 776:

If the default validators don’t suit your requirements, you can create custom ones.

Hope this helps and I understood your question :smiley:

Hi DevNull43,

thanks for your replay, but what I want to do is to skip this CAF validation if user clicks the “Submit” button, but keep validation if user clicks the “Complete” button. (complete task = validate; submit task = don’t validate)

What I’m trying to do is: if users just wants to save new data filled in the form but without completing the task (Submit instead of Complete), I want them to be able to do it without filling in the required inputs. But if they want to complete the task, they must fill in the required inputs.

And you’re right: all elements in Business Data Doc are optional and I make validations only in CAF (thanks for explaining; I forgot to be more specific :o)

Thank you!!

You should be able to enable/disable validators on “submit” or “complete” buttons.

You can edit data flow for both actions, and only enable validation from the button you need.

It’s what I’m trying to do, but I’m afraid I have not skills enough to do it… I don’t know which code I must write in the data flow to change the input binding validation.

I’m sure is something easy, but I don’t find anywhere an example…

Thanks!

Sorry. I’ve deleted this post because the solution I’ve written is not a real solution… It doesn’t work!!

1.- Create a new Boolean Data Binding
2.- On the “required” value for the input we want to validate, search for this new Data Binding value instead of assigning true/false.
3.- Set this new binding value to true or false on the Data Flow Implementation for Submit or Complete buttons (as desired)

It was easy…

I tried this before, but it didn’t work because I created the new Data Binding as a string instead of a Boolean (and String doesn’t works, obviously… must be boolean)

If it helps, the SAG Support told me that the javascript function “removeValidator” only works for validators created with javascript function “addValidators”, not for validation/required added with property of controls…

Thanks for trying to help :slight_smile:

Marta