Monday, February 13, 2017

XPath: check if property is null

Suppose you are receiving an object with a testProperty property in input...
For example:
case 1)
{
 "testProperty":null
}
or
case 2)
{
 "testProperty":"test"
}

Please declare the property in this way:
<property xmlns:cct="http://www.tempuri.org/" name="custom_property_name" expression="//testProperty/text()" scope="default" type="STRING"/>

and test it in this way:
<log level="custom">
    <property expression="boolean(get-property('custom_property_name'))" name="message"/>

</log>

The output will be:
case 1)
INFO - LogMediator message= false
case 2)
INFO - LogMediator message= true


Bye...


2 comments:

  1. Инстраграмм остается самой популярной на данный момент площадкой для продвижения своего бизнеса. Но, как показывает практика, люди гораздо чаще подписываются на профили в каких уже достаточное количество подписчиков. Если заниматься продвижение своими силами, потратить на это можно очень немало времени, поэтому еще лучше обратиться к спецам из Krutiminst.ru на сайт https://raymondjdwo65432.therainblog.com/16391221/ways-to-get-instagram-followers-quick

    ReplyDelete
  2. Your car could be stolen if you don't keep this in mind!

    Imagine that your vehicle was taken! When you visit the police, they inquire about a specific "VIN search"

    A VIN decoder is what?

    Similar to a passport, the "VIN decoder" allows you to find out the date of the car's birth and the identity of its "parent"( manufacturing plant). You can also find out:

    1.Type of engine

    2.Automobile model

    3.The DMV's limitations

    4.The number of drivers in this vehicle

    You will be able to locate the car, and keeping in mind the code ensures your safety. The code can be checked in the database online. The VIN is situated on various parts of the car to make it harder for thieves to steal, such as the first person seated on the floor, the frame (often in trucks and SUVs), the spar, and other areas.

    What if the VIN is intentionally harmed?

    There are numerous circumstances that can result in VIN damage, but failing to have one will have unpleasant repercussions because it is illegal to intentionally harm a VIN in order to avoid going to jail or calling the police. You could receive a fine of up to 80,000 rubles and spend two years in prison. You might be stopped by an instructor on the road.

    Conclusion.

    The VIN decoder may help to save your car from theft. But where can you check the car reality? This is why we exist– VIN decoders!

    ReplyDelete