Page 1 of 1

Transformer constraint

Posted: Mon Oct 18, 2010 9:11 am
by srinivas Guduru
Hi

I am using transformer in Parallel Extender job. Transformer with two output links (First and Second), to split the input data.

I want to write a constraint for First(Link name) link.

when values for perticular input column (Role_ID) has AAAAA then I need to populate PPPPP

If column (Role_ID) has BBBBB then I need to populate PPPPP
If column (Role_ID) has CCCCC then I need to populate PPPPP
If column (Role_ID) has DDDDD then I need to populate PPPPP
If column (Role_ID) has EEEEE then I need to populate PPPPP

And I need to direct all these records (Role_ID has AAAAA, BBBBB, CCCCC, DDDDD, EEEEE) to First (Link name) output link.



About Second output link of the transformer

I naeed direct all the records (every record of the input) to the Second output link of the transforme


And I am using the following condition on the First link constraint, but not working

IF Today.PO_ROLE_CD = "OWTR " then Today.PO_ROLE_CD = "PPPPP" else IF Today.PO_ROLE_CD = "TRST " then Today.PO_ROLE_CD = "PPPPP" else
IF Today.PO_ROLE_CD = "CUSN " then Today.PO_ROLE_CD = "PPPPP" else IF Today.PO_ROLE_CD = "BRKR " then Today.PO_ROLE_CD = "PPPPP"

I am looking for the solution

Thanks

Posted: Mon Oct 18, 2010 9:19 am
by chulett
Constraints are expressions that evaluate to True or False and which control whether the link 'fires' or not, i.e. if data is allowed down it or not. What you've posted are assignments, in other words expressions that belong in the derivation of specific output fields, not in a constraint.

Can any one send me the soln

Posted: Mon Oct 18, 2010 9:56 am
by srinivas Guduru
For my question can any one send the solution please

Posted: Mon Oct 18, 2010 10:16 am
by chulett
I'd clarified what you need to do and hoped you'd put some effort into figuring out the rest but if you are looking for something more 'silver platter', then fine...

The first link constraint should be something like:

Code: Select all

Today.Role_ID = "AAAAA" or Today.Role_ID = "BBBBB" or Today.Role_ID = "CCCCC" or Today.Role_ID = "DDDDD" or Today.Role_ID = "EEEEE"
For the second link to pass all records, simple leave the contraint empty. You'll still need to use what you posted as derivations.

Posted: Wed Oct 20, 2010 5:46 am
by srinivas.nettalam
you cannot populate a value in the constraint.you need to write the conditions in the derivation for a field in the output.If you want to restrict the records on the conditions then
For first o/p link contstraint :

column (Role_ID) ='AAAAA' OR column (Role_ID) ='BBBBB' OR column (Role_ID)='CCCCC' OR column (Role_ID)= 'DDDDD' OR column (Role_ID)='EEEEE'

Please clarify where you need to populate 'PPPPP'

Posted: Wed Oct 20, 2010 7:46 am
by chulett
You are very right and noted pretty much everything I did in my reply. However, the post is marked as 'Resolved', something I did after receiving a private message from the OP saying that everything now worked, so I don't think they'll be back to this thread. :wink: