In our company we do have a wonderful, flexible, proven, stable own-built workflow engine, but it is written in Lotus Script code. baah..
I didn’t want to rewrite the whole thing in Java…
But you may now think: hey why does he not run an agent?
I tried, and I failed, how else!!! Always the way I understand things, they will never really work!
Luckily I then I found Kathy Browns article how to do it and it works!!!
Solution:
- put some value into the NotesDocument to “control” your logic in the LS agent
- run the agent with the document as parameter
- write some field in the agent into your document: NO NEED TO SAVE THE DOCUMENT!!!
- read the result from you NotesDocument in your xPage code and process it
My mistake was: I tried to update a field which was visible on the xPage, and here my approach failed.
Or could I manually “refresh” the xPage after the agent has run? Seems to be maybe a “timing” issue, cause the value is there, it’s only just not displayed in the field on the xPage. Anyone?
How we use this technique with our workflow engine:
The engine can require a comment to be given for certain target state. But the target state I don’t know yet in the xPage, cause this logic is handled in LS. But with the technique above I can create an agent provide the target action (reject/approve or something else), calculate the target state and find out if for that state a comment is required. If so I can then call a dialog in the xPage where the user can enter his comment. In the agent which runs then, to process the workflow, I then simply read this comment field and process it. In our case it’s written to a workflow log and also included in the notification to the approver of the next state
Nathan: did you read my comment to your comment? I bow to you..