Show TOC Start of Content Area

Procedure documentation Creating Deadlines and Durations  Locate the document in its SAP Library structure

Use

Whenever you need to specify a processing time for a notification instance, you create a deadline. It can be:

      An exact date set in time (DEADLINE_ABSOLUTE_POINT)

·        Duration related to some starting point:

       DEADLINE_FROM_ACTION_START – a duration related to action start

¡        DEADLINE_FROM_PROCESS_START – a duration related to process start

Prerequisites

      You have set up your project in SAP NetWeaver Developer Studio. For more information, see Setting Up Your Project.

      You have instantiated the runtime and notification managers. For more information, see Retrieving Process Notification Instances.

Procedure

Creating an Absolute Deadline

For this type of deadline, you need to specify an exact deadline date. You should not provide duration:

 Example

import com.sap.caf.eu.gp.process.rt.notification.api.GPNotificationFactory;

import com.sap.caf.eu.gp.process.api.IGPDeadline;

 

//Create a deadline in one hour

IGPDeadline deadline = GPNotificationFactory.createDeadline(

                                      IGPDeadline.DEADLINE_ABSOLUTE_POINT,

                                      null,

                                      0,

                                      System.currentTimeMillis()

                                             + 10*1000*60*60

                                    );

 

Creating a Deadline with Duration

...

       1.      For this type of deadline, you have to create duration first. You specify the duration type and time period:

Example

import com.sap.caf.eu.gp.process.rt.notification.api.GPNotificationFactory;

import com.sap.caf.eu.gp.process.api.IGPDuration;

 

// create a duration of one hour

IGPDuration duration = GPNotificationFactory.createDuration(

                                          1,

                                          IGPDuration.DURATION_HOUR

                                        );

You can choose from the following duration types:

¡        DURATION_MINUTE

¡        DURATION_HOUR

¡        DURATION_DAY

¡        DURATION_WEEK

¡        DURATION_MONTH

¡        DURATION_YEAR

       2.      Use the duration created above to create a deadline.

This time, specify duration and a start date from which the deadline can be calculated:

Example

import com.sap.caf.eu.gp.process.api.IGPDeadline;

 

// create a deadline with duration one hour (start date is current system time)

IGPDeadline deadline2 = GPNotificationFactory.createDeadline(

                                      IGPDeadline.DEADLINE_FROM_PROCESS_START,

                                      duration,

                                      System.currentTimeMillis(),

                                      0

                                    );

 

Result

You may use the deadlines you have created to update the processing time information of notification instances. For more information, see Updating Notification Processing Time and Status.

              

End of Content Area