I am trying to make my type tree such that a particular element will only accept two strings. The field is a currency field, and I would only like for it to accept CAD and USD as values. I am unsure of how the logic for this would work through WTX, but what I had in mind was this.
If currency = "CAD" || currency = "USD" then set to that value, else none
I know this is a pretty basic logical statement, but there is hardly any examples on how to use syntax in this program, and I can't figure out how to use the OR operation so that I can test for both CAD and USD from one rule.
Thank you for all help!
Re: Component rules in type trees2012-11-15T08:35:01ZThis is the accepted answer. This is the accepted answer.Hello,
there's no way to "force" an output card to refuse a value based on the type tree.
If you set a component rule, then you can use the Data Audit Settings and the Audit log to detect the fact that your map created invalid data.
Another solution could be to use a "reference" series of the allowed values, and accept to map only of the proposed value is in the allowed set.
=IF (MEMBER (SomeData, Currency:Reference), SomeData, FAIL ("Invalid currency : " + SomeData))
Thinking more about it, this rule does not seem right. I'd rather check the input values and make the data invalid (via a component rule) if they are not in the allowed values.
Hope this helps.
sam.plyler 270005QXG212 Posts
Re: Component rules in type trees2012-11-15T21:36:47ZThis is the accepted answer. This is the accepted answer.
- SystemAdmin 110000D4XK
1) In my properties for the Currency element I set the Restrictions to 'Value', Ignore case to 'No', and Rule to 'Include'.
2) In the Currency code element I added 'CAD' and 'USD' to there own Include row.
3) Analyze and save type tree.
4) Rebuild source before execution
Is there something I might be missing?
Re: Component rules in type trees2012-11-16T07:55:41ZThis is the accepted answer. This is the accepted answer.
- sam.plyler 270005QXG2
Re: Component rules in type trees2012-11-16T21:15:41ZThis is the accepted answer. This is the accepted answer.
- sam.plyler 270005QXG2
The restriction list and component rules will only work on input (and make data invalid), or help reporting invalid data WAS generated (via data audit)
Pardon me if this was already what you understood
Re: Component rules in type trees2012-11-19T12:23:53ZThis is the accepted answer. This is the accepted answer.Sorry for any confusion, I was only trying to answer the question from the original posting:
"I am trying to make my type tree such that a particular element will only accept two strings. The field is a currency field, and I would only like for it to accept CAD and USD as values."
This makes no mention of input or output cards, and I was merely suggesting a restriction list (on the INPUT tree) as a simple way to achieve this.
I guess we interpreted this question differently!