Advanced Customization > Business Logic Customization > Windchill ProjectLink Customization > Writing Custom Windchill ProjectLink Algorithms > Registered Event Listeners for Deadline and Status Calculation
  
Registered Event Listeners for Deadline and Status Calculation
The following events are configured to listen to the StandardEPPCustomEventHandlerService class and process the deadline or status based on the handler for the given activity type.
If the handler for a given activity type is not available, then the handler for an eligible parent type (a type that has its Deadline Mode or Status Mode set to Automatic Calculation) will be retrieved and the deadline or status should be calculated and rolled-up by the respective handlers.
State Change
Description
Captures changes in the activity and subplan state.
Event Constant
ProjectManagementEvent.PLANACTIVITY_STATE_CHANGE
% Work Complete
Description
Captures changes in the percentage of work completed for the activity and subplan.
Event Constant
ProjectManagementEvent.EPP_PERCENT_CHANGE
Plan Activity Estimated Finish
Description
Captures changes in the Estimated Finish date of the activity and subplan.
Event Constant
ProjectManagementEvent.EPP_FINISH_CHANGE
Plan Activity Deadline Change
Description
Captures the change in the Deadline date of the activity and subplan.
Event Constant
ProjectManagementEvent.EPP_DEADLINE_CHANGE
Plan Activity Status Change
Description
Captures changes in the activity status and subplan,
Event Constant
ProjectManagementEvent.EPP_STATUS_CHANGE
Subject of Deliverable Change
Description
Thrown by custom code when there is a change in deliverable subject objects.
* 
To invoke a custom algorithm on the basis of some change in a deliverable subject object, throw this event in the operation that is causing the change.
Event Constant
ProjectManagementEvent.EPP_DELIVERABLE_SUBJECT_CHANGE
Deadline Changed by the Custom Deadline Handler
Description
Plan rescheduled for ALAP activities.
* 
You will need the CustomDeadlineImplementation class to throw this event. For more information, see the examples provided in Construct a Deadline Algorithm for Individual Activities.
Event Constant
ProjectManagementEvent.EPP_CUSTOM_DEADLINE_CHANGE
Current Date Change
Description
Captures each passing day.
* 
This event is only available after additional configuration. See the section below.
Event Constant
ProjectManagementEvent.EPP_DATE_CHANGE
Current Date Change
The Current Date Change event (ProjectManagementEvent.EPP_DATE_CHANGE) captures each passing day based on the time set in the following property:
<Property default="24:00" name="com.ptc.projectmanagement.plan.dailyDeadlineAndHealthStatusUpdateTimeStamp"/>
By default, this property is not set. You must add it to wt.properties.xconf.
If you want the Current Date Change event to be invoked every day at certain time, then you can add this property with the desired time stamp using the format H24:MM.
* 
Out of the box, the Current Date Change event listener does nothing. You can extend the listener using the details below.
Extending Event Listeners
If you want to extend the capabilities of existing event listeners or register for events other than those listed above, you can extend StandardEPPCustomEventHandlerService and override the performStartupProcess() API as follows:
@Override
protected synchronized void performStartupProcess() throws ManagerException {
super.performStartupProcess();
getManagerService().addEventListener(new ServiceEventListenerAdapter(CLASSNAME) {
@Override
public void notifyVetoableMultiObjectEvent(Object event){
//Event handling code goes here
}
},
ProjectManagementEvent.generateEventKey(<EVENT_TO_BE_REGISTERED>));
}
* 
As a best practice, to retain the existing listener configurations you should consider calling super.performStartupProcess() inside the overridden performStartupProcess().
If you are implementing an algorithm for deadline calculation, add an entry for the custom to projectmanagement.wt.properties.xconf under com.ptc.projectmanagement.plan.EPPCustomEventHandlerService:

<Property default="com.ptc.projectmanagement.plan.EPPCustomEventHandlerService/com.ptc.projectmanagement.plan.StandardEPPCustomEventHandlerService" name="wt.services.service.3715" />
If you are implementing an algorithm for deadline calculation, add an entry for the custom to projectmanagement.wt.properties.xconf under com.ptc.projectmanagement.plan.HealthStatusEventHandlerService:

<Property default="com.ptc.projectmanagement.plan.HealthStatusEventHandlerService/com.ptc.projectmanagement.plan.StandardEPPCustomEventHandlerService" name="wt.services.service.3715" />
* 
Roll-Up Handlers
Currently the listener code would receive the collection of summary activities, calculate their status or deadline, and invoke the roll up API in the StandardEPPCustomEventHandlerService class.
The roll-up API fetches summaries at each level for child activities and rolls up the status or deadline from the bottom up. This means that the summary activity, as the top-level activity, will be rolled up from its children. To roll up each summary activity, roll up handler algorithms for their respective types are invoked.