skip to main content
Corticon Server: Integration & Deployment Guide : Enabling Server handling of locales, languages, and timezones : Example of cross-locale literal dates
 

Try Corticon Now

Example of cross-locale literal dates

When a request provides dates in literal format, the date is transformed into a standard (or default format ) YYYY-MM-DD form for processing, and is returned in the same format; in other words, the date format in the request is lost. A dateTime attribute is returned in Zulu format.
If it is a requirement that the date format in the response be the same as it was in the request, you can stop the server from forcing dateTime request values in the response to Zulu format. You can set a server option that specifies that the date and dateTime formats in the response must be the same as those in the request.
Note: Attributes in a response that were not specified in its request message will have the standard date and dateTime formats for the locale.
To use literal names for input dates echoed in the response:
1. Stop the server.
2. Locate and edit the brms.properties text file.
3. Add (or update) the line com.corticon.ccserver.ensureComplianceWithServiceContract.lenientDateTimeFormat=true
4. Save the edited file.
5. Start the server.
The following request from de-DE is similar to the one in the previous topic except that is submits literal month names, in this case Sep and Okt:

<?xml version="1.0" encoding="UTF-8"?>
<CorticonRequest xmlns="urn:Corticon" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" decisionServiceName="Order_localeAware">
<ExecutionProperties>
<ExecutionProperty name="PROPERTY_EXECUTION_LOCALE" value="de-DE" />
</ExecutionProperties>
<WorkDocuments>
<Order id="Order_id_1">
<dueDate>Sep 25, 2014</dueDate>
<total xsi:nil="1" />
<myItems id="Item_id_1">
<price>10,250000</price>
<product>Ball</product>
<quantity>20</quantity>
</myItems>
</Order>
<Order id="Order_id_2">
<dueDate>Okt 9, 2014</dueDate>
<myItems id="Item_id_4">
<price>0,050000</price>
<product>Pencil</product>
<quantity>100</quantity>
</myItems>
</Order>
</WorkDocuments>
</CorticonRequest>
The response handles not only the decimal delimiter and German rule statements, it also adds a month to the dates so it calculates and then replies with Okt and Nov:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:CorticonResponse xmlns:ns1="urn:Corticon" xmlns="urn:Corticon" decisionServiceName="Order_localeAware">
<ns1:ExecutionProperties>
<ns1:ExecutionProperty name="PROPERTY_EXECUTION_LOCALE"
value="de-DE" />
</ns1:ExecutionProperties>
<ns1:WorkDocuments>
<ns1:Order id="Order_id_1">
<ns1:dueDate>Okt 26, 2014</ns1:dueDate>
<ns1:shipped>true</ns1:shipped>
<ns1:shippedOn>05/01/14 12:00:00 AM</ns1:shippedOn>
<ns1:total>205,000000</ns1:total>
<ns1:myItems id="Item_id_1">
<ns1:price>10,250000</ns1:price>
<ns1:product>Ball</ns1:product>
<ns1:quantity>20</ns1:quantity>
<ns1:subtotal>205,000000</ns1:subtotal>
</ns1:myItems>
</ns1:Order>
<ns1:Order id="Order_id_2">
<ns1:dueDate>Nov 9, 2014</ns1:dueDate>
<ns1:shipped>true</ns1:shipped>
<ns1:shippedOn>05/01/14 12:00:00 AM</ns1:shippedOn>
<ns1:total>5,000000</ns1:total>
<ns1:myItems id="Item_id_4">
<ns1:price>0,050000</ns1:price>
<ns1:product>Pencil</ns1:product>
<ns1:quantity>100</ns1:quantity>
<ns1:subtotal>5,000000</ns1:subtotal>
</ns1:myItems>
</ns1:Order>
</ns1:WorkDocuments>
<ns1:Messages version="1.10">
<ns1:Message>
<ns1:severity>Info</ns1:severity>
<ns1:text>die Zwischensumme der Posten für Ball ist 205,000000.</ns1:text>
<ns1:entityReference href="#Item_id_1" />
</ns1:Message>
<ns1:Message>
<ns1:severity>Info</ns1:severity>
<ns1:text>die Zwischensumme der Posten für Pencil ist 5,000000.</ns1:text>
<ns1:entityReference href="#Item_id_4" />
</ns1:Message>
<ns1:Message>
<ns1:severity>Info</ns1:severity>
<ns1:text>die Gesamt für die Bestellung 205,000000</ns1:text>
<ns1:entityReference href="#Order_id_1" />
</ns1:Message>
<ns1:Message>
<ns1:severity>Info</ns1:severity>
<ns1:text>die Gesamt für die Bestellung 5,000000</ns1:text>
<ns1:entityReference href="#Order_id_2" />
</ns1:Message>
<ns1:Message>
<ns1:severity>Info</ns1:severity>
<ns1:text>die Gesamt Paket versenden 05/01/14 12:00:00 AM</ns1:text>
<ns1:entityReference href="#Order_id_1" />
</ns1:Message>
<ns1:Message>
<ns1:severity>Info</ns1:severity>
<ns1:text>die Gesamt Paket versenden 05/01/14 12:00:00 AM</ns1:text>
<ns1:entityReference href="#Order_id_2" />
</ns1:Message>
</ns1:Messages>
</ns1:CorticonResponse>
</soapenv:Body>
</soapenv:Envelope>
Similarly, the following fr-FR request is similar to the one in the previous topic except that is submits literal month names, in this case avril and juillet:
Note: Case is important.

