Author Message
Andrew.Prokop
Joined: Oct 28, 2014
Messages: 179
Offline
I am getting odd results during the data validation phase of my dynamic task. Within my task I have getters and setters for all my task's properties. They all appear to work fine.

However, I can't strange results during my data validation phase. Within my Model I have:

public boolean validateProperties(List<String> w, List<String> e) {
boolean isValid = true;

if ((! WFUtil.validateMapping(w, e, getDataInputAssociations(), "authToken")) &&
(! WFUtil.validateEmptyProperty(authToken, "authToken", e))) {
isValid = false;
return super.validateProperties(w, e) && isValid;
}
if ((! WFUtil.validateMapping(w, e, getDataInputAssociations(), "deviceHID")) &&
(! WFUtil.validateEmptyProperty(deviceHID, "deviceHID", e))) {
isValid = false;
return super.validateProperties(w, e) && isValid;
}
if ((! WFUtil.validateMapping(w, e, getDataInputAssociations(), "telemetryFamily")) &&
(! WFUtil.validateEmptyProperty(telemetryFamily, "telemetryFamily", e))) {
isValid = false;
return super.validateProperties(w, e) && isValid;
}

return super.validateProperties(w, e) && isValid;
}

authToken deviceHID, and telemetry are all defined as private Strings. I can retrieve and use the data within the Execute code.

If I set all the values, Validate Workflow finds zero errors.

If I don't set any property values, Validate Workflow fails and it tells me that I am missing the three values.

If I only set authToken explicitly on the Property page, Validate Workflow doesn't find any problems.

If I only set authToken (or one of the other properties) through mapping, Validate Workflow tells me that I need values for the other two properties.

I based my code on the example in the development guide, but unfortunately, it only validates a single property. Do I need to do something different for multiple properties? I expect so, but I am not sure what I am supposed to do.

Thanks.
PrakashN
Joined: Jun 30, 2015
Messages: 105
Offline
Andrew,

Sorry I am not with my laptop... on personal travel. So I cant really verify your code right now, but from the looks, it appears that it is validating only one property because of the "return"s when you catch a validation msg after validating the first property. Instead of those return statements you may need to add your validation msg to the errors or warnings list and move on to validate the next property. I can help you more when I return back to work after the first week of December. If you need immediate help, please say so in your response here and someone else in the team will help you. Thanks!

Prakash Natarajan System Architecture Consulting Engineer Engagement Designer Avaya
Andrew.Prokop
Joined: Oct 28, 2014
Messages: 179
Offline
Thanks. I can wait.

Yes, the return bothered me. As I said, the example in the guide only shows one property, so I am confused as to how I would validate multiples. The fact that it would tell me that more than one was wrong confused me. I wondered how it could do that if it returned after validating the first.
Andrew.Prokop
Joined: Oct 28, 2014
Messages: 179
Offline
I got it. I removed all the return statements except the last one and it seems to work now. I found it curios that there was one inside the if statement in the design document, but figured that someone knew more than I did.

In any case, unless I hear otherwise, I am good to go. Thanks again.
Go to:   
Mobile view