Question
Optum
US
Last activity: 25 Jan 2016 16:26 EST
Illegal pattern character 'T'
We are seeing this message come in our Log Files:
Illegal pattern character 'T'
It is coming based on the following :
Set x = TempList.pyLabel +"T000000.000"
Any ideas as to why this would happen? The T is a legitimate character in the date...
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems
US
Hi,
I'm sure you're not getting the error merely when you say [Set x = TempList.pyLabel +"T000000.000"] . You may be getting the error later when you attempt to use your x as some kind of pattern. A detailed stack trace would help, and knowing what the full value of x is. Thanks. /Eric
Optum
US
Hi Eric : I agree. Below is the Stack Trace:
I bolded the relavant lines.
Type java.lang.IllegalArgumentException
Message Illegal pattern character 'T'
Stack at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:786)
at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:587)
at java.text.SimpleDateFormat.(SimpleDateFormat.java:512)
at com.pega.ibm.icu.impl.pega.LocaleElements.getSimpleDateFormat(LocaleElements.java:1373)
at com.pega.ibm.icu.text.SimpleDateFormat.(SimpleDateFormat.java:93)
at com.pega.pegarules.pub.util.PRDateFormat.createRealFormat(PRDateFormat.java:1672)
at sun.reflect.GeneratedMethodAccessor64.invoke(Unknown:Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at com.pega.pegarules.pub.util.PerThreadCache$1.get(PerThreadCache.java:312)
at com.pega.pegarules.pub.util.PerThreadCache.getFormat(PerThreadCache.java:219)
at com.pega.pegarules.pub.util.PRDateFormat.format(PRDateFormat.java:464)
at com.pega.pegarules.exec.internal.util.PRDateTimeUtilsImpl.formatDateTime(PRDateTimeUtilsImpl.java:677)
at com.pegarules.generated.FormatDateTime_060201_y1l5GvB583meJC$FVNghyQ.FormatDateTime06_02_01(FormatDateTime_060201_y1l5GvB583meJC$FVNghyQ.java:121)
Hi Eric : I agree. Below is the Stack Trace:
I bolded the relavant lines.
Type java.lang.IllegalArgumentException
Message Illegal pattern character 'T'
Stack at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:786)
at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:587)
at java.text.SimpleDateFormat.(SimpleDateFormat.java:512)
at com.pega.ibm.icu.impl.pega.LocaleElements.getSimpleDateFormat(LocaleElements.java:1373)
at com.pega.ibm.icu.text.SimpleDateFormat.(SimpleDateFormat.java:93)
at com.pega.pegarules.pub.util.PRDateFormat.createRealFormat(PRDateFormat.java:1672)
at sun.reflect.GeneratedMethodAccessor64.invoke(Unknown:Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at com.pega.pegarules.pub.util.PerThreadCache$1.get(PerThreadCache.java:312)
at com.pega.pegarules.pub.util.PerThreadCache.getFormat(PerThreadCache.java:219)
at com.pega.pegarules.pub.util.PRDateFormat.format(PRDateFormat.java:464)
at com.pega.pegarules.exec.internal.util.PRDateTimeUtilsImpl.formatDateTime(PRDateTimeUtilsImpl.java:677)
at com.pegarules.generated.FormatDateTime_060201_y1l5GvB583meJC$FVNghyQ.FormatDateTime06_02_01(FormatDateTime_060201_y1l5GvB583meJC$FVNghyQ.java:121)
at com.pegarules.generated.FormatDateTime_060201_y1l5GvB583meJC$FVNghyQ.invoke(FormatDateTime_060201_y1l5GvB583meJC$FVNghyQ.java:76)
at com.pega.pegarules.generation.internal.library.LibraryRuntime.resolveAndinvokeFunctionViaReflection(LibraryRuntime.java:131)
at com.pega.pegarules.generation.internal.library.LibraryRuntime.invokeLibraryRuntime(LibraryRuntime.java:108)
at com.pega.pegarules.session.internal.mgmt.Executable.invokeLibraryRuntime(Executable.java:7910)
at com.pega.pegarules.priv.generator.LibrarySupport.resolveAndInvokeFunctionViaReflection(LibrarySupport.java:181)
at com.pegarules.generated.pega_rules_datetime.FormatDateTime(pega_rules_datetime.java:453)
at com.pegarules.generated.model.ra_model_setcorrectreceiptdate_cd3b50c227e3a7e77efbd7d2311ddd59.whenCondition_5(ra_model_setcorrectreceiptdate_cd3b50c227e3a7e77efbd7d2311ddd59.java:518)
at com.pegarules.generated.model.ra_model_setcorrectreceiptdate_cd3b50c227e3a7e77efbd7d2311ddd59.perform(ra_model_setcorrectreceiptdate_cd3b50c227e3a7e77efbd7d2311ddd59.java:145)
at com.pega.pegarules.session.internal.mgmt.Executable.applyModel(Executable.java:3909)
at com.pegarules.generated.model.ra_model_moresr_8422fa7e24f692b6a6b34a721b5d8edb.updatePage_1
Pegasystems Inc.
US
Nicole,
From the stack trace, it looks like you have an activity setcorrectreceiptdate, and it has a when condition that calls FormatDateTime, and that's where things go off the rails. Could you show us what the code in the when condition which calls FormatDateTime looks like? Are you passing in the variable x from your initial post as one of the parameters?
Thanks,
Mike
Optum
US
Hello Mike:
Yes, this is happening in the Data Transform, SetCorrectReceiptDate. The WHEN Condition is:
WHEN @(Pega-RULES:String).length(TempList.pyLabel)==8
The corresponding Property Set is:
TempList.pyLabel = TempList.pyLabel + TempList.pyLabel +"T000000.000"
Previously, TempList.pyLabel is set to @(Pega-RULES:DateTime).CurrentDateTime()
Pegasystems Inc.
US
Nicole,
Is TempList.pyLabel defined as a datetime property or a string? I know that pyLabel is generally a string and I don't see anything there at that would lead me to expect FormatDateTime to be called. If it is a datetime and you are appending a string, it may not even be so much the 'T' as any (string) char in that location that it doesn't like. You might need some sort of toString() function before the addition of "T000000.000".
Also, TempList.pyLabel = TempList.pyLabel + TempList.pyLabel +"T000000.000" is a bit confusing. Do you really mean to add the value of pyLabel to itself before appending "T000000.000"? So if TempList.pyLabel starts out as "8chrLong" and that means it goes through your property set.
TempList.pyLabel = "8chrLong" + "8chrLong" + "T000000.000"
And ends up as TempList.pyLabel = "8chrLong8chrLongT000000.000"
Definitely at that point, you don't have a datetime anymore.
Of course if you set TempList.pyLabel to @(Pega-RULES:DateTime).CurrentDateTime(), that should be longer than 8 characters, so the when should always return false. Have you looked at the generated java for line 518 of setcorrectreceiptdate to ensure that you're really going through the lines of code you expect?
Thanks,
Mike
Optum
US
Thank you Mike, for the additional analysis! These look like some great ideas to try. I will in the upcoming days.
Thanks Again!
Optum
US
Hello Mike:
Sorry for the delay in responding! I took your suggestions, and after the statement that sets TempList.pyLabel, I added another step to format the value to a Date Time.
However, the error is still occurring. Do you have any other ideas? Is the format correct, for using the function?
Thanks in Advance!!
[Set] TempList.pyLabel [equal to] TempList.pyLabel + "T000000.000"
[Set] TempList.pyLabel [equal to] @(Pega-RULES:String).toDateTime(TempList.pyLabel)