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

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?

0 votes

1 answers

1868 views

ANSWER



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.

0 votes



It works!

Thanks for type checking…..I guess I miss the type checking autocompletion editor/compiler in Eclipse….;-)

Thanks, again.

Karl

03/12/2012

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

Thanks

03/14/2012