cancel
Showing results for 
Search instead for 
Did you mean: 

=Time.isTimeWindowOpen in precondition failing

Former Member
0 Kudos
61

Hi Guys

I am new to CPS and I am creating a Precondition for the first time, but think soemthing in the syntax might be wrong.

I defined a Time Window called Z_Fridays to use for executing certain jobs, as you would guess, only on Friday.

I set up the following Precondition in a job chain Step:

=Time.isTimeWindowOpen(Time.now('Africa/Johannesburg'), 'Z_Fridays')

The step keeps on failing. I also tried the one below but it also fails:

=Time.isTimeWindowOpen('Z_Fridays')

The step immediately goes into error as pasted below. Anyone who can maybe assist?

1. In the first case for =Time.isTimeWindowOpen(Time.now('Africa/Johannesburg'), 'Z_Fridays') :

Full Text Job 196415 (submitted from RQ1.ProjectSettlements copy from 2010/05/07 09:11:41,852 Africa/Johannesburg) could not be started due to an error evaluating its precondition: Precondition for step Step2 Proj Settlemets AUC Fridays of Job Chain RQ1.ProjectSettlements

Reason: com.redwood.scheduler.script.api.ScriptEngineEvaluationException

2. In the second case for =Time.isTimeWindowOpen('Z_Fridays') :

Full Text Job 196392 (submitted from RQ1.ProjectSettlements copy from 2010/05/07 09:06:12,867 Africa/Johannesburg) could not be started due to an error evaluating its precondition: Precondition for step Step2 Proj Settlemets AUC Fridays of Job Chain RQ1.ProjectSettlements

Reason: com.redwood.scheduler.script.api.ScriptEngineEvaluationException: Call to Time.isTimeWindowOpen :: wrong number of arguments

Details:

com.redwood.scheduler.script.api.ScriptEngineEvaluationException: Call to Time.isTimeWindowOpen :: wrong number of arguments

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Adriaan,

I think the second case should be:

=Time.isTimeWindowOpenNow('Z_Fridays')

So with the "Now" added to the call.

Do you have the free or the enterprise version of CPS ? If the free, then your first scenario may not work.

Regards,

Anton.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Anton,

I configured it again and copy and pasted the name rahter than typing it just to make absolutely sure.

Unfortunately still the same error.

Former Member
0 Kudos

Hi Adriaan,

In which partition and isolation group did you create the time window ? GLOBAL ?

Or in another partition and isolation group ?

And in which partition is the chain created ?

If the objects are in different isolation groups, it can be that security prevents the chain from seeing the time window.

If the time window is in a partition other than GLOBAL, then try to prefix the time window name with the partition like this: PARTITION.TimeWindowName

Regards,

Anton.

Former Member
0 Kudos

Thanks for the help Anton.

Eventually I delete the custom window and used the predelivered one and this worked. Still cannot see anything wrong with the one I created as it was a straight forward copy of the predelivered one.

Former Member
0 Kudos

Oh of course, forgot to answer that part.

Using the Freebie version. Build: M28.20-37214

Thanks

Former Member
0 Kudos

Hi Adriaan,

The example works on my side, but this is a slightly different environment. I'd need to configure one more closely to yours to be sure, but before I go there: can you provide more error details ?

There should be an error stack giving more details on the script engine evaluation error.

This could be in an operator message, or in the default trace file.

Regards,

Anton.

Former Member
0 Kudos

Hi ANton, Thanks for the help.

Below is the full Operator Message. Let me know if I can send anything else.

Operator Message Job 196556 (submitted from RQ1.ProjectSettlements copy from 2010/05/07 09:50:45,443 Africa/Johannesburg) could not be started due to an error evaluating its precondition: Precondition for step Step2 Proj Settlemets AUC Fridays of Job Chain RQ1.ProjectSettlements Actions

Full Text Job 196556 (submitted from RQ1.ProjectSettlements copy from 2010/05/07 09:50:45,443 Africa/Johannesburg) could not be started due to an error evaluating its precondition: Precondition for step Step2 Proj Settlemets AUC Fridays of Job Chain RQ1.ProjectSettlements

Reason: com.redwood.scheduler.script.api.ScriptEngineEvaluationException

Details:

com.redwood.scheduler.script.api.ScriptEngineEvaluationException

at com.redwood.scheduler.script.rel.impl.RELScript.evaluate(RELScript.java:56)

at com.redwood.scheduler.apiint.model.script.ScriptRunner.runScript(ScriptRunner.java:43)

