Asta Constraints lost
Multi platform library to read and write schedule data
Brought to you by:
joniles
Asta import doesn't appear to retain constraints.
The attached project has a range of constraints (see png screenshot), but they all get set to ASAP (or ALAP: the placement field is loaded correctly).
If I add trace code to the AstaReader processConstraints() method, I note the row.getInt("CONSTRAINU") call never returns a number other than 1.
1: Constraint = 0; Placement = 0
2: Constraint = 0; Placement = 0
3: Constraint = 0; Placement = 0
4: Constraint = 0; Placement = 0
5: Constraint = 0; Placement = 0
6: Constraint = 0; Placement = 0
7: Constraint = 0; Placement = 0
Press any key to continue . . .
Love to help, but I'm not sure where to go with this! I thought CONSTRAINU might be a mistake, but it seems consistent, and there are other field names with substituted letters so I'm assuming there was a design decision or other requirement.
A little further digging and I've found a solution. The select SQL for task details wasn't aliasing the constraint_flag to constrainu to allow the values to be processed.
Patch attached.
I've included your change in this branch: https://github.com/joniles/mpxj/compare/asta_changes
The weird substitutions stem from the original MDB database layout Powerproject used. I think they were trying to avoid name collisions when joining tables using the limited functionality of the Jet database engine. Eventually I should really switch the mapping around so that the MDB code maps to the column names used in the SQLite database.
The code now in Git fixes this issue.