Personnalisation avancée > Business Logic Customization > Windchill ProjectLink Customization > Writing Custom Plan Attributes Algorithms for Members of the Variant Baseline > Supported APIs for Deadline and Health Status Calculation
  
Supported APIs for Deadline and Health Status Calculation
The following APIs are supported:
FBMLPlannableAttributesHandler.updateFloatingBaselineMemberLinksFromActivity(activityList): API for updating Health Status and Deadline attributes of the associated variant baseline member link when these attributes are impacted by the modification of the related plan activities.
FBMLPlannableAttributesHandler.updateFloatingBaselineMemberLinks(floatingBaselineMemberList): API for updating the Health Status and Deadline attributes of variant baseline member link when the member link is updated. For example, revision of WTPart from FloatingBaselineMember Link Object is modified.
EPPCustomUtils.getFloatingBaselineMemberLinks(parts, baselineIdentifers, matchExactVersion): API for retrieving the associated FloatingBaselineMember objects for the given collection of partObjects. It applies criteria of VariantBaseline and exact version match while retrieving FloatingBaselineMember objects for the given collection of WTParts.
DeliverableHelper.service.getAssociatedActivities(subjectListCollection): For the given Subjects of Deliverables list, this API returns WTKeyedHashMap (key:SubjectOfDeliverable-ObjectIdentifier, value:WTArrayList(PlanActivity)), where the key is the given SubjectOfDeliverable's ObjectIdentifier and the value is the WTArrayList of PlanActivity. You can use this API when Floating Baseline member is created or updated.
* 
If any subject is not associated with any activity, then there is no entry for this subject in the return map-WTKeyedHashMap.
DeliverableHelper.service.getActivitySubjects(activityList): For the given activity list, this API returns WTKeyedHashMap(key: PlanActivity.ObjectIdentifier, value:ArrayList(SubjectOfDeliverable). You can use this API when activity is created, updated, or deleted.
* 
If any activity does not have associated Subject of Deliverables, then the empty ArrayList is returned in the WTKeyedHashMap.
PlannableHelper.service.getAllAncestorsOfActivities(actList): For the given activity list, this API returns WTKeyedHashMap(key:PlanActivity, value:WTArrayList(PlanActivity)), where the key is the given activity and the value is the WTArrayList of all its ancestors.
* 
If any activity does not have a parent summary activity and its parent is a plan, then the empty WTArrayList(PlanActivity) is returned in the WTKeyedHashMap(PlanActivity, WTArrayList(PlanActivity)).
DeliverableHelper.service.getActivitiesHavingDeliverableSubjects(activityColl): For the given collection of activities, this API returns WTCollection of activities that have a Subject of Deliverable associated with them.
* 
If any activity has been marked as Deliverable and does not have any Subject of Deliverable, then it is not included in the collection of activities that are returned.
throwActivityCustomEvents(HashMap<String, PlanActivity>actMap, WTCollection newActCollection): API is called at the end of throwActivityEvents and is used for adding more events. You can extend StandardEPPCustomEventHandlerService and override this API to author and throw customized events to update Plan Attributes associated with an activity.
getIcon Object result,HashMap<Object, Object>iconList: This API returns the graphical Health Status icon of the floating baseline member. It will return Icon Component object for floating baseline member displaying any of the statuses — Red, Yellow, Green, or Unavailable. In any other cases, it calls the healthStatusTypeFBML.getDisplay() method and returns the object that is textual representation of the Health Status attribute. You can also configure a custom Health Status icon.
Steps to configure a Custom Health Status Icon
You can configure the custom algorithm using the HealthStatusIconHandler interface. This interface is defined as follows:
1. public HashMap<Object, Object> getHealthStatusImageIcon(List objects);
2. public Object getIcon(HealthStatusType healthStatusType, boolean isComplete, boolean isCancelled,AbstractPlanActivity activity) throws WTException, WTPropertyVetoException;public String getIconForCompletedLate();
3. public String getIconForCompletedPlannables();
4. public String getIconForCancelledPlannables();
5. HashMap<object, Object> getIcon(FloatingBaselineMember fbmlObject, Object result, HashMap <Object, Object> iconList)throws WTException;
This interface and the given supported APIs can be implemented to plug in the custom algorithms. In these implemented methods, you can provide your own icons to display Health Status. After you author the custom algorithm, configure it in the xconf file:
1. Add the following entry in ${WT_HOME}/Windchill/codebase/com/ptc/projectmanagement/projectmanagement.service.properties.xconf:
<!-- Handlers for displaying graphical 'Health Status' for plan activity -->
<Service context="default"
name="com.ptc.projectmanagement.plan.HealthStatusIconHandler">
<Option cardinality="singleton" requestor= "null" selector =
"com.ptc.projectmanagement.plan.Plannable"
serviceClass="com.ptc.projectmanagement.plan.PlannableHealthStatusIconHandler"/>
</Service>
* 
In this entry, add custom handler name for serviceClass field: serviceClass= <custom_handler_name>.
2. Run xconfmanager -p in Windchill shell and restart the Method Server.