at com.redwood.scheduler.apiint.model.script.ScriptRunner.runREL(ScriptRunner.java:23)

at com.redwood.scheduler.jobchainservice.JobChainStepEngine.evaluateStepPrecondition(JobChainStepEngine.java:333)

at com.redwood.scheduler.jobchainservice.JobChainStepEngine.schedule(JobChainStepEngine.java:286)

at com.redwood.scheduler.jobchainservice.JobChainEngine.scheduleChild(JobChainEngine.java:135)

at com.redwood.scheduler.jobchainservice.AbstractStatusEngine.activateChild(AbstractStatusEngine.java:152)

at com.redwood.scheduler.jobchainservice.JobChainEngine.activateStep(JobChainEngine.java:223)

at com.redwood.scheduler.jobchainservice.JobChainEngine.advanceToNextJobChainStep(JobChainEngine.java:112)

at com.redwood.scheduler.jobchainservice.JobChainStepEngine.processContinueHandlerAction(JobChainStepEngine.java:551)

at com.redwood.scheduler.jobchainservice.JobChainStepEngine.processStatusHandler(JobChainStepEngine.java:513)

at com.redwood.scheduler.jobchainservice.JobChainStepEngine.performEndOfStepProcessing(JobChainStepEngine.java:412)

at com.redwood.scheduler.jobchainservice.JobChainStepEngine.stepFinished(JobChainStepEngine.java:401)

at com.redwood.scheduler.jobchainservice.JobChainStepEngine.processChildStatusChange(JobChainStepEngine.java:111)

at com.redwood.scheduler.jobchainservice.JobChainService.onChildJobFinalStatus(JobChainService.java:505)

at com.redwood.scheduler.jobchainservice.JobChainService.access$7(JobChainService.java:479)

at com.redwood.scheduler.jobchainservice.JobChainService$6.performWork(JobChainService.java:274)

at com.redwood.scheduler.apiint.model.UnitOfWorkManager.perform(UnitOfWorkManager.java:16)

at com.redwood.scheduler.apiint.model.UnitOfWorkManager.perform(UnitOfWorkManager.java:9)

at com.redwood.scheduler.jobchainservice.JobChainService.childJobFinalStatus(JobChainService.java:269)

at com.redwood.scheduler.core.processserver.ProcessServerRuntime.childJobFinalStatus(ProcessServerRuntime.java:969)

at com.redwood.scheduler.core.processserver.ProcessServerRuntime.onMessage(ProcessServerRuntime.java:254)

at com.redwood.scheduler.infrastructure.work.MessageEnabledWork.run(MessageEnabledWork.java:107)

at com.redwood.scheduler.infrastructure.work.WorkerImpl.run(WorkerImpl.java:109)

at java.lang.Thread.run(Thread.java:770)

Caused by: java.lang.NullPointerException

at com.redwood.scheduler.script.helper.RELSessionContextImpl.isTimeWindowOpen(RELSessionContextImpl.java:62)

at com.redwood.scheduler.script.rel.impl.functions.BaseTime.isTimeWindowOpen(BaseTime.java:133)

at com.redwood.scheduler.script.rel.impl.functions.BaseTime.isTimeWindowOpenNow(BaseTime.java:113)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)

at java.lang.reflect.Method.invoke(Method.java:391)

at com.redwood.scheduler.script.api.DirectArgsMethod.callMethod(DirectArgsMethod.java:47)

at com.redwood.scheduler.script.api.SimpleFunctionRegistry.callFunction(SimpleFunctionRegistry.java:117)

at com.redwood.scheduler.script.rel.impl.RELScriptEvaluationContextImpl.callFunction(RELScriptEvaluationContextImpl.java:76)

at com.redwood.scheduler.script.rel.impl.RELEvaluateVisitor.visit(RELEvaluateVisitor.java:445)

at com.redwood.scheduler.script.rel.parser.ASTFunctionCall.jjtAccept(ASTFunctionCall.java:14)

at com.redwood.scheduler.script.rel.impl.RELEvaluateVisitor.visitChildren(RELEvaluateVisitor.java:136)

at com.redwood.scheduler.script.rel.impl.RELEvaluateVisitor.visit(RELEvaluateVisitor.java:395)

at com.redwood.scheduler.script.rel.parser.ASTPrimaryExpression.jjtAccept(ASTPrimaryExpression.java:14)

at com.redwood.scheduler.script.rel.impl.RELEvaluateVisitor.evaluateUnary(RELEvaluateVisitor.java:246)

at com.redwood.scheduler.script.rel.impl.RELEvaluateVisitor.visit(RELEvaluateVisitor.java:353)

