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!
NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
This topic has been locked.
6 replies Latest Post - 2012-11-19T12:23:53Z by SystemAdmin
Pinned topic Component rules in type trees
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2012-11-19T12:23:53Z at 2012-11-19T12:23:53Z by SystemAdmin
Re: Component rules in type trees2012-11-15T08:35:01Z in response to sam.plylerHello,
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 PostsACCEPTED ANSWER
Re: Component rules in type trees2012-11-15T21:36:47Z in response to SystemAdminI looked into both methods, and it seems that a restriction list is my better option. I followed the instructions I found on another post but I am still getting undesired output. Here is what I tried:
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-16T21:15:41Z in response to sam.plylerNot sure we understand each other here. If the restriction list is on the output card's type tree, then nothing can forbid the mapping rules to "force" invalid data through.
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:53Z in response to sam.plylerSorry 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!