cancel
Showing results for 
Search instead for 
Did you mean: 

HCI : Condition Expression in Gateway is not evaluated as expected.

former_member192561
Participant
0 Kudos

Hi Experts,


Issue: Condition Expression in Gateway used in iFlow is not working as expected.

While replicating Customers from C4C to ECC, we want to have a check to determine if the Customer already exists in ECC, if yes we want to terminate the process. If the Customer does not exist then we would like to go ahead with the replication.

In order to achieve this, while Customer is being replicated to ECC, we make a call to ECC to check the customer via Enterprise Service . If the response from ECC Contains the Customer ID then we skip the further processing of the iflow.

The condition Expression in the Gateway does not seem to work.

As shown below, we have defined a condition such that when the response does not contain element “ID”, then proceed with the process.

Thus condition expression is //ID = ‘’

When the Customer Exists, then terminate the flow. This route is flagged as default.

In the above example, response does not contain field “ID” and So the condition Expression //ID = ‘’ should be correct and process should proceed. However the iflow takes the default process and the process terminates.

In the below example condition expression “//ID” contains the value, Also the default route is chosen

So eventually iFlow does not seem to evaluate contion “//ID”. Any hint why the expression is not getting evaluated?

Accepted Solutions (1)

Accepted Solutions (1)

engswee
Active Contributor

Hi Amber

If you press F1 on the Condition Expression field, it would provide help for that field, indicating you need to use XPath for that expression.

The XPath expression that you used //ID = '' basically means check for a node named ID which has blank value.

If you want to check if node ID does not exist at all, try the following XPath expression instead:-

count(//ID) = 0

Regards

Eng Swee

Answers (1)

Answers (1)

Sriprasadsbhat
Active Contributor
0 Kudos

Hello,

You can mention the condition like below,

For Successful( having ID node )----  //ID and //ID != ''

//ID ----> Checks whether ID node exist in incoming XML.[ Returns true if it exist else false ]

//ID != '' ----> Checks whether ID node hold the value or not.

For Unsuccessful( without having ID node)---make it as default condition[ Since one of the gateway branch must contain default condition ]

Please revert back if you are still facing the issue.

Regards,

Sriprasad Shivaram Bhat

former_member192561
Participant
0 Kudos

Hi Sivaprasad,

Unfortunately, it does not work with condition //ID and //ID != ''

As you could see in the below example, the process should be terminated because there is an ID in it. However the process continues. Any hint what I'm missing here..

engswee
Active Contributor
0 Kudos

Did you see my reply above using count? I can't see properly which one is your default route. The condition should be used on the route when you don't find a customer.

former_member192561
Participant
0 Kudos

Hi Eng,

Thank you for your assistance. it works with the condition expression Count(//ID) = 0. Appreciate your response.

What I don't get is.. I have declared in the Message Property of a Content Modifier as CUSTOMER_COUNT  = Count(//ID) in sub flow.

when I try to use this in the parent flow using ${property.CUSTOMER_COUNT} = 0 , it does not seems to work. Can't I use the variables  I declare in the property section of the Content Modifier of the Sub flow in Parent iFlow ??

engswee
Active Contributor
0 Kudos

Hard to say really if such a restriction exists. If you want, only way to find out is to test it out other ways, i.e. create a property in the sub flow which is not type XPath, and see if you can access it in the parent flow.