at com.redwood.scheduler.script.rel.parser.ASTUnaryExpression.jjtAccept(ASTUnaryExpression.java:14)

at com.redwood.scheduler.script.rel.impl.RELEvaluateVisitor.evaluateBinary(RELEvaluateVisitor.java:196)

at com.redwood.scheduler.script.rel.impl.RELEvaluateVisitor.visit(RELEvaluateVisitor.java:346)

at com.redwood.scheduler.script.rel.parser.ASTMultiplicativeExpression.jjtAccept(ASTMultiplicativeExpression.java:14)

at com.redwood.scheduler.script.rel.impl.RELEvaluateVisitor.evaluateBinary(RELEvaluateVisitor.java:196)

at com.redwood.scheduler.script.rel.impl.RELEvaluateVisitor.visit(RELEvaluateVisitor.java:339)

at com.redwood.scheduler.script.rel.parser.ASTAdditiveExpression.jjtAccept(ASTAdditiveExpression.java:14)

at com.redwood.scheduler.script.rel.impl.RELEvaluateVisitor.evaluateBinary(RELEvaluateVisitor.java:196)

at com.redwood.scheduler.script.rel.impl.RELEvaluateVisitor.visit(RELEvaluateVisitor.java:332)

at com.redwood.scheduler.script.rel.parser.ASTRelationalExpression.jjtAccept(ASTRelationalExpression.java:14)

at com.redwood.scheduler.script.rel.impl.RELEvaluateVisitor.evaluateBinary(RELEvaluateVisitor.java:196)

at com.redwood.scheduler.script.rel.impl.RELEvaluateVisitor.visit(RELEvaluateVisitor.java:325)

at com.redwood.scheduler.script.rel.parser.ASTEqualityExpression.jjtAccept(ASTEqualityExpression.java:14)

at com.redwood.scheduler.script.rel.impl.RELEvaluateVisitor.evaluateLogical(RELEvaluateVisitor.java:209)

at com.redwood.scheduler.script.rel.impl.RELEvaluateVisitor.visit(RELEvaluateVisitor.java:318)

at com.redwood.scheduler.script.rel.parser.ASTLogicalANDExpression.jjtAccept(ASTLogicalANDExpression.java:14)

at com.redwood.scheduler.script.rel.impl.RELEvaluateVisitor.evaluateLogical(RELEvaluateVisitor.java:209)

at com.redwood.scheduler.script.rel.impl.RELEvaluateVisitor.visit(RELEvaluateVisitor.java:311)

at com.redwood.scheduler.script.rel.parser.ASTLogicalORExpression.jjtAccept(ASTLogicalORExpression.java:14)

at com.redwood.scheduler.script.rel.impl.RELEvaluateVisitor.visitChildren(RELEvaluateVisitor.java:136)

at com.redwood.scheduler.script.rel.impl.RELEvaluateVisitor.visit(RELEvaluateVisitor.java:304)

at com.redwood.scheduler.script.rel.impl.RELScript.evaluate(RELScript.java:39)

... 24 more

Precondition expression:

=Time.isTimeWindowOpenNow('Z_Fridays')

Reply Status Not Required

Sender Object 196556 - Prjo Set AUX job only Fridays

Sender Object Description Job 196556 (submitted from RQ1.ProjectSettlements copy from 2010/05/07 09:50:45,443 Africa/Johannesburg)

Creation Time 9:51:48 AM

Time of Last Modification 9:51:48 AM

Last Modified by Redwood System

Related Objects

Loading...

Former Member
0 Kudos

Hi Adriaan,

Just to be really really sure: there's a null pointer exception in there, and this can be caused by a typo somewhere, in this case probably the time window name.

The Time Window name is case sensitive, can you please double check that ?

Anton.

Former Member
0 Kudos

Hi Anton,

Thanks for the reply.

Tried it but still getting an error. Any other ideas?

Full Text Job 196556 (submitted from RQ1.ProjectSettlements copy from 2010/05/07 09:50:45,443 Africa/Johannesburg) could not be started due to an error evaluating its precondition: Precondition for step Step2 Proj Settlemets AUC Fridays of Job Chain RQ1.ProjectSettlements

Reason: com.redwood.scheduler.script.api.ScriptEngineEvaluationException

Precondition expression:

=Time.isTimeWindowOpenNow('Z_Fridays')

Former Member
0 Kudos

Hi Adriaan,

Which version and build are you on:

- free or enterprise

- M26 or M28 (click the "i" in the top-right corner of the user interface)

Regards,

Anton.