Issue with circumstance when rule referred from a data transform
I am trying to call a decision table from a data transform. the decision table is circumstanced on a property. The rule resolution picks the appropriate rule when the applies to class of the 2 rules is same. But when they are different (like using "update page" or "for each page in" in the data transform) the base rule is being picked all the time. Looks to me like a bug in the product. Because of this we end up creating multiple data transform rules.
I don't know the specifics of the code data transforms use to determine which property to look at when dealing with circumstances, but I suspect it is similar to the way activities to do it. For an activity, the primary page of the activity is what is used to determine the property to evaulate, not the step page. That means if you define the circumstance for a rule ".foo == 'bar' ", .foo will be evaluated on the primary page of the caller, and not (as an example) on the page of the list you are iterating through. Obviously, if it doesn't exist, on the primary page, the circumstance will evaluate to false and the base version of the rule will be selected at run time. Could something like this be happening for you?
Here's what the 6.3sp1 help says about it...
The circumstance property is identified only by name, without an Applies To key part. At runtime, the system uses the Applies To class of the circumstanced rule itself to find the property and its value, to compare with the literal value in the circumstanced rule or rules. So, if a circumstanced rule is encountered during execution of an activity, the circumstance property (.CustomerType in the above example) must be found on the primary page of the activity (not on the step page of the current step).
I understand this part, where the property defined (.Foo like in your example) should be on the primary page.
When i am using Update page in data transform, my context has already moved away from the Primary page of the data transform to the page i have used in update page step. From there when i am calling a decision table using a function, the circumstance is not working. Rather if call another data transform(created in the class to which the current page is pointing to) instead of decision table and refer the decision table in the newly created Data transform, it works fine.
I feel it should work fine in both the cases. Context doesn't change. And to clarify, the property is populated on the page and has proper values.
Again, I don't know if there is an expectation that data transforms would work different than activities, but in the case of an activity, the step page is never considered for the circumstance. I would expect consistent behavior between the rules, so based on what you are describing, I think the system is behaving as I would expect. Update Page doesn't change the primary page of the data transform, as defined at runtime, even if the context of the subsequent inner steps behave that way. That's why calling a second data transform which contains just the call to the circumstanced decision table works. That second DT's primary page is in the context of the page defined in the Update Page step.
I'll be the first to admit this is a little confusing, but that's the way the system has worked since at least the early 5 series.
I suggest you make a very simple example that shows the issue, and then examine the generated java to help understand what is going on. For the transform rule, it is probably sufficient to use "actions - > show java" to view the java, but for the circumstanced decision rule, you'll probably want to use SMA to determine the exact hashed name of the source file being used so you can examine the source with the pyExtractCode activity. (the problem with using "actions - > show java" for the decision rule is that you won't see the base and circumstanced code together in one java file) /Eric