1 person found this helpful
Please can you explain why you can't use a regular expression here as this seems ideally suited to regex validation.
If you really need to use rules for this then something like this should fulfil your needs.
Error (“input is too long or too short”) if
Length(your employee id) <> 8
Error(“Character must be alpha”) if
Not (Contains(“ABCDEFGHIJKLMNOPQRSTUVWXYZ”, substring(your employee id, 0, 1)))
Error(“Character must be number”) if
Not (Contains(“0123456789”, substring(your employee id, 1, 1)))
Thanks for the input.The solution suggested here is working quite correctly in case of Known inputs such as Name or employee Id,but what to do in case we need to validate the email id as an input.We cannot make use of regex as we are not using interview screens.Every data supplied to the OPA needs to be validated through rules only.If there is an error with the entered data,then even it's needed to be appended in output mapped attribute.
I'm not sure I understand your use case here but I will try to help...
A regular expression is a property of the attribute not the input field so will be validated however the data is supplied e.g. assess / answer service or batch and the error shown in the response / batch output. If you don't want an error per-se, pehaps because you also want to evaluate some other determinations then you could infer attribute or even entities for each validation which fails and output these along with your other data.
I think use of the word "validate" in the original post caused some confusion. People (including myself) assumed you were talking about validating end-user input on an interview screen, i.e. prevent the end-user from supplying non-compliant input data.
From the later description, sounds like you actually want to assess whether data values comply with a particular format? And then infer some other attribute, based on whether that data value is compliant, not compliant or doesn't exist.
That is exactly what I want to do Jasmine.I want to assess data values to comply with a particular format.OPA in my case is used for back end validation only and once the third party application would supply it values to OPA ,it needs to evaluate the supplied values based on the rules,and send back the conclusion derived as an output attribute mapping.So in case if we need to evaluate the mapped input attribute email id ,then how we can determine it conformity to a particular email standards.That's my case over here is.
My apologies for the confusion earlier