Home > Domino Tips > Developer > Agent > Scheduling DECS activity
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

AGENT

Scheduling DECS activity


Dhana Sekar
06.16.2003
Rating: -3.57- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


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.



Code

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 = 
session.getdatabase(db.server,"decsadm.nsf")
 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
   Call activitydoc.save(True,True)
  End If
 End If
 
 query = {(select form="testForm"}
 
 'Refresh all documents, 
so that data is pulled/pushed to oracle
 Set doccoll = db.search(query,Nothing,0)
 
 If doccoll.count >  0 Then
  Set doc = doccoll.getfirstdocument
  While Not doc Is Nothing
   Call doc.computewithform(False,False)
   Call doc.save(True,True)
   Set doc = doccoll.getnextdocument(doc)
  Wend
 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
  Call activitydoc.save(True,True)
 End If

Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Agent
Run or restart Notes/Domino agents via text messages
Approve Lotus Notes documents using a BlackBerry mobile device
LotusScript agent indexes Lotus Notes/Domino databases
Open documents in Lotus Notes from the Web without a UNID
Fix and update Lotus Notes documents with limited access
Verify scheduled agent status with Domino Extensible Language (DXL)
How to export data from a Lotus Notes database to a CSV file
Enable or disable scheduled agents without opening the Lotus Notes database design
Creating custom views in Lotus Notes databases
Editing fields in a Lotus Notes view with Ajax

LEI and DECS for Lotus Notes Domino
Top 10 Lotus Notes Domino programming and development tips of 2007
An introduction to Lotus Enterprise Integrator (LEI)
A smorgasbord of Notes/Domino development tips
DECS and DCR external data access considerations
Importing data once from Oracle app into Notes app
Moving data (text) from Lotus database to Oracle
Restricted in connecting LEI to Notes databases?
Lotus Enterprise Integrator (LEI)
Integrate Domino 7 beta with DB2
Automated export of selected public NAB information

Lotus Notes Domino Agents
How the Agent Profiler tool improves Notes/Domino performance
Run or restart Notes/Domino agents via text messages
Calculating results for a column in a Lotus Notes view
Approve Lotus Notes documents using a BlackBerry mobile device
LotusScript agent indexes Lotus Notes/Domino databases
Top 10 Lotus Notes/Domino coding and development tips of 2008
Open documents in Lotus Notes from the Web without a UNID
Fix and update Lotus Notes documents with limited access
Verify scheduled agent status with Domino Extensible Language (DXL)
Top 10 Lotus Notes Domino programming and development tips of 2007

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts