cancel
Showing results for 
Search instead for 
Did you mean: 

Rowcount and resultset check - Message Mapping

Former Member
0 Kudos

Hi Experts,

If I don't get the result for the requested value for the synch webservice -> JDBC scenario(without BPM), I have to return "No records found" as a response.

Below, I have mentioned the Source and Target message Type structure.

Source Message Type:

1. JDBC_response

1.1. STATEMENT_response

1.1.1. row

1.1.1.1. EmpId

1.1.1.2. EmpName

1.1.1.3. Address

Target Message Type

1. SOAP_Response

1.1.RESPONSE

1.1.1.row

1.1.1.1. EmpId

1.1.1.2. EmpName

1.1.1.3. Address

1.1.2 Error Description

1. What function we have to use in the userdefined function to find the rowcount or to do the resultset check?

2. If the rowcount is zero, then I have to return the Error Description as a response. Where to mention the Error Description field. It should be under <b>row</b> or ?

Regards

Sara

Message was edited by:

Sara D

Accepted Solutions (1)

Accepted Solutions (1)

justin_santhanam
Active Contributor
0 Kudos

Sara,

Could you tell us the occurrences of Row-segment.

Best regards,

raj.

Former Member
0 Kudos

Hi Raj,

The rowcount will be either 1 or 0.

Whenever I execute the webservice scenario, it selects the datas from the Database.

Regards

Sara

Former Member
0 Kudos

Hi All,

Could you please tell me, how to find the row count from the response message mapping.

I have tried with <b>count</b> function for the row, but it always returns 1 even if I have not given any value for the fields.

Regards

Sara

Former Member
0 Kudos

try this

EmpId -- remove context -- count ---

as emp id is a part of returm message

Mudit

justin_santhanam
Active Contributor
0 Kudos

Sara,

Please try the below and let us know the feedback.

Mapping for Row

http://www.flickr.com/photo_zoom.gne?id=776959840&size=o

Mapping for Error-Description

http://www.flickr.com/photo_zoom.gne?id=776959924&size=o

Results

http://www.flickr.com/photo_zoom.gne?id=776959934&size=o

Map the EmpID,EmpName,Address direct mapping from source.

The logic is , if there is no response rows then it will give the Error Description alone. Similarly if there is resposnse row it won't give the Errordescription. Kindly have a look and let me know whether it matches ur reqmt.

Best regards,

raj.

Former Member
0 Kudos

Hi Raj,

Thanks for the solution. It really worked well. Nice to know about the workaround you have done for this request.

Thanks a lot.

Sara

Answers (2)

Answers (2)

prateek
Active Contributor
0 Kudos

<i>1. What function we have to use in the userdefined function to find the rowcount or to do the resultset check?</i>

U may modify ur JDBC to send row count fom the JDBC in one of its field. So it could be retreived from the payload.

Function inside UDF? graphical mapping functions could be used outside UDF as explained by Mudit.

<i>2. If the rowcount is zero, then I have to return the Error Description as a response. Where to mention the Error Description field. It should be under row or ?</i>

It could placed at 1.1.2 correctly.

Regards,

Prateek

Former Member
0 Kudos

You can do like this

row(response message) -


count - ifthenwithoutelse(constant(0))- constant(No records found) --- target

mudit