After you have imported or imported and partially set up the sample, the pattern authoring project is automatically opened. You can now create the pattern plug-ins and run the message flow.
You can confirm the pattern works by following these steps:
You can now run the message flow.
An example input test message and the corresponding output message, which is produced by the MQOutput node, are provided so that you can confirm that the sample has worked.
The test message that is used to run this sample is an XML message containing a date in Coordinated Universal Time (UTC) format (YYYY-MM-DD). The message is based on the following format, with carriage returns added to aid readability:
<?xml version="1.0" encoding="UTF-8"?> <solar:sun xmlns:solar="http://caspian.hursley.ibm.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://caspian.hursley.ibm.com solar.xsd"> <solar:dateQuery>2010-04-15</solar:dateQuery> </solar:sun>
To run the message flow:
<?xml version="1.0" encoding="UTF-8"?> <solar:sun xmlns:solar="http://caspian.hursley.ibm.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://caspian.hursley.ibm.com solar.xsd"> <solar:dateQuery>2010-04-15</solar:dateQuery> </solar:sun>
You might want to try different dates in place of 2010-04-15.
Note: It is important that there are no line breaks in the input message.
Note: The times at which sunrise, sunset, and twilight occur vary, depending upon the location and the time of year. These times are not defined for some locations at certain times in the year.
The output message from the MQOutput node is similar to the input message, but is appended with the derived sunrise and sunset times.
The following code shows the expected output message, formatted with carriage returns to aid readability.
<?xml version="1.0" encoding="UTF-8"?> <solar:sun xmlns:solar="http://caspian.hursley.ibm.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://caspian.hursley.ibm.com solar.xsd"> <solar:dateQuery>2010-04-15</solar:dateQuery> <sunEventTime> <sunrise>2010-04-15 06:09:34 Europe/London</sunrise> <sunset>2010-04-15 20:01:29 Europe/London</sunset> <transit>2010-04-15 13:05:31 Europe/London</transit> <civil_twilight_begin>2010-04-15 05:34:33 Europe/London</civil_twilight_begin> <civil_twilight_end>2010-04-15 20:36:29 Europe/London</civil_twilight_end> <nautical_twilight_begin>2010-04-15 04:51:06 Europe/London</nautical_twilight_begin> <nautical_twilight_end>2010-04-15 21:19:57 Europe/London</nautical_twilight_end> <astronomical_twilight_begin>2010-04-15 04:02:23 Europe/London</astronomical_twilight_begin> <astronomical_twilight_end>2010-04-15 22:08:40 Europe/London</astronomical_twilight_end> </sunEventTime> </solar:sun>