487 views

Recalculations in Project Management 



What is recalculation?


Recalculation, where project dates are computed based on the parent-child hierarchy and the relationships set up across various project tasks, is the core of project planning.

Key recalculation points:

  • Dates are rolled up from child nodes to parent
  • After a node has children, its date cannot be modified through the user interface (except the top project where the Planned Start Date can be modified)
  • The logic of deriving dates is:
    • For a node in Pending/Open states, Planned End Date = Planned Start Date + Planned Duration
    • For a node in WIP state, Planned End Date = Actual Start Date + Planned Duration
    • For a node in Closed state, Actual Duration = Actual End Date - Actual Start Date

 

How do I know if recalculation is working correctly?


Navigate to planned_task.list and query top_task as described in Troubleshooting Project Structure. Personalize (not configure) the list to add the following columns:

  • Planned Start Date
  • Planned End Date
  • Actual Start Date
  • Actual End Date

Sort the list by Planned Start Date in Ascending (A-Z) order. You should see the top project at the top of the list. The top project should share the Planned Start Date with at least one node appearing at the top of the list.

Sort the list by Planned End Date in Descending (Z-A) order. You should see the top project at the top of the list. The top project should share the Planned End Date with at least one node appearing at the top of the list.

 

How do I trigger recalculation myself and check?


There are two options:

  • Use the Diagnostics Update Set
  • Run an API call in Scripts > Background

    For Geneva:

    (new SNC.ProjectManagementAPI()).recalculate('<sys_id_of_top_project>')

    For Helsinki:

    (new SNC.PlannedTaskAPI()).recalculate('<sys_id_of_top_project>')

 

How do I check that recalculation is completing properly?


  1. If the property does not already exist, create the com.snc.pm.debug.enable property.
    Ensure that the type is true|false and the value is set to true.
  2. From Scripts > Background, trigger recalculation.
    The platform prints out a significant number of messages in the system logs.
  3. Look for the highlighted messages in the screenshot below.
    This output is from a Geneva instance and may differ slightly in subsequent releases. 
    Note that this modifies the project and task records, so be aware when running on a production instance.

If you see the last message Into saveRelations(), the recalculation has completed successfully and the project has been saved.

 

How do I debug recalculation from forms/lists?


Trigger the recalculation by changing the Start Date or Duration of a project task.

Navigate to System > Logs and look for the following:

Message Source
 Start of Load com.snc.planned_task.core.loader.Planned
 End of Load : - 00:00:00 : 37 :: 37 com.snc.planned_task.core.loader.Planned
 Start of recalculation com.snc.planned_task.core.engine.Automat
 End of recalculation :  - 00:00:00 : 45 :: 45  com.snc.planned_task.core.engine.Automat
 Start of Save com.snc.planned_task.core.datastore.Data
 End of Save :  - 00:00:00 : 11 :: 11  com.snc.planned_task.core.datastore.Data

These are the key logs that indicate the recalculation process is working properly. The process involves the following three steps:

  1. Load the Project into memory.
  2. Perform recalculation.
  3. Save the dirty records to the database.

 

I still can't figure why recalculation is not happening


Check the calculation_type field in Project and all sub-Projects/Project Tasks. They should be set to Automatic or Manual. Automatic projects are what we have used in this document. Manual projects do not honor relationships between nodes.

Check the project schedule in project record. Check if the schedule is valid. It should be valid for the dates of the project (for example, Schedule defined for year 2025 may not work properly today). It is acceptable to leave the schedule blank.

Article Information

Last Updated:2017-03-15 00:28:20
Published:2017-02-14