Symptoms
When using the Redwood_TM_Escalation
process to check if a task needs to be escalated, the process fails with the following error message:
Caused by: java.lang.NullPointerException: Cannot invoke "com.redwood.scheduler.api.model.TimeWindow.getName()" because "timeWindow" is null
Cause
Redwood_TM_Escalation is checking if task need to be escalated by reviewing different parameter from Task currently waiting for reply which have reach there deadline.
However it was not taken in account that a Task may have mistakenly no Calendar (TASK_CALENDAR) and Working Hours (WorkingHours) parameter value set.
This result on Redwood_TM_Escalation to go to error
Steps to reproduce:
- Duplicate Redwood_TM_ManualTask (ie: Redwood_TM_ManualTask_t107216
- Go to Orchestrator and create a new ProcessList (PL_t107216)
- set following parameter (see screenshot below)
- deadline (ie: 01:00)
- executer (ie: your user)
- subproces (ie: test)
- Submit the processLits
- Submit Redwood_TM_Escalation
- See that it goes to error
Workaround
Answer current Task waiting for console which have reach their deadline using below query and make sure that new ProcessList/TaskList has Calendar set (even if set to Always open/close calendar).
Query to find every child job Id still in console while Task has reach the deadline set:
Select j.JobChainCall, o.Job from JobDatum o, Job j
where o.Job = j.UniqueId
and o.DatumDefinition in ( select dd.UniqueId from DatumDefinition dd where dd.Name = 'Redwood_TM_WorkflowType')
and o.ValueNumber is not null
and o.ValueDateTimeZone is not null
and o.ValueDateTimeZone <= NOW()
and j.Status = 'O'
Affected version
TaskManagement 2024.1.0.0 onward
Resolution
This issue will be fixed in a future version
Reference
ROSO-15663
Error
stderr.log:
-- JOB RUN STACK TRACE --
com.redwood.scheduler.script.api.ScriptEngineEvaluationException
at com.redwood.scheduler.script.java.impl.Java.evaluateCallableInt(Java.java:181)
at com.redwood.scheduler.script.java.impl.Java.evaluateCallable(Java.java:135)
at com.redwood.scheduler.script.java.impl.Java.evaluate(Java.java:107)
at com.redwood.scheduler.scriptjobservice.impl.ScriptJob.execute(ScriptJob.java:101)
at com.redwood.scheduler.systemjobservice.api.JobWorker.runProcessExecute(JobWorker.java:267)
at com.redwood.scheduler.systemjobservice.api.JobWorker.processExecute(JobWorker.java:204)
at com.redwood.scheduler.systemjobservice.api.JobWorker.doWork(JobWorker.java:125)
at com.redwood.scheduler.systemjobservice.api.JobWorker.doWork(JobWorker.java:64)
at com.redwood.scheduler.infrastructure.workqueue.WorkQueueWorker.run(WorkQueueWorker.java:72)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: com.redwood.scheduler.infrastructure.exception.ReplacementException
at com.redwood.scheduler.infrastructure.util.ExceptionUtil.wrap(ExceptionUtil.java:241)
at com.redwood.scheduler.script.java.impl.Java.evaluateJava(Java.java:221)
at com.redwood.scheduler.script.java.impl.Java.lambda$evaluate$1(Java.java:107)
at com.redwood.scheduler.script.java.impl.classloader.ThreadContextRunnable.call(ThreadContextRunnable.java:48)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
... 1 more
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at com.redwood.scheduler.script.java.impl.Java.evaluateJava(Java.java:217)
... 6 more
Caused by: java.lang.NullPointerException: Cannot invoke "com.redwood.scheduler.api.model.TimeWindow.getName()" because "timeWindow" is null
at Library REDWOOD.Redwood_TaskManagement//com.redwood.scheduler.app.taskmanagement.DateUtils.getTaskTimeWindow(DateUtils.java:241)
at Library REDWOOD.Redwood_TaskManagement//com.redwood.scheduler.custom.app.taskmanagement.textbuilder.Escalation.escalate(Escalation.java:283)
at Library REDWOOD.Redwood_TaskManagement//com.redwood.scheduler.custom.app.taskmanagement.textbuilder.Escalation.execute(Escalation.java:134)
at Process Definition REDWOOD.Redwood_TM_Escalation (Copy from 2024/12/05 11:55:54,773 GMT)//com.redwood.scheduler.custom.Jobdefinition_Redwood_TM_Escalation.execute(Jobdefinition_Redwood_TM_Escalation.java:user code 3)
at Process Definition REDWOOD.Redwood_TM_Escalation (Copy from 2024/12/05 11:55:54,773 GMT)//com.redwood.scheduler.custom.Jobdefinition_Redwood_TM_EscalationStub.jcsExecute(Jobdefinition_Redwood_TM_EscalationStub.java:35)
... 11 more
Comments
0 comments
Please sign in to leave a comment.