Workflow for the Web

Hi all,

I’m working on a project which reproduce a workflow for the web but i’ve got some wright access problems.

The authors field is computed with the step of my workflow. At Step 1, user A is Authors and he validates the form. The step is increased in a webquerysave agent to give Authors access to user B and remove any access to user A. To make it correctly i have to insert a computewithform before saving but instead of my validation page i’ve got a page with this message :

Error 500

HTTP Web Server: Lotus Notes Exception - You cannot update or delete the document(s) since you are not listed as an allowable Author for this document

But my document has changed to step 2 and user B is the only Author.

What’s wrong with my method ? How could i save a document if i remove my access on it ?

thanks for your responses

Subject: Workflow for the Web

Hi,How you’re vaidating data?. Is it just validating fields on the form?. If so, use Javascript. Once the form is validated, then only do submit.

If you want to validate form data with the data stored in the database, run an agent to validate data using AJAX. Once the data is validated, then do submit.

Once the form data is submitted then update the status/step and the routing path based on that status/step.

We may give you few more suggestions, if we see the code.

adi

Subject: RE: Workflow for the Web

Excuse me, i’ll try to describe my problem with more accuracy.

I don’t have any validations on my fields, it’s just a form that the differents users have to submit to finish the workflow.

I’ve got a field called Step that locate the workflow (there is 3 step) and i’ve got an Author field that is computed like this :

@if(Step = “1” ; “User A” ; Step = “2” ; “User B” ; Step = “3” ; “”)

And here is my webquerysave agent (simplified) :

Sub Initialize

Dim session As New NotesSession

Dim doc As NotesDocument

On Error Goto logs

Set doc = session.DocumentContext

Call doc.ReplaceItemValue(“Step”, “1”)

Call doc.ComputeWithForm(False, False)

Call doc.Save(True, False)

Exit Sub

logs :

Print Error(Err)+" ligne : " + Cstr(Erl)

Resume fin

fin:

End Sub

As i said, in spite of the error message, my document is saved and the User B is author.

I hope this is more Understandable.

Subject: RE: Workflow for the Web

When the WQS agent calls the ComputeWithForm() method of notesdocument object, it computes the author field on the document. Then the user doesn’t have edit access to it and error out when you call Save() method. So instead of calling Computewithform (Which is a heavy operation in terms of performance), set the authors field (Evaluate can be used to put the formula) and then save the document.

HTH

Adi