In _QAF WF API, in the function wfExecuteLS, a profile document is created to be passed as parameter to an agent. If the user is only Author in the database, he won't be able to modify or save the profile document he created himself. The method CreateProfileDocument would have been very handy here.
I changed the code a little, here's it:
'STAGE 1 - INTERACT WITH USER<br/>
unq = Evaluate ({@Unique}) <br/>
' modified: doesn't work when user is Author
' Set SetupDoc = parentDb.GetProfileDocument("wfSetup", unq(0))
Set SetupDoc = New NotesDocument(parentDb)<br/>
SetupDoc.ReplaceItemValue "$Name", "wfSetup"<br/>
SetupDoc.ReplaceItemValue "Key", unq(0)<br/>
' modified end
More is required, but not much:
- a view with all wfSetup-documents (select: SELECT @Left($Name; 7)="wfSetup" )
- additional code in _QAF WF Cleanup:
…
Loop
' modified, see also wfExecuteLS
Dim view As NotesView
Dim vec As NotesViewEntryCollection
Set view= db.GetView("LUWFSetup")
Set vec= view.AllEntries
i= i + vec.Count
Call vec.RemoveAll(True)
' modified end
logSSAction "STATS: " & i & " workflow setup profile(s) removed."
…