Scheduling DECS activity

This tip describes how to schedule DECS activity.

DECS (Domino enterprise connectivity services) is a real-time activity to push/pull data from external sources ie.,data on lotus and external source are always in sync at any given point of time. To achieve this, the DECS activities should be running non-stop. But there might be need to start the activity, pull/push data and stop the activity on a scheduled basis. Though there is a schedule feature in DECS, any updates to the documents prior to the start of the activity would not be pushed to the external source. The below code copied into a scheduled agent would overcome this problem. It starts the DECS activity, recalculates each documents (so push/pulls data to/from external source), and then stops the activity.

Dim session As New notessession
 Dim db As notesdatabase
 Dim decsdb As notesdatabase
 Dim acitivityview As notesview
 Dim activitydoc As notesdocument
 Dim doccoll As notesdocumentcollection
 Dim doc As notesdocument
 Dim query As String
 Set db=session.currentdatabase
 Set decsdb = 
 Set activityview = decsdb.getview("(Nav Activities)")
 Set activitydoc = activityview.getfirstdocument
 'Start the activity
 If activitydoc.Type(0) = "Activity" Then
  If activitydoc.Lock(0)=0 Then
   activitydoc.RunASAP = 1
  End If
 End If
 query = {(select form="testForm"}
 'Refresh all documents, 
so that data is pulled/pushed to oracle
 Set doccoll =,Nothing,0)
 If doccoll.count >  0 Then
  Set doc = doccoll.getfirstdocument
  While Not doc Is Nothing
   Call doc.computewithform(False,False)
   Set doc = doccoll.getnextdocument(doc)
 End If
 'Stop the activity
 If activitydoc.Type(0)="Activity" Then
  If activitydoc.Lock(0) <> 0 Then
   activitydoc.SystemAction = 21
  End If
  If activitydoc.RunASAP(0) <> 0 Then
   activitydoc.RunASAP = 0
  End If
 End If

Dig Deeper on LEI and DECS for Lotus Notes Domino

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...