<?xml version="1.0" encoding="UTF-8"?>
<CorticonRequest xmlns="urn:Corticon" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" decisionServiceName="Order_localeAware">
<ExecutionProperties>
<ExecutionProperty name="PROPERTY_EXECUTION_LOCALE"
value="fr-FR" />
</ExecutionProperties>
<WorkDocuments>
<Order id="Order_id_1">
<dueDate>avril 25, 2014</dueDate>
<total xsi:nil="1" />
<myItems id="Item_id_1">
<price>10,250000</price>
<product>Ball</product>
<quantity>20</quantity>
</myItems>
</Order>
<Order id="Order_id_2">
<dueDate>juillet 9, 2014</dueDate>
<myItems id="Item_id_4">
<price>0,050000</price>
<product>Pencil</product>
<quantity>100</quantity>
</myItems>
</Order>
</WorkDocuments>
</CorticonRequest>
The response handles the decimal delimiter and uses English rule statements. It adds a month to the dates so it calculates and then replies with mai and août (Note that when diacritical marks are used, they must be written appropriately in the request.) :
Note: When diacritical marks are used, they must be written appropriately in the request and are formatted correctly in replies.

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:CorticonResponse xmlns:ns1="urn:Corticon" xmlns="urn:Corticon" decisionServiceName="Order_localeAware">
<ns1:ExecutionProperties>
<ns1:ExecutionProperty name="PROPERTY_EXECUTION_LOCALE"
value="fr-FR" />
</ns1:ExecutionProperties>
<ns1:WorkDocuments>
<ns1:Order id="Order_id_1">
<ns1:dueDate>mai 26, 2014</ns1:dueDate>
<ns1:shipped>true</ns1:shipped>
<ns1:shippedOn>05/01/14 12:00:00 AM</ns1:shippedOn>
<ns1:total>205,000000</ns1:total>
<ns1:myItems id="Item_id_1">
<ns1:price>10,250000</ns1:price>
<ns1:product>Ball</ns1:product>
<ns1:quantity>20</ns1:quantity>
<ns1:subtotal>205,000000</ns1:subtotal>
</ns1:myItems>
</ns1:Order>
<ns1:Order id="Order_id_2">
<ns1:dueDate>août 9, 2014</ns1:dueDate>
<ns1:shipped>true</ns1:shipped>
<ns1:shippedOn>05/01/14 12:00:00 AM</ns1:shippedOn>
<ns1:total>5,000000</ns1:total>
<ns1:myItems id="Item_id_4">
<ns1:price>0,050000</ns1:price>
<ns1:product>Pencil</ns1:product>
<ns1:quantity>100</ns1:quantity>
<ns1:subtotal>5,000000</ns1:subtotal>
</ns1:myItems>
</ns1:Order>
</ns1:WorkDocuments>
<ns1:Messages version="1.10">
<ns1:Message>
<ns1:severity>Info</ns1:severity>
<ns1:text>The subtotal of line item for Pencil is 5,000000.</ns1:text>
<ns1:entityReference href="#Item_id_4" />
</ns1:Message>
<ns1:Message>
<ns1:severity>Info</ns1:severity>
<ns1:text>The subtotal of line item for Ball is 205,000000.</ns1:text>
<ns1:entityReference href="#Item_id_1" />
</ns1:Message>
...

