OpenNTF.org - Lotus Workflow Classes to stru
My Links (Not logged in)
Code Bin Search
 
Hosted by Prominic.NET
Rate This Code
5 - brilliant stuff
4 - very nice
3 - average
2 - needs work
1 - bad
   OpenNTF Code Bin
About This Code
Brief Description:
Lotus Workflow Classes to structure Access to Organization + Application database 
Rating:
Not Rated Yet 
Contributor:
Christian Gorni 
Category:
Design Elements, Lotusscript 
Type:
Workflow 
Document Release:
V1.2.1 
Notes Version:
R6.x 
Last Modified:
27 Jan 2006 
OpenNTF Disclaimer

All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.

Code / Description
Now this is something for all the "special" people, who have the privelege to work with "Lotus Workflow".When I apply own LotusScript to Lotus Workflow, I sometimes need to access basic views, documents etc. from the product itself. For example a list of role documents stored in the organization database or a list of role members of a given role.

In order to have a structured approach to this problem, I created these two LotusScript Classes:
- LWFApplication
- LWFOrganization
which are a representation of the application and the organization databases.´

Available methods:

LWFApplication
============
new(db as NotesDatabase)
.getSetupDocument() As NotesDocument
.getDatabase() As NotesDatabase
.getOrganizationDB() As NotesDatabase
.getDefinitionDB() As NotesDatabase

LWFOrganization
=============
new(LWFAppl As LWFApplication)
.getDatabase() As NotesDatabase
.getMembersOfRole(rolename As String) As Variant
.getMembersOfWorkgroup(wgname As String) As Variant
.getPersonDocument(uname As String) As NotesDocument
.pickPersons(Title As String, Prompt As String, MultipleSelection As Boolean)
pickPersonsFromWorkgroup(Title As String, Prompt As String, MultipleSelection As Boolean, Level As Integer)

I hope this helps some of the adventurers out there who are tough enough to be a Lotus Worklfow programmer :-)

Ideas and additions are welcome!

C.

Usage / Example
In order to use it, just copy the "Lotus Workflow Classes" Library of the database to your Lotus Workflow Application (where the setup document is located) and declare it via
use "Lotus Workflow Classes"
in your "Options" section, like any other Library.

================ Code Example ==================
Dim session As New NotesSession
Dim db As NotesDatabase
Dim LWFOrga As LWFOrganization
Dim LWFAppl As LWFApplication
Dim persons1 As Variant
Dim persons2 as Variant

Set db = session.CurrentDatabase
Set LWFAppl = New LWFApplication(db)
Set LWFOrga = New LWFOrganization(LWFAppl)

Messagebox "Application Title: " & LWFAppl.getDatabase().title
Messagebox "Setup Doc Form: " & LWFAppl.getSetupDocument().Form(0)
Messagebox "OrgaDB Title: " & LWFAppl.getOrganizationDB().title

persons1 = LWFOrga.pickPersons("Test", "This is a test", False)
persons2 = LWFOrga.pickPersonsFromWorkgroup("Test", "This is a test", True, 0)

Forall p In Persons1
Messagebox p
End Forall

================= End ==================
Code Attachments
 Comments
Posted by zhou sheng on 11/01/2006 10:04:09 PMcan you provide a new version can be usesd with browser
what a pity
it can only be used with notes client
can you provide a new version can be usesd with browser
 Add your comment!