Wednesday, June 23, 2010

Fields with type int and decimal when sent in the input to Rules do not out come as in input

I created a BPEL Process which receives a XML payload which has fields of type int as well as decimal, as defined in the XSD that the payload is derived from. These fields, part of the payload, are sent in the input to Rules Dictionary using decision service activity from BPEL. In the input to rules, the XML has a couple of fields of type "int" and couple of fields of type "decimal" and the three of them are sent as empty/null. In the output from the rules however, the fields of type "int" have value of zero and fields of type "decimal" do not come out at all, even though they were empty/null and present in the input.

In the below sample, <client:DuplicateMobile/> , <client:DuplicateLan/> and  <client:DuplicateBill/> are sent as null. DuplicateMobile and DuplicateLan are of type "int" and DuplicateBill is of type "decimal". No actions are performed on these fields/facts within the rules. The input and output looks like below:


################################### Input ########################
Facts_To_BPEL_Var

<dsIn>
<part name="payload">
<callFunctionStateless name="Sample1_DecisionService_1">
<parameterList>
<Person>
<client:Name>
<client:firstName>A</client:firstName>
<client:lastName>A</client:lastName>
</client:Name>
<client:address>
<client:lineOne>1</client:lineOne>
<client:lineTwo>2</client:lineTwo>
<client:city>3</client:city>
</client:address>
<client:Phone>
<client:Mobile>4455</client:Mobile>
<client:Lan>4466</client:Lan>
<client:DuplicateMobile/>
<client:DuplicateLan/>
<client:DuplicateBill/>
<client:Bill>500</client:Bill>
</client:Phone>
<client:Status>Open</client:Status>
</Person>
</parameterList>
</callFunctionStateless>
</part>
</dsIn>
################################### End Input ########################

################################### Output ########################
replyOutput

<RulesInput>
<Person>
<Name>
<firstName>A</firstName>
<lastName>A</lastName>
</Name>
<address>
<lineOne>1</lineOne>
<lineTwo>2</lineTwo>
<city>3</city>
</address>
<Phone>
<Mobile>4455</Mobile>
<Lan>4466</Lan>
<Bill>500</Bill>
<DuplicateMobile>0</DuplicateMobile>
<DuplicateLan>0</DuplicateLan>
</Phone>
<Status>Approved</Status>
</Person>
</RulesInput>
################################### End Output ########################


I have raised a Service Request with Oracle and they have confirmed it to be a be a bug (Bug 9794889: BLANK DECIMAL FIELD INPUT TO RULES ENGINE GETS REMOVED). I do not have the resolution yet and I will update as and when I have one. If somebody is facing the same issue, workaround the issue by modifying the output from rules using a XSLT, before it is processes further !

Peace !

Cheers,
-AR

No comments:

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Unported License