Setting parameter value to external rule from another rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've been working with iLogic for about a year and have written a fair amount of code. I feel like I've been doing it "the long way", relying almost solely on If...Then statements and Select...Case. All of my code to this point has been written as internal rules, which obviously has it's drawbacks.
I'm currently starting work on re-writing most of my coded parts with external rules so we can manage changes more efficiently. In the effort to be more efficient, I'm starting to notice a LOT of redundant code that could be written as a separate rule then called out as needed.
But I'm lost.
I'd like to write a simple rule such as this:
''''RULE TO WARN ENTERED PART DIMENSION OVER/UNDER LIMIT'''' If partDimension > maxDimension Then partDimension = maxDimension MessageBox.Show("Enter Value Between " & minDim & " and " & maxDim & " mm.", "Maximum Limit Rule", MessageBoxButton.OK, MessageBoxIcon.Error) ElseIf partDimension > minDimension Then partDimension = minDimension MessageBox.Show("Enter Value Between " & minDim & " and " & maxDim & " mm.", "Minimum Limit Rule", MessageBoxButton.OK, MessageBoxIcon.Error) End If
This rule would set limits on width and length that are drawn from an excel spreadsheet. This rule would be called on in a number of different places and the "partDimension" variable would be different in every situation (length, width, thickness, spacing between components, etc...).
My assumption is that I will be writing a second external rule that would set the desired variables, then run the rule given above with:
iLogicVb.RunExternalRule("ruleFileName")
How do I set the variables for the first rule in the secondary rules?