Skip to content

Arithmetic on task parameters #103

Open
gwierzchowski opened this Issue Feb 17, 2013 · 2 comments

3 participants

@gwierzchowski

There is currently syntax %{...} which allows users for some basic data arithmetics, but it only works against project predefined macros.
It would be great if it could be also used with taks' parameters which are already known in time when reports are being generated. Following code ilustrates what I mean:

macro GaugeReal [
  celltext  (plan.start < %{ ${now} - 1d} ) "Does work"
  #celltext  (plan.start < %{ plan.end - 1d} ) "Does not work"
  #Error: Unexpected token 'plan.end' found. Expecting '{'
]

taskreport gantt "Gantt" {
  formats html
  columns name, start, end, gauge { ${GaugeReal} }, chart
}

I would like to use this feature to mark on reports not completed taks which are CLOSE (e.g. 2 days) to reach their deadlines, but did not pass it yet.

BTW: Please mark it as Feature - I don't know how to do this in my github profile.

@scrapper
The TaskJuggler Project member

No need to use the %{...} notation here. That's just needed to signal to the parser to evaluate it while reading the file.

celltext (plan.start < (plan.end - 1d) )

would do. But it requires some additions to the logical expression code. The biggest challenge is testing though.

@antibios
antibios commented May 7, 2015

Does this work in macros?
I'm attempting:
task "Test expression" {
start ${2} - 1d
#start (${2} - 1d)
}

and they all fail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.