RE: Re: Automated Agent Stop Working Gabriel Santos Taibo 5.Nov.09 12:23 PM a Web browser Lotus Workflow Engine 3.0Windows 2003
Hi,
Did you check the view errorlog, for see if some error is happening.
I will check as well the view used by the Workflow agent:
(OSServerQueue) to see if you document are in this view, if not they wont be proccessed by the agent.
And if you need to enable debug :
you will need to add some code to the Script Library "OS Application Events:
Private Function PostWFSessionCreate_( objWFSession As WFSession )
'create document and put this into cache for futher use
Dim doc As NotesDocument
Dim RTF As Notesrichtextitem
Dim ErrorCode As Integer
Dim ErrorText As String
If objWFSession.Session.isOnServer Then
'create document
Set doc = New NotesDocument ( objWFSession.ApplicationDatabase )
Call doc.ReplaceItemValue("Form", "OS Log" )
Call doc.ReplaceItemValue("Subject", "Running : " & objWFSession.Session.CurrentAgent.Name)
Call doc.ReplaceItemValue("UserName", objWFSession.Session.UserName )
Call doc.ReplaceItemValue("EffectiveUserName", objWFSession.Session.EffectiveUserName )
Call doc.ReplaceItemValue("WorkflowUserName", objWFSession.UserName )
'create log RTF field and initialize it
Set RTF = New Notesrichtextitem( doc, "Body")
Call rtf.AppendText("Initializing log : " & Format$( Now, "Short Date") & " - " & Format$(Now, "Short Time"))
Call rtf.addnewline(2)
'save doc
Call doc.save(True, True)
'add doc to global cache
If Not DWFUtilSetGlobalObject( "InternalLog", doc , Errorcode, ErrorText) Then
Messagebox "Error initializing log document -> " & Str$(ErrorCode) & " - " & ErrorText
End If
Private Function OnDebugPrint_(Byval strModule As String, vMsg As Variant, nContinue As Integer)
'create document and put this into cache for futher use
Dim doc As NotesDocument
Dim rtf As Variant
Dim ErrorCode As Integer
Dim ErrorText As String
Dim str1 As String, str2 As String, strMsg As String
Const c1 = 35
Const c2 = 70
On Error Goto ErrorHandler
If gWFSession.Session.IsOnServer Then
str1 = String(c1, " ")
str2 = String(c2, " ")
'get log document
If Not DWFUtilGetGlobalObject( "InternalLog", doc , Errorcode, ErrorText) Then
Messagebox "Error getting document -> " & Str$(ErrorCode) & " - " & ErrorText
End If
If Not doc Is Nothing Then
'here we can log the text passed
Set RTF = doc.GetFirstItem("Body")
If RTF Is Nothing Then
Set RTF = New Notesrichtextitem( doc, "Body")
End If
'print the message
If Isarray(vMsg) Then ' Print them all !
Call rtf.addnewline(1)
'Call rtf.AppendText( Format$( Now, "Short Date") & " - " & Format$( Now, "Short Time") )
'Call rtf.addtab( 1 )
'Call rtf.AppendText( strModule )
'Call rtf.addtab( 1 )
Call rtf.AppendText( strMsg & "[...array content follows...]" )
Call doc.Save(True, False)
End If
End If
Exit Function
ErrorHandler:
Err = 0
Exit Function
End Function
after of this you will need to create a form (forn mane=(OS Log) | Os Log) with the following fields:
body (richtext) no formula, editable
UserName (text) formula=FromOS, computed for display
EffectiveUserName (text) formula=FromAgentOS, computed for display
WorkflowUserName(text) formula=SendtoOS, computed for display
Subject (text) no formula, editable
and you need to create a view as well:
view name =Os Log
formula=SELECT form="OS Log"
feel fre to customize by your own the columns.