Hi, I’m trying to base a stategroup in an ordered graph on the previous entry, however this works except for the first entry. I want a day only to be able to be set to 'Done'?'Yes'
when the previous day os 'Done'?'Yes'
, however this causes a problem as the 'First Day'
does not comply to that statement. Since it is not possible to have an or-statement in the where-statement, is there a way to do this? Thanks in advance.
'Days': collection ['Day']
'Order': ordered-graph .'First Day' ( ?'Yes' || ?'No'>'Previous Day' )
@small
{
'Day': text @default: auto-increment || "1"
'First Day': stategroup (
'Yes' { }
'No' {
'Previous Day': text -> ^ sibling in ( 'Order' )
}
)
'Done': stategroup (
'Yes' where 'Previous Done' -> .'First Day'?'No' >'Previous Day' .'Done'?'Yes'
|| .'First Day'?'Yes' { } // <--
'No' { }
)
}