martinweiler commented on code in PR #2952: URL: https://github.com/apache/incubator-kie-tools/pull/2952#discussion_r1977915903
########## examples/process-business-calendar/README.md: ########## @@ -330,7 +330,72 @@ curl -X GET http://localhost:8080/BusinessCalendarCreditBill \ - On next business day, timer will resume at the beginning of the next working hour/day, after the non-working hour/holiday has ended. The timer is set to fire after one second of active business time. --- +## Custom Business Calendar Flexibility +**Why Create a Custom Business Calendar?** +- Custom schedules that differ from the default behavior. +- Modify, delay, or override time calculations. +- Implement custom business logic for when tasks should be triggered. + +This guide explains how to implement a custom business calendar allowing full flexibility. + +--- + +### Creating a Custom Business Calendar + +- By default, calendar.properties is used to configure default business calendar. +- If a custom business calendar has to be implemented, calendar.properties should NOT exist. Instead, add the following property to application.properties: ```kogito.processes.businessCalendar=org.kie.kogito.calendar.CustomCalendar``` + +**Steps** +1. **Navigate to**: *examples/process-business-calendar/src/main/java/org/kie/kogito/calendar (create the org/kie/kogito/calendar directory if it does not exist)* +2. **Create a new custom business calendar class** (e.g., CustomCalendar.java). +3. Ensure it implements the BusinessCalendar interface.The implementation should be a concrete class(not an interface or abstract class). +4. Set the property ```kogito.processes.businessCalendar=org.kie.kogito.calendar.custom.CustomCalendar``` in application.properties to the fully qualified class name of the custom business calendar. +5. To test the created custom business calendar with property set in application.properties, calendar.properties should not exist. Review Comment: This sentence could be clearer, something like: `5. Remove the src/main/resources/application.properties file to allow the CustomCalendar class to get registered instead of the default BusinessCalendarImpl provided out-of-the-box.` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
