<p>I'm relatively new to DataStage and I've found that it's very cumbersome to maintain complex business rules the way we do it. I'm wondering if there's a better way.</p><p>Say that we have business rules like these:</p><pre>
column a column b column c action
-------- -------- -------- --------
a1 b1 c1 Action 1
a2 b2 c2 Action 2
a3 b3 c3 Action 3
ELSE Action 4</pre><p>Here, a1, b1, etc. can be either fixed values or patterns (such as "*Inc").</p><p>We implement things like this by using a transformer with several outputs and we define contraints within the transformer to send each record through its corresponding output, depending on which rule (set of patterns) the record matches. The problem with this is that the constraints in the transformer become huge IF-ELSE statements that are very difficult to maintain and are prone to human mistakes.</p><p>Is there any stage (in either server or parallel jobs) that allows to implement business rules like this in a better way (i.e. <b>without</b> the IF-ELSE statements)?</p><p>Thank you!</p><p>Carlos</p>
Implementing business rules
Moderators: chulett, rschirm, roy
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
When they're this complex the usual recommendation is to move the logic into one or more routines that are called from the Transformer stage.
Some years back I implemented such a scheme, using late binding of the business rules routines - the actual routine executed was not determined until the values of the selector column was known, and could be different for different rows and different columns within the same row.
So, yes, it's do-able.
Some years back I implemented such a scheme, using late binding of the business rules routines - the actual routine executed was not determined until the values of the selector column was known, and could be different for different rows and different columns within the same row.
So, yes, it's do-able.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 467
- Joined: Tue Mar 20, 2007 6:36 am
- Location: Chennai
- Contact:
Hi Carlos!
Welcome to DSXchange! :D
You may try using the Stage variables here.
Stage variables are available in transformers.
It will make your code more manageable.
And moreover it reduces evaluation of the same expression again and again.
Welcome to DSXchange! :D
You may try using the Stage variables here.
Stage variables are available in transformers.
It will make your code more manageable.
And moreover it reduces evaluation of the same expression again and again.
Minhajuddin
<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>