</ns1:Messages>
</ns1:CorticonResponse>
</soapenv:Body>
</soapenv:Envelope>
To complete the permutations, an en_US on a corresponding system, performs no special operations doe to the locale setting:

<?xml version="1.0" encoding="UTF-8"?>
<CorticonRequest xmlns="urn:Corticon" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" decisionServiceName="Order_localeAware">
<ExecutionProperties>
<ExecutionProperty name="PROPERTY_EXECUTION_LOCALE"
value="en-US" />
</ExecutionProperties>
<WorkDocuments>
<Order id="Order_id_1">
<dueDate>May 25, 2014</dueDate>
<total xsi:nil="1" />
<myItems id="Item_id_1">
<price>10.250000</price>
<product>Ball</product>
<quantity>20</quantity>
</myItems>
</Order>
<Order id="Order_id_2">
<dueDate>May 9, 2014</dueDate>
<myItems id="Item_id_4">
<price>0.050000</price>
<product>Pencil</product>
<quantity>100</quantity>
</myItems>
</Order>
</WorkDocuments>
</CorticonRequest>

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:CorticonResponse xmlns:ns1="urn:Corticon" xmlns="urn:Corticon" decisionServiceName="Order_localeAware">
<ns1:ExecutionProperties>
<ns1:ExecutionProperty name="PROPERTY_EXECUTION_LOCALE"
value="en-US" />
</ns1:ExecutionProperties>
<ns1:WorkDocuments>
<ns1:Order id="Order_id_1">
<ns1:dueDate>June 25, 2014</ns1:dueDate>
<ns1:shipped>true</ns1:shipped>
<ns1:shippedOn>5/1/14 12:00:00 AM</ns1:shippedOn>
<ns1:total>205.000000</ns1:total>
<ns1:myItems id="Item_id_1">
<ns1:price>10.250000</ns1:price>
<ns1:product>Ball</ns1:product>
<ns1:quantity>20</ns1:quantity>
<ns1:subtotal>205.000000</ns1:subtotal>
</ns1:myItems>
</ns1:Order>
<ns1:Order id="Order_id_2">
<ns1:dueDate>June 9, 2014</ns1:dueDate>
<ns1:shipped>true</ns1:shipped>
<ns1:shippedOn>5/1/14 12:00:00 AM</ns1:shippedOn>
<ns1:total>5.000000</ns1:total>
<ns1:myItems id="Item_id_4">
<ns1:price>0.050000</ns1:price>
<ns1:product>Pencil</ns1:product>
<ns1:quantity>100</ns1:quantity>
<ns1:subtotal>5.000000</ns1:subtotal>
</ns1:myItems>
</ns1:Order>
</ns1:WorkDocuments>
<ns1:Messages version="1.10">
<ns1:Message>
<ns1:severity>Info</ns1:severity>
<ns1:text>The subtotal of line item for Pencil is 5.000000.</ns1:text>
<ns1:entityReference href="#Item_id_4" />
</ns1:Message>
<ns1:Message>
<ns1:severity>Info</ns1:severity>
<ns1:text>The subtotal of line item for Ball is 205.000000.</ns1:text>
<ns1:entityReference href="#Item_id_1" />
</ns1:Message>
...

</ns1:Messages>
</ns1:CorticonResponse>
</soapenv:Body>
</soapenv:Envelope>