cubewise-code / bedrock

Bedrock is TM1 Best Practice assets built from years of TM1 experience
Other
78 stars 74 forks source link

}bedrock.chore.execution.check - inccorect determination of the day in the week #381

Closed wimgielis closed 11 months ago

wimgielis commented 1 year ago

Describe the bug The process runs fine for the tm1s.cfg parameter UseExcelSerialDate = F. When UseExcelSerialDate = T, the chore will quit where it should not.

To Reproduce Activate this configuration parameter setting and the chorequit will run, which should not be happening.

Expected behavior Correct logic irrespective of the value of the configuration parameter.

Screenshots When UseExcelSerialDate = F to have a chore that only runs on Monday, note, today is a Monday:

2664 [] INFO 2023-09-11 01:52:24.035 TM1.TILogOutput User:R*TEST CHORE MAY RUN Process:}bedrock.chore.execution.check run to check if chore should run with parameters pMonthDays:, pWeekDays:MON, pDelim:&, pStartTime:0, pEndTime:24. 2664 [] INFO 2023-09-11 01:52:24.036 TM1.TILogOutput Bedrock debug }bedrock.chore.execution.check: today MON found in list of acceptable days MON& 2664 [] INFO 2023-09-11 01:52:24.036 TM1.TILogOutput Bedrock debug }bedrock.chore.execution.check: validated the chore to run as normal. 2664 [] INFO 2023-09-11 01:52:24.036 TM1.TILogOutput Process:}bedrock.chore.execution.check completed normally

When UseExcelSerialDate = T for the same parameters:

23044 [] INFO 2023-09-11 01:34:24.033 TM1.TILogOutput User:RTEST CHORE MAY RUN Process:}bedrock.chore.execution.check run to check if chore should run with parameters pMonthDays:, pWeekDays:MON, pDelim:&, pStartTime:0, pEndTime:24. 23044 [] INFO 2023-09-11 01:34:24.033 TM1.TILogOutput Bedrock debug }bedrock.chore.execution.check: chore will quit. Could not find today SUN in list of acceptable days MON& 23044 [] INFO 2023-09-11 01:34:24.033 TM1.TILogOutput User:RTEST CHORE MAY RUN Process:}bedrock.chore.execution.check Message: Bedrock debug }bedrock.chore.execution.check: terminated the chore for the reasons stated above. 23044 [] ERROR 2023-09-11 01:34:24.033 TM1.Process Process "}bedrock.chore.execution.check": : Execution was aborted by ChoreQuit() Function. : ChoreQuit() function called

Version

Additional context Suggestions on how to solve it: https://www.tm1forum.com/viewtopic.php?t=16541

wimgielis commented 1 year ago

Additional comments on the process:

lotsaram commented 1 year ago

Thanks for this @wimgielis I have never used UseExcelSerialDate=T myself. If this is switched on does it just change the returned serial date or also change the time horizon from 1960-01-01 to 1900-01-01? Thas is if you normally pass DayNo('1959-12-31') to TM1 you woudl get an error. I would assume with UseExcelSerialDate=T this should work.

In terms of the bug itself. The most important thing is that it works for both UseExcelSerialDate=F & UseExcelSerialDate=T. The exact method from the options linked to in tm1forum isn't really important IMO. Whoever wants to do a pull srequest to fix is welcome.

wimgielis commented 1 year ago

Hello @lotsaram,

That also gives the same error message: Invalid real number "nullptr". To dates as of Jan. 1, 1960 they just add the 21916 we all know.

I can create a pull request in the coming days.