I have this attribute:
var checkIgnition = () -> {
!empty(ignition) ? !ignition ? false : true : null
}
var checkRPM = () -> {
!empty(rpm) ? rpm > 1000 ? true : false : null
}
var getHours = () -> {
!empty(engine_hours)
?
engine_hours
:
hours / 1000 / 60 / 60
}
var getLastHours = () -> {
!empty(lastEngine_hours)
?
lastEngine_hours
:
lastHours / 1000 / 60 / 60
}
var validator = () -> {
true
}
validator()
?
empty(lastWorkHours)
?
1
:
empty(hours)
?
3
:
4
:
empty(lastWorkHours)
?
0
:
lastWorkHours
For some reason, the attributes engine does not realize that 'hours' attribute is present in the position, and the result of the computation is always 3. But when the attribute is tested via the test feature, the result is 4. What could be wrong? Could this be somehow related to the priority of the computed attribute?
Probably because hours are calculated after computed attributes.
Is there a way to calculate hours before the attributes? Can you please pinpoint a place in the codebase that calculates the hours?
Thanks. Swapped the lines, works like a charm now.
I have this attribute:
For some reason, the attributes engine does not realize that 'hours' attribute is present in the position, and the result of the computation is always 3. But when the attribute is tested via the test feature, the result is 4. What could be wrong? Could this be somehow related to the priority of the computed attribute?