Hi,
I am always getting the IsCritical Flag as always false for an XER File. I tried to get the value using task.IsCritical ? “Yes” : “No”; and also Get(Tsk.IsCritical). Both the values for any XER file is always No.
Please suggest the way to extract Critical Flag from an XER file?
@abhargava
It appears that you are consistently receiving the IsCritical flag as false when working with XER files. This issue can arise due to several factors, including the structure of the XER file or the definitions of the tasks within it.
Cause: The IsCritical flag may not be set correctly due to improper task dependencies, unrealistic task durations, or incorrect project settings.
Solution: To resolve this issue, please follow these steps:
-
Check Task Dependencies: Ensure that all tasks in your XER file have the correct dependencies established. A task is deemed critical if its dependencies impact the overall project timeline.
-
Review Task Durations: Confirm that the task durations are realistic and that there are no gaps that could disrupt the critical path.
-
Use the Correct Method: Ensure you are using the appropriate method to retrieve the IsCritical flag. You can implement the following code:
bool isCritical = task.Get(Tsk.IsCritical);
-
Inspect the Project Settings: Verify that the project settings are configured correctly, as they can influence task evaluations.
-
Test with Different XER Files: If feasible, test with various XER files to determine if the issue is consistent across all files or isolated to a specific one.
Next Steps: After following these steps, if you continue to experience issues, please provide additional details regarding the structure of your XER file or any specific configurations you are using.
I look forward to your response and am here to assist further!
I have tried this. It works for an MPP file but not an XER file.
@abhargava ,
XER file doesn’t contain IsCritical flag because it’s a field calculated based on Primavera settings
(Project → Settings tab → Define Critical Activities).
The default Primavera behavior is to mark task as critical when Total Float is less than or equal to 0h.
You can set Task.IsCritical in your code using the following snippet (the default Primavera logic is used):
var p = new Project("input.xer");
foreach (var t in p.EnumerateAllChildTasks())
{
if (t.IsSummary)
{
continue;
}
if (t.TotalSlack <= TimeSpan.Zero)
{
t.IsCritical = true;
}
}
foreach (var t in p.EnumerateAllChildTasks())
{
if (t.IsCritical)
{
Console.WriteLine("Critical task: '{0}'", t.Name);
}
}
This is not the right value.
User could use either option to define the critical path.
Total Float less than a certain duration (Critical Slack Limit) or Longest path are not different terminology but rather a critical path definition method.
image.png (16.7 KB)
Please provide this option or tell me how XER calculates the critical value as the value returned from XER and Aspose are not the same.
Also, there exists a field in Primavera to define whether a task is Critical or not.
image.png (25.4 KB)
Please if this needs to be taken up as a paid support activity I am happy to take this.
@abhargava ,
currently Tsk.IsCritical is not set after project is read from XER file.
Investigation shown that XER file contains “Define Critical Activities” setting.
We will add reading of the setting in a future release.
@abhargava
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): TASKSNET-11582
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Hi,
Thank you for the reply.
Just want to know what Define Critical Activities change will reflect? Will it provide whether a task is critical or not?
@abhargava ,
the IsCritical flag will be initialized according to XER file’s “Define Critical Activities” setting.