Adding P6 Provider Custom Step: Example

In this example, a Calculate Activity Planned Cost custom step is being added to P6 project data flows which calculates the activity planned cost of P6 projects with different statuses.

Note: InProgressTotalCost, NotStartedTotalCost, and CompletedTotalCost are UDFs in P6.

To add the custom step:

  1. Sign in to Primavera Gateway as an administrator or developer.
  2. In the sidebar, select Configuration.
  3. Select the Custom Steps tab.
  4. Select the Add... button.
  5. In the Custom Step wizard, enter the following information:
    1. In the Name field, enter Calculate Activity Planned Cost.
    2. Select P6 from the Provider list.
    3. Select Source from the Flow Side list.
    4. Select Project Data from the Flow Type list.
    5. In the Sequence Number field, enter 11.
    6. Select the Enable check box.
    7. Select Save.
  6. In the Formula section, enter the following code using Gateway scripting language:

    double inprogress = 0.0;

    double notstarted = 0.0;

    double completed = 0.0;

    for (activity : <Activity>)

    {

    if (activity.PlannedTotalCost != null)

    {

    if (activity.Status == "In Progress")

    {

    inprogress = inprogress + activity.PlannedTotalCost;

    }

    else if (activity.Status == "Not Started")

    {

    notstarted = notstarted + activity.PlannedTotalCost;

    }

    else if (activity.Status == "Completed")

    {

    completed = completed + activity.PlannedTotalCost;

    }

    }

    }

    for (project : <Project>)

    {

    project.InProgressTotalCost = inprogress;

    project.NotStartedTotalCost = notstarted;

    project.CompletedTotalCost = completed;

    }

  7. Select Validate.
  8. Select Save.

Step me through...

Adding a Project Data Business Flow with Custom Step Using Gateway Scripting Language : Example



Legal Notices | Your Privacy Rights
Copyright © 2013, 2022

Last Published Thursday, October 6, 2022