cancel
Showing results for 
Search instead for 
Did you mean: 

Using an environment property as a value for a call to CurrentDate.seconds() in a automation create task due date field?!

karl_harris_
Star Collaborator
Star Collaborator

I have the following code to create a value in the due date field of a create task automation element.

@{CurrentDate.seconds(expr:@{Timeout}).format("yyyy-MM-dd'T'kk:mm:ss'Z'")}

Timeout is a context variable initialized, with an environment property, in the line above the create task.

I get the following error:

Caused by: [Error: [Error: reference to undefined interceptor: {Timeout}] [Near : {... at("yyyy-MM-dd'T'kk:mm:ss'Z'" ....}]

I've also tried:

@{CurrentDate.seconds(@{Timeout}).format("yyyy-MM-dd'T'kk:mm:ss'Z'")}

and

@{CurrentDate.seconds(@{Env["my.environment.property"]).format("yyyy-MM-dd'T'kk:mm:ss'Z'")}

using no context variable and obtain the same result.

If I use:

@{CurrentDate.seconds(600).format("yyyy-MM-dd'T'kk:mm:ss'Z'")}

it works and if I place

@{Env["my.environment.property"]}

in the comment field of the create task I get my timeout value from the nuxeo.conf file in the task listing.

Are my problems syntax? Something else?

1 ACCEPTED ANSWER

Benjamin_Jalon1
Elite Collaborator
Elite Collaborator

Can you try this ?

@{CurrentDate.seconds(new java.lang.Integer(Env["my.environment.property"])).format("yyyy-MM-dd'T'kk:mm:ss'Z'")}

I'm not sure but I think this is your problem.

You give a string and the seconds methods waiting an integer. But sorry if doesn't work.

View answer in original post

3 REPLIES 3

Benjamin_Jalon1
Elite Collaborator
Elite Collaborator

Can you try this ?

@{CurrentDate.seconds(new java.lang.Integer(Env["my.environment.property"])).format("yyyy-MM-dd'T'kk:mm:ss'Z'")}

I'm not sure but I think this is your problem.

You give a string and the seconds methods waiting an integer. But sorry if doesn't work.

It works!

Can you think to validate your answers, like that this easier for the community to answer and know which question are not answered.

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.