• Problem with Profile Documents

    By Sjef Bosman 2 decades ago

    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 &quot;$Name&quot;, &quot;wfSetup&quot;<br/>
                SetupDoc.ReplaceItemValue &quot;Key&quot;, 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."

    • Author or Reader?

      By Mark Demicoli 2 decades ago

      Do you mean if they only have Reader access?

      • By Sjef Bosman 2 decades ago

        Nope. They had Author access to the database but not to a profile document that is created to pass parameters to a background agent. If I use a normal document, it works.



        For some very odd reason, (in R6.5.1), an Author who creates a profile document doesn't have the rights to modify it. Or I did something else terribly wrong.