Kurro Lopez · Oct 29

Use Rule to call WS 1 to n

Hi all.

I'm trying to create a route rule that can call to a web service according to a parameter of a message.

My first attempt is the following:

I have a common class with all information, BuscarHuecoRequest, and check what is the value of property "CodigoProveedor".

The table T_PROVEEDOR contains the list of code with the code of the provider, if is F, calls to WSF, if is C, calls to WSC, etc... Using a transformation to convert the values to this provider.

It raises an error, because the property CodigoProveedor doesn't exist.

I've debugged and I see the following code:

I evaluated the variable pContext and, as expected, this property doesn't exists.

How can evaulate the values of messages?

Also, the anserw of the ws is recived to the same Rule? I mean, if the WS has a response, the response value is retorned to the route and send to the caller process?

Best regards,
Kurro Lopez

Product version: Ensemble 2017.1
$ZV: Cache for Windows (x86-64) 2017.2.1 (Build 801_3U) Thu Apr 12 2018 10:02:23 EDT
1 0 1 53
Log in or sign up to continue

Hey Kurro.

To access values from your message class, you will need to alter your references to your class in your if statements.

For example, rather than just calling "CodigoProveedor", you will need to state "Document.CodigoProveedor" so that the router is looking for "CodigoProveedor" within the document received by the router.

You can test this by adding a new "When" within your Rule and use the expression editor to start type "Document.Cod" and this should then start giving you autocomplete options. For example:

As an aside (and because it's caught me out a few times) if your router is working with just custom classes and not HL7, do make sure your router is a General message router and not a HL7 message router as this can sometimes lead to odd errors.