Improve precision for Service Level #2179
arolfes
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We are happy to announce our new major TASKANA release. This release contains crucial changes regarding
Classification.serviceLevel
, the configuration of TASKANA and its job execution. Since these are significant changes we deviate from the regular release notes in order to provide you with more details and a guideline on how to migrate to the new version.If anything is unclear or if you need assistance during the upgrade, please reach out to us (e.g. via GitHub discussions).
Overview
taskana-common-data
andtaskana-common-test
are no longer released. They are internal test modules which should never have been released.TaskanaEngineConfiguration
TaskanaConfiguration
.TaskanaEngine
has been moved toTaskanaEngine#buildTaskanaEngine(...)
.WorkingTimeCalculator
class is replaced by an interface. An instance can be retrieved from theTaskanaEngine
.WorkingTimeCalculator
in thePriorityServiceProvider
we have created a new default methodPriorityServiceProvider#initialize(TaskanaEngine)
DaysToWorkingDaysConverter
is removed. It's method are now part of theWorkingTimeCalculator
.WorkingTimeCalculator
is replaced by a better, more compatible algorithm. This new algorithm works with completely new global configuration properties regarding the working time. This allows a user-friendly usage of the newly created precision.In order to fully embrace this feature, we are currently thinking about expanding the configuration properties to e.g. allow a working time configuration per Workbasket. As of right now this is just an idea, but the
WorkingTimeCalculator
is prepared to receive its configuration from somewhere else.taskana-core
. Previously we have provided aJobScheduler
-Example which shows how to schedule TASKANA jobs. That class is not necessary anymore. Instead the scheduling of jobs is now part of the TASKANA configuration (with new properties)TaskService#selectAndClaim(TaskQuery)
now returnOptional<Task>
instead ofTask
. Previously an Exception was thrown when the givenTaskQuery
returned 0 Tasks. That Exception is replaced with the new return type.Details / Migration Guide
Let's have a look at the details of this release and work through them step-by-step.
Removal of
taskana-common-data
andtaskana-common-test
from the release artifactsThese modules will no longer be released. If for some reason you have used them in the past reach out to us; we will find a solution. If not, you have nothing to do here.
Overhaul of
TaskanaEngineConfiguration
The
TaskanaEngineConfiguration
is the entry point to the TASKANA library. Therefore, we should start migrating here.Replace all usages of
TaskanaEngineConfiguration
withTaskanaConfiguration
(its new name).Replace the initalization with the new builder class
TaskanaConfiguration.Builder
. That builder has 4 required configuration parameters which have to be passed as constructor parameters:DataSource dataSource, boolean useManagedTransactions, String schemaName, boolean securityEnabled
. All other parameters are optional (and have a default value). They can be configured through their corresponding builder methods. Please have a look atTaskanaConfiguration.Builder
for their default values. Furthermore this builder has some copy constructors if you want to modify some values of an existingTaskanaConfiguration
.Here is a table of all changes to the TASKANA properties. If you want to keep using a properties file, please adjust your properties file according to this table. To include the TASKANA properties file you have to call
TaskanaConfiguration.Builder#initTaskanaProperties(String propertiesFile, String separator)
. This will parse all properties within that file and set them accordingly.WARNING: Since
initTaskanaProperties
is a builder function you can override previously set values through this method. Builder methods after this will also override the values of the TASKANA properties. We think this is intuitive, just wanted to give you a heads up.INFO: This table already contains new properties and describes their data types. They will be referenced later in the migration guide.
INFO: Unfortunately this table is wide and you have to scroll vertically. Alternatively you can install wide-github so that you don't have to scroll vertically anymore.
java.time.ZoneId#of(String zoneId)
Previously some TASKANA properties ignored the given separator and used
,
to separate multiple values. Now all TASKANA properties respect the givenseparator
. Please skim through your properties and replace the old hardcoded,
separator with your defined separator (default:|
).Finally, we can initialize a
TaskanaEngine
. The oldTaskanaEngineConfiguration#buildTaskanaEngine
methods were moved toTaskanaEngine#buildTaskanaEngine
in order to remove a cyclic dependency betweenTaskanaConfiguration
<->TaskanaEngine
We have introduced a valiation of the
TaskanaConfiguration
during theTaskanaConfiguration.Builder#build
method and duringTaskanaEngine#buildTaskanaEngine
. If any error occurs during startup TASKANA will throw aRuntimeException
telling you what is wrong. Adjust accordingly. Reach out to us if any error message is ambigious.Overhaul of Exceptions.
In
v4.8.0
we have introduced ErrorCodes for each Exception. During that process we already reworked all our Exceptions. Due to compatibility reasons some "legacy" Exception were still part of TASKANA. In this release we have removed them.Please adjust your usages of our Exceptions according to this table (unchanged Exceptions are not listed).
InvalidTaskStateException
andInvalidCallbackStateException
[Domain|Classification|TaskanaHistoryEvent|TaskComment|Task|User|Workbasket]NotFoundException
NotAuthorizedException
,NotAuthorizedOnWorkbasketException
andNotAuthorizedOnTaskCommentException
The
InvalidArgumentException
is now aRuntimeException
and thus does not need any error handling anymore.Increased precision of service level to milliseconds
The increased precision of the service level has some impacts on TASKANA's behaviour. We gave our best to stay compatible to the old precision (which was days only). Unfortunately it is not possible to stay 100% compatible. We've tried to adjust everything with the compatibility in mind. Please test this new behaviour intensively. It is possible that we've missed an edge case. We are prepared to release a hotfix as soon as possible.
Changes
Classification.servicelevel
using the ISO-8601 duration format without any limitations. Previous limitations (format: PnD) to the service level have been removed.2023-03-21T07:00:00.000Z
would be interpreted as "Task ist due on 21.03.2023 EOB". Because of thisTask.due
is now inclusive aswell and represents the exact last possible moment, where a Task could be finished in time. One millisecond after that timestamp means that the Task is overdue. In the given example the exact due date would be2023-03-21T06:59:59.999Z
, since that is exactly the last moment a task could be finished without beeing overdue. In order to stay compatible with existing Tasks we allow a delta of 1 millisecond between the computated due and the given due date (e.g. during an update operation). Furthermore, this allowed delta enables a more user-friendly usage with TASKANA. The adjustment from exclusive -> inclusive is done during the processing of a Task and thus is not required by the user.2023-03-25T07:00:00.000Z
. Previously TASKANA would have normalized that due date to2023-03-27T07:00:00.000Z
(Monday) by just adding 24 hours until we reach a workday. The new normalization will search for the next working slot. This is Monday at midnight (German timezone):2023-03-26T22:00:00Z
. After applying the timezone (defined in taskana.workingTime.timezone) to both timestamps and stripping the date we get27.03.2023
as a due date.WorkigTimeCalculator
is now an interface. You don't need to manually initialize it anymore. Please useTaskanaEngine#getWorkingTimeCalculator
to get an instance of aWorkingTimeCalculator
. To stay compatible with ourPriorityServiceProvider
-Interface we have addedPriorityServiceProvider#initialize(TaskanaEngine)
so that you have access to an instance of aWorkingTimeCalculator
during your Service Provider implementation.Migration
LocalTime.parse(String)
taskana.workingTime.schedule
values>WorkingTimeCalculator
please migrate accordinglyWorkingTimeCalculator
manually anymore. Please useTaskanaEngine#getWorkingtimeCalculator
WorkingTimeCalculator#workingTimeBetweenTwoTimestamps(Instant from, Instant to)
->WorkingTimeCalculator#workingTimeBetween(Instant first, Instant second)
WorkingDaysToDaysConverter
has been replaced by the newWorkingTimeCalculator
. Please adjust your method calls if you have used theWorkingDaysToDaysConverter
WorkingDaysToDaysConverter#addWorkingDaysToInstant(Instant instant, Duration workingDays)
->WorkingTimeCalculator#addWorkingTime(Instant workStart, Duration workingTime)
WorkingDaysToDaysConverter#subtractWorkingDaysFromInstant(Instant instant, Duration workingDays)
->WorkingTimeCalculator#subtractWorkingTime(Instant workStart, Duration workingTime)
WorkingDaysToDaysConverter#hasWorkingDaysInBetween(Instant left, Instant right)
->WorkingTimeCalculator#isWorkingTimeBetween(Instant first, Instant second)
WorkingDaysToDaysConverter#isWorkingDay(Instant referenceDate)
->WorkingTimeCalculator#isWorkingDay(Instant instant)
WorkingDaysToDaysConverter#isWeekend(LocalDate dateToCheck)
->WorkingTimeCalculator#isWeekend(Instant instant)
WorkingDaysToDaysConverter#isHoliday(LocalDate date)
->WorkingTimeCalculator#isHoliday(Instant instant)
WorkingDaysToDaysConverter#isGermanHoliday(LocalDate date)
->WorkingTimeCalculator#isGermanHoliday(Instant instant)
WorkingTimeCalculator
in thePriorityServiceProvider
-Interface: Use the new methodPriorityServiceProvider#initialize(TaskanaEngine)
andTaskanaEngine#getWorkingTimeCalculator
to access an instance of aWorkingTimeCalculator
.Scheduling of TASKANA jobs
We have integrated the execution of TASKANA jobs into the
taskana-core
module. Since some background jobs are crucial for TASKANA's functionality we want to include the responsibility of executing them within TASKANA. This integration creates a nestedTaskanaEngine
which the jobs use. That allows the job execution to be independent of TASKANA transactions. Therefore, the nestedTaskanaEngine
usesConnectionManagementMode.EXPLICIT
and the newJobScheduler
manages the job transactions. Please don't be irritated whenever you debug through your code. Furthermore, the initalization of the nestedTaskanaEngine
will cause duplicate log messages during the initialization of TASKANA; don't be irritated about that.If you don't want to be responsible of executing TASKANA jobs you can define
taskana.jobs.scheduler.enabled=false
. This will disable the job execution withintaskana-core
. [NOT RECOMMENDED]Enable the
JobScheduler
by setting this propertytaskana.jobs.scheduler.enabled=true
(or using the corresponding Java API configuration method).Configure the execution cycle of the new
JobScheduler
. Previously ourJobScheduler
-Example has used a cron expression for this. This is the equivalent to that.taskana.jobs.scheduler.periodTimeUnit
during startup of TASKANA> [Default: 100]taskana.jobs.scheduler.periodTimeUnit
for repeated execution> [Default: 5]taskana.jobs.scheduler.initialStartDelay
andtaskana.jobs.scheduler.period
> [Default: MINUTES]. (Must be one of [NANOSECONDS, MICROSECONDS, MILLISECONDS, SECONDS, MINUTES, HOURS, DAYS])Configure which jobs you want to have enabled. Since we have reworked all configuration properties we also recommend double checking the job configuration at this point.
INFO: You can only configure async jobs. On-demand-jobs like the ClassificationChangedJob cannot be disabled because they are crucial for TASKANAs functionality.
With our
JobScheduler
-Example you had the option to implement custom jobs and schedule them yourself. We support this usecase. Usetaskana.jobs.customJobs=< list of fully-qualified class names, separated by the property separator>
. The jobs you configure here will be initialized by our newJobScheduler
during startup. If any of the following requirements are not met TASKANA will not start:AbstractTaskanaJob
TaskanaEngine.class, TaskanaTransactionProvider.class, ScheduledJob.class
AbstractTaskanaJob
constructor).Finally you can remove your own
JobScheduler
implementation.That's it! You should be done with your migration. It is possible that we have missed something and therefore your TASKANA instance is not starting up. If this is the case you can either work through the error messages or reach out to us.
Special thanks to @arolfes and @quandor! They have worked intensively on this release and put a lot of time and effort in making this work. Thank you very much! ❤️
Complete list of features and fixes
Full Changelog: v5.10.0...v6.0.0
Beta Was this translation helpful? Give feedback.
All reactions