Implementing business rules

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
cmermingas
Participant
Posts: 1
Joined: Wed Feb 28, 2007 3:19 pm

Implementing business rules

Post by cmermingas »

<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>
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

Welcome Aboard!!!

I guess there is nothing as specific but if you can share your logic someone from here can shred it or show alternative approach like pattern matching.
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Post by Minhajuddin »

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.
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>
Post Reply