HiIs it possible to start next agent after the first is finished. I use this. I guess i will put some code betwen End If and End Sub.
If docColl.Count >0 Then
Set popupDoc = docColl.GetFirstDocument
While Not PopupDoc Is Nothing
Set item = popupDoc.GetFirstItem("readedBy")
If Not item.Contains(session.UserName) Then
' Mark docoment as read.
Call item.AppendToTextList(session.UserName)
Call popupDoc.Save(True,False)
answer% = wks.DialogBox( "NoticeBoard" , True , True , True , True , True , True , "NEWS" , popupDoc )
End If
Set popupDoc = docColl.GetNextDocument(popupDoc)
Wend
End If
End Sub
Kind regards
David
Subject: Star next agent after the first is finished
No. There are third party tools to effect something like that.
Two more ideas:
- scheduled agents –
Schedule both of the agents very close together (maybe one minute apart). The server will only run one agent in a database at a time. Once the first finishes, then the next will be eligible and will start soon.
- triggered agents –
Have one agent call another using Agent.Run.
Note: When the first agent calls the second, the first will be blocked until the second agent finishes, then the first one will finish.
Side issues: If these agents take a substantial amount of time, stringing them together will increase the chance of a time-out. Also, if a called agent crashes, error handling in the first agent will be triggered too.
Subject: RE: Start next agent after the first is finished
Why not get a handle to the next agent you want to run and then use agent.Run() on it at the end of your first agent?
Something along the lines of:
Dim secondAgent as NotesAgent
Set secondAgent = db.GetAgent(“YourSecondAgent’sNameGoesHere”)
Call secondAgent.Run()