Type | Description | |||
Item as HITEM | A long expression that specifies the handle of the item where the SchedulePDM starts, or 0, if the Key indicates an unique key of the bar that starts scheduling the SchedulePDM. | |||
Key as Variant | A VARIANT expression that specifies the key of the bar where the SchedulePDM begins. If the Item parameter is 0, the chart looks for the first bar with specified key. |
Return | Description | |||
Long | A long expression that specifies whether the operation is
successful (0 or any positive value indicating a warning) or failed
(negative value). Possible values are
|
Tasks may have multiple predecessors or multiple successors. Before you begin establishing dependencies, it’s important to understand that there are four types:
The following screen show shows the chart before calling the SchedulePDM on the Oplata bar:
The following screen show shows the chart after calling the SchedulePDM on the Oplata bar:
The SchedulePDM method handles the following bars:
summary bars: DefineSummaryBars property defines a summary bar and child bars.
The type of the link (exLinkType) between two bars is:
The following properties defines the lag of the link (indicates a delay between two activities):
The ChartStartChaning(exPDM) event is fired once the SchedulePDM method is called. The ChartEndChaning(exPDM) event is fired once the SchedulePDM method is called. If Undo/Redo is available, the entire operation is hold as a block, so the chart can be restored by calling the Undo operation, or by pressing the CTRL + Z on chart. You can check the ChartUndoListAction property to lists the actions being performed during the SchedulePDM method. The DefSchedulePDM property defines options to be used by the SchedulePDM method. If required any option to be used the DefSchedulePDM should be called before the SchedulePDM method else it will have no effect. For instance, use the Def SchedulePDM property to specify a start date for the project, so the SchedulePDM method will use it, to arrange all bars so no bars will start before the specified date. The same if you require to specify the end of the project. The SchedulePDM method invokes the BarResize event for all affected bars.
The following screen shot shows the chart using different type of links before calling the SchedulePDM:
The following screen shot shows the chart using different type of links after calling the SchedulePDM:
and if we move the first bar and call again the SchedulePDM we get ( the sample preserve the working units for each bar ):
The following screen shot shows the activities, when exLinkPDMWorkingDelay property is set for links ( SF has 1 working day, FS has 2 working days and the FF has 3 working days delay ) :
The following snippet of code, ensures that the SchedulePDM method is not called during the BarResize event: (prevent recursive calls).
Dim iSchedulePDM As Long Private Sub G2antt1_BarResize(ByVal Item As EXG2ANTTLibCtl.HITEM, ByVal Key As Variant) Debug.Print "BarResize invoked" If (iSchedulePDM = 0) Then iSchedulePDM = iSchedulePDM + 1 G2antt1.Items.SchedulePDM Item, Key iSchedulePDM = iSchedulePDM - 1 End If End Sub
The following approach, prevent recursive calls of SchedulePDM method during the BarResize event:
iPDMRunning = 0 event ChartStartChaning(Operation) if ( Operation == exPDM (12) ) iPDMRunning++ event ChartEndChaning(Operation) if ( Operation == exPDM (12) ) iPDMRunning-- event BarResize(Item,Key) if ( iPDMRunning == 0 ) Call SchedulePDM(Item,Key)
The following VB sample displays a message when the SchedulePDM starts and ends:
Private Sub G2antt1_ChartStartChanging(ByVal Operation As EXG2ANTTLibCtl.BarOperationEnum) If (Operation = exPDM) Then Debug.Print "SchedulePDM starts" End If End Sub Private Sub G2antt1_ChartEndChanging(ByVal Operation As EXG2ANTTLibCtl.BarOperationEnum) If (Operation = exPDM) Then Debug.Print "SchedulePDM ends" End If End Sub