This chapter provides an overview of the Notify classes and discusses the following topics:
Scope of the notification classes.
Data types of the notification classes.
How to import the notification classes.
How to create a notification object.
Notification class constructors.
Notification class reference.
The notification classes are used for ad-hoc notification. These classes enable you to create and send a notification to someone. The notifications can either be a Peoplesoft Worklist item or an SMTP email message. The notification class also stores notifications in a table.
The notification classes can be called from a component, an internet script, or an Application Engine program.
All of the classes, and most of the properties and methods that make up the Notification Classes have a GUI representation in Peoplesoft Workflow. This document assumes that the reader is familiar with PeopleSoft Workflow.
See Also
Understanding PeopleSoft Workflow
The notification classes can be instantiated only from PeopleCode.
The notification classes can be called from a component, an internet script, or an Application Engine program.
Notification classes can be of Local, Global, or Component scope.
Every notification class is its own data type, that is, Notifications are declared as data type Notification, Notification addresses are declared as type NotificationAddress, and so on.
The following are the data types of the Notification Classes:
Notification
NotificationAddress
NotificationTemplate
WorklistEntry
Worklist
The Notification Classes are not built-in classes, like Rowset, Field, Record, and so on. They are Application Classes. Before you can use these classes in your PeopleCode program, you must import them to your program.
An import statement names either all the classes in a package or one particular application class. For importing the Notification classes, PeopleSoft recommends that you import all the classes in the application package.
The application package PT_WF_NOTIFICATION contains the following classes:
Notification
NotificationAddress
NotificationTemplate
The application package PT_WF_WORKLIST contains the following classes:
Worklist
WorklistEntry
The import statements you should use are as follows:
import PT_WF_NOTIFICATION:*; import PT_WF_WORKLIST:*;
Using the asterisks after the package name makes all the application classes directly contained in the named package available. Application classes contained in subpackages of the named package are not made available.
See Also
After you've imported the Notification classes, you instantiate an object of one of those classes using the constructor for the class and the Create function.
The following example creates a new instance of the WorklistEntry class, as the variable &MyWE, with local scope:
Local WorklistEntry &MyWE = Create WorklistEntry();
See Also
Notification Classes Constructors
You must use the constructor for each class to instantiate an instance of that class. The following are the constructors for the Notification Classes.
Syntax
Notification(NotifyFrom, dttmCreated, language_cd)
Description
Use Notification to instantiate a notification object.
Parameters
NotifyFrom |
Specify the entity the notification is being sent from, as a string. Avoid overusing generic entities with this parameter, as this value, along with the value for dttmCreated are the key to understanding where notifications originated from. |
dttmCreated |
Specify the datetime the notification is being sent, as a datetime value. |
language_cd |
Specify the 3-character language code of the current user, as a string. |
Returns
A notification object.
Example
import PT_WF_NOTIFICATION:*; import PT_WF_WORKLIST:*; Local Notification &MyNotify; &MyNotify = Create Notification("Workflow_Admin", %Datetime, %Language);
See Also
Syntax
NotificationAddress(Oprid, Description, Language, EmailId, Channel)
Description
Use NotificationAddress to instantiate a notification address.
This address is used to build a notification using the Notification class. This class is required if you want to use the Notification data type.
Parameters
Oprid |
Specify the UserID of the person receiving the notification, as a string. |
Description |
Specify the description of the entity receiving the notification (distribution group names, people's names, and so on) as a string. |
Language |
Specify the language code of the entity to be notified as a string. |
EmailId |
Specify the email address as a string. |
Channel |
Specify the 'channel' used for the notification, as a string. The values are: |
Value |
Description |
|
Notification is sent as email |
Worklist |
Notification is sent as a worklist |
Returns
None.
Example
import PT_WF_NOTIFICATION:*; import PT_WF_WORKLIST:*; Local NotificationAddress &MyNotify_Addy; &MyNotify_Addy = Create NotificationAddress(%UserID, &Description, %Language, &EmailID, &Channel);
See Also
Syntax
NotificationTemplate(ComponentId, Market, TemplateId, TemplateType)
Description
Use NotificationTemplate to instantiate a notification template.
If you're specifying a generic template, the first two parameters do not have to have values, that is, you must specify a Null string ("") instead.
Parameters
ComponentId |
Specify the name of the component the notification is coming from as a string. To specify a generic template, you must specify a Null string ("") for this value instead. |
Market |
Specify the name of the market of the component the notification is coming from as a string. To specify a generic template, you must specify a Null string ("") for this value instead. |
TemplateId |
Specify the template ID as a string. |
TemplateType |
Specify the type of template as a string. Values are:
|
Returns
An instance of the NotificationTemplate class.
Example
import PT_WF_NOTIFICATION:*; import PT_WF_WORKLIST:*; Local NotificationTemplate &Notify_Temp; /* create a generic template */ &Notify_Temp = Create NotificationTemplate("", "", "MyTemplate", "G");
See Also
Syntax
Worklist()
Description
Use the Worklist method to instantiate a Worklist object.
Parameters
None.
Returns
An instance of the Worklist class.
Example
The following example code creates a worklist.
import PT_WF_WORKLIST:*; Local Worklist &theWorklist = Create Worklist();
See Also
Syntax
WorklistEntry()
Description
Use WorklistEntry to instantiate a WorklistEntry object.
Parameters
None.
Returns
An instance of the WorklistEntry class.
Example
import PT_WF_NOTIFICATION:*; import PT_WF_WORKLIST:*; Local WorklistEntry &MyWorklistEntry = Create WorklistEntry();
See Also
This class is used to send a notification to people or people entities, as channel independent as possible. This enables functionality such as letting a user determine how to receive workflow notifications as a preference. It does not necessarily limit a person or entity to one channel.
See Notification Classes Examples.
See Using Notification Templates.
The Notification class imports the following classes:
NotificationAddress
WorklistEntry
Here are the import statements:
import PT_WF_NOTIFICATION:NotificationAddress; import PT_WF_WORKLIST:WorklistEntry;
In this section, we discuss the Notification class method Send.
Syntax
Send()
Description
Use the Send method to send a notification to the entities defined in the NotifyTo, NotifyCC, and NotifyBCC, using the Subject and Message properties.
Parameters
None.
Returns
None.
See Also
Understanding PeopleSoft Workflow.
In this section, we discuss the Notification class properties. The properties are discussed in alphabetical order.
Description
This property returns the content type of the value specified by the Message property, as a string. This property is used only with email Notifications, that is, with SMTP email.
This property is read-write.
See Also
Notification class: Message property.
Description
This property returns the Datetime the notification created as a datetime value. Together with NotifyFrom this makes a notification unique.
See Also
Notification class: NotifyFrom property.
Description
If an email is sent as a result of the Send method, this property returns the email reply that should be used, as a string. This property can have a different value from NotifyFrom. This property is valid only with notifications that have "email" specified as the channel.
This property is read-write.
See Also
Notification class: Send method, NotifyFrom property.
Description
This property returns an array of string, populated with the names of any file attachments sent with the notification. This property is valid only with notifications that have "email" specified as the channel.
This property is read-write.
Description
This property returns an array of string, populated with descriptions of any file attachments. The array order must be respective to the array order for FileNames, that is, file description matches file name one by using the same array index value. This property is valid only with notifications that have "email" specified as the channel.
This property is read-write.
See Also
Notification class: FileNames property.
Description
This property returns the 3-character language code used for the notification, as a string. This is used for tracking purposes.
This property is read-write.
Description
This property returns the text of the message sent with the notification as a string.
This property is read-write.
Description
This property returns an array of NotificationAddress objects, populated with the email addresses or worklist users of the people the notification is sent to. This list is used for notification information only, that is, the people on this list are generally not responsible for taking action specified by the notification. In addition, when you use the Notification Send method, other recipients cannot see the email addresses and or users that make up this array.
If you want to send a regular CC list, that is, one where the members of the list can see each other, use the NotifyCC property instead.
See Also
Notification class: NotifyCC property.
Description
This property returns an array of NotificationAddress objects, populated with the email addresses of the people the notification is sent to. This list is used for notification information only, that is, the people on this list are generally not responsible for taking action specified by the notification. When using the Notification Send method, the email address or worklist users of this array are exposed to the recipients of the notification.
If you want to send a blind-CC list, that is, where the members of the list cannot see each other, use the NotifyBCC property instead.
See Also
Notification class: NotifyBCC property.
Description
This property returns the ID of the entity sending the notification as a string. For example, ad-hoc workflow uses the current UserID.
This property is read-write.
Description
This property returns the GUID of the notification. This is a unique identifier used for tracking purposes only.
This property is read-write.
Description
This property returns an array of NotificationAddress objects, populated with the email addresses of the people the notification is sent to, and who are responsible for taking action if necessary.
To send the list to additional people, use the NotifyCC or NotifyBCC properties.
See Also
Notification class: NotifyCC property, NotifyBCC property.
Description
This property returns the name of the source component, that is, that initiated the notification process. This property is used for transaction tracking purposes only. This property is not required.
This property is read-write.
Description
This property returns the name of the market of the source component, that is, that initiated the notification process. This property is used for transaction tracking purposes only. This property is not required.
This property is read-write.
Description
This property returns the name of the menu of the source component, that is, that initiated the notification process. This property is used for transaction tracking purposes only. This property is not required.
This property is read-write.
Description
This property returns the subject used in the email notification as a string.
This property is read-write.
Description
If the notification message originated from a template, this property returns the name of that template, as a string. This property is used for transaction tracking purposes only. This property is not required.
This property is read-write.
The main purpose of the NotificationAddress is to define an entity to a 'channel', it is concerned at a high level only that a notification was sent.
See Notification Classes Examples.
See Using Notification Templates.
In this section, we discuss the NotificationAddress class properties. The properties are discussed in alphabetical order.
Description
This property returns the 'channel' used for the notification, as a string. The values are:
Value |
Description |
|
Notification is sent as email. |
Worklist |
Notification is sent as a worklist. |
This property is read-write.
Description
This property returns the description of the entity as a string. Entity descriptions include distribution group names or people's names.
This property is read-write.
Description
This property returns the Email Address of the entity to be notified.
This property is read-write.
Description
This property returns the language code of the entity to be notified.
This property is read-write.
Description
This property returns the UserID of the person receiving the notification as a string.
This property is read-write.
This class is useful for populating the message property of the Notification class.
See Using Notification Templates.
In this section, we discuss the NotificationTemplate class methods. The methods are discussed in alphabetical order.
Syntax
GetAndExpandTemplate(Language, Vars)
Description
Use the GetAndExpandTemplate method to expand and map the variables into the Text property of the template.
If this is a component template, you must use the SetupCompVarsAndRcpts method first, before you use this method.
If this is a generic template, you must use the SetupGenericVars method first, before you use this method.
The value returned by the Setup methods must be used as the second parameter for this method.
Parameters
Language |
Specify the 3-character language code used with the notification. |
Vars |
Specify the variable representing the XML string returned by either the SetupCompVarsAndRcpts method or the SetupGenericVars method. |
Returns
Returns a Boolean value: True if the template expanded properly, False otherwise.
Example
import PT_WF_NOTIFICATION:NotificationTemplate; Local NotificationTemplate & mynotifytemplate; &mynotifytemplate = create NotificationTemplate(%Component, %Market, &templateName, "C"); &xmlVars = &mynotifytemplate.SetupCompVarsAndRcpts(GetLevel0()); &mynotifytemplate.GetAndExpandTemplate(%Language, &xmlVars);
See Also
NotificationTemplate class: SetupCompVarsAndRcpts method, SetupGenericVars method.
Syntax
SetupCompVarsAndRcpts(&Rowset_Context)
Description
Use the SetupCompVarsAndRcpts method to set up variables for the component from the provided rowset. This method also sets up any additional recipients defined in the component.
The rowset corresponds to the component that the notification template was instantiated with. For example, if you created a notification template for JOB, the rowset used with this method should be based on the JOB component.
If you want to expand a component template, you must use this method first, before expanding the template.
Parameters
&Rowset_Context |
Specify an already instantiated and populated rowset containing the necessary variables. |
Returns
A string containing XML that is used by the GetAndExpandTemplate method.
Example
import PT_WF_NOTIFICATION:NotificationTemplate; Local NotificationTemplate & mynotifytemplate; &mynotifytemplate = create NotificationTemplate(%Component, %Market, &templateName, "C"); &xmlVars = &mynotifytemplate.SetupCompVarsAndRcpts(GetLevel0()); &mynotifytemplate.GetAndExpandTemplate(%Language, &xmlVars);
See Also
NotificationTemplate class: GetAndExpandTemplate method.
Syntax
SetupGenericVars(&AryValues)
Description
Use the SetupGenericVars method to pass values to a generic template.
To expand a generic template, you must use this method first, before expanding the template.
Parameters
&AryValues |
Specify an array of string containing values used with the expanded template. |
Returns
A string containing XML that is used by the GetAndExpandTemplate method.
Example
import PT_WF_NOTIFICATION:NotificationTemplate; . . . &mynotifytemplate = create NotificationTemplate("","", "MYTEMPLATE", "G"); /* Populate an array to contain the values needed by */ /* the template */ &aryValues = CreateArrayRept("", 0); &aryValues.Push("FIRST VALUE"); &aryValues.Push("SECOND VALUE"); &xmlVars = &mynotifytemplate.SetupGenericVars(&aryValues); &mynotifytemplate.GetAndExpandTemplate(%Language, &xmlVars);
See Also
NotificationTemplate class: GetAndExpandTemplate method.
In this section, we discuss the NotificationTemplate class properties. The properties are discussed in alphabetical order.
Description
This property returns a component for the component type notification template as a string. This is not required for generic templates.
This property is read-write.
Description
This property returns the notification instructions as a string.
This property is read-write.
Description
This property returns the language used to retrieve template descriptions, as a string.
This property is read-write.
Description
This property returns the market for component type notification templates as a string. This is not required for generic templates.
This property is read-write.
Description
This property returns the priority of the notification template as a string.
This property is read-write.
Description
This property is populated only if there are any RIMM responses.
This property is read-write.
Description
This property returns the subject of the notification template as a string.
This property is read-write.
Description
This property returns the template ID as a string. If you are creating a notification template, this property is always required.
This property is read-write.
Description
This property returns the template type as a string. Values are:
Value |
Description |
C |
Component |
G |
Generic |
If you are creating a notification template, this property is always required.
This property is read-write.
Description
This property returns the Template Text as a string.
This property is read-write.
The Worklist class is used to make mass modifications to worklist instances. Modifications to one worklist instance should be performed through the WorklistEntry class.
See Worklist.
In this section, we discuss the Worklist class method Reassign.
Syntax
Reassign(FromOperid, ToOperid)
Description
Use the Reassign method to reassign all worklist items with a state less than “Worked” from one user to another.
If you only want to reassign a single worklist entry, use the Reassign WorklistEntry class method.
Parameters
FromOperid |
Specify the user ID of the user from which you want to assign a worklist, as a string. |
ToOperid |
Specify the user ID of the user to which you want to assign a worklist, as a string. |
Returns
A boolean value: true if worklist was assigned successfully, false otherwise.
See Also
This class is used to create and or update a worklist entry.
See Understanding PeopleSoft Workflow.
In this section, we discuss the WorklistEntry class methods. The methods are discussed in alphabetical order.
Syntax
Create()
Description
Use the Create method to create a new WorklistEntry object.
This method is not the same as the Create constructor. The Create constructor only creates an instance of the WorklistEntry class. To add the entry to the database, you must use this method.
The following properties must be set before calling this method:
busactivity
buseventname
busprocname
worklist
If this method completes successfully, the following properties are populated:
instanceid
transactionid
Parameters
None.
Returns
This method returns a numeric value: 0 if there is an error, nonzero if entry created successfully.
Example
import PT_WF_WORKLIST:*; Local WorklistEntry &worklist; Local Number &Rslt; &worklist = create WorklistEntry(); &worklist.busprocname = "Administer Workflow"; &worklist.busactivity = "Send Note"; &worklist.buseventname = "Worklist Note"; &worklist.worklistname = "Worklist Note"; &Rslt = &worklist.Create();
See Also
WorklistEntry class: busactivity property, buseventname property, busprocname property, instanceid property, transactionid property.
Syntax
Reassign(Operid)
Description
The Reassign method assigns the worklist in the data buffers to the user specified by Operid. This method commits the version of the worklist entry in the data buffer to the database using the Save method.
If you want to reassign an entire worklist, use the Reassign Worklist class method.
Note. You must use the SelectByKey method to populate data buffers with the worklist entry.
Parameters
Operid |
Specify the user ID to which you want to assign the worklist entry, as a string. |
Returns
A boolean value: true if the reassignment was successful, false otherwise.
Example
import PT_WF_WORKLIST:WorklistEntry; Local WorklistEntry &wl = create WorklistEntry(); &wl.busprocname = WF_WORKLIST_VW2.BUSPROCNAME; &wl.busactivity = WF_WORKLIST_VW2.ACTIVITYNAME; &wl.buseventname = WF_WORKLIST_VW2.EVENTNAME; &wl.worklistname = WF_WORKLIST_VW2.WORKLISTNAME; &wl.instanceid = WF_WORKLIST_VW2.INSTANCEID; If (&wl.SelectByKey()) Then If Not (&wl.Reassign("TOPSUSER2")) Then /* Reassign error */ End-If; Else /* SelectByKey error */ End-If;
See Also
Syntax
Save()
Description
Use the Save method to save a WorklistEntry to the database.
PeopleCode Event Considerations
You must include this method within events that allow database updates. This includes the following PeopleCode events:
SavePreChange (Page)
SavePostChange (Page)
Workflow
Message Subscription
FieldChange
If this method results in a failure, all database updates are rolled back. All information the user entered into the component is lost, as if the user pressed ESC.
Parameters
None.
Returns
A numeric value: 0 if save didn't complete successfully, nonzero if save completed successfully.
Example
If (&worklist.Save() <> 0) Then /* success */ Else /* handle error */ End-If;
See Also
WorklistEntry class: Update method.
Syntax
SelectByKey()
Description
The SelectByKey method uses the key field values that have been assigned to build and execute a Select SQL statement. The field values are then fetched from the database SQL table into the worklist entry and the Select statement is closed.
If you don’t specify all the key fields, those you exclude are added to the Where clause with the condition equal to a blank value. If not all keys are set and more than one row is retrieved, you won't receive an error and SelectByKey won’t fetch any data.
Parameters
None.
Returns
A boolean value: true if the properties are set based on the database values, false otherwise.
Syntax
Update()
Description
Use the Update method to update the worklist entry with any property values that have changed, and assign values to the associated record in the database. However, this method does not commit the changes to the record in the database. You must use the Save method to update the database.
Parameters
None.
Returns
A numeric value: 0 if update didn't complete successfully, nonzero if update completed successfully.
Example
If (&worklist.Update() <> 0) Then &worklist.inststatus = "2" /* mark entry worked */ /* additional processing */ End-if;
See Also
WorklistEntry class: Save method.
In this section, we discuss the WorklistEntry class properties. The properties are discussed in alphabetical order.
Description
This property returns the Worklist action datetime as a datetime.
This property is read-write.
Description
This property returns the source activity name of the source business process as a string.
This property is read-write.
Description
This property returns the source event name of the source activity as a string.
This property is read-write.
Description
This property returns the source business process name as a string.
This property is read-write.
Description
This property returns the short comment the previous UserID gave when reassigning a worklist as a string.
This property is read-write.
Description
This property returns a flag that indicates if the worklist entry must be replicated. Values are:
Value |
Description |
Y |
Worklist entry needs to be replicated |
N |
Worklist entry does not need to be replicated |
This property is read-write.
Description
This property returns the Instance Id. This property is used with the following properties to make the worklist entry a unique number:
busprocname
busactivity
buseventname
worklistname
This property is read-write.
Description
This property returns the datetime that the worklist was selected to be worked as a datetime value.
This property is read-write.
Description
This property returns the Worklist Entry status as a string. The values are:
Value |
Description |
0 |
new worklist entry |
1 |
selected worklist entry |
2 |
worked worklist entry |
3 |
cancel string |
This property is read-write.
Description
This property returns the datetime the worklist entry timed out. Only some worklist types use this property.
This property is read-write.
Description
This property returns the datetime worklist was worked as a datetime value.
This property is read-write.
Description
This property returns the UserID that is assigned the worklist as a string.
This property is read-write.
Description
This property returns the UserID that caused the worklist to be created as a string.
This property is read-only.
Description
This property returns the previous UserID who used this worklist entry as a string.
This property is read-write.
Description
This property is reserved for future use.
This property is read-write.
Description
This property returns the status flag if the worklist has timed out. Values are:
Value |
Description |
Y |
Worklist has timed out |
N |
Worklist has not timed out |
This property is read-write.
Description
This property returns the transaction Id as a number, which represents the unit of work. This can be useful for pooled worklists.
This property is read-write.
Description
This property returns the URL to work for the worklist as a string. This is used only for replicating worklist entries across PeopleSoft databases.
This property is read-write.
Description
This property returns the priority of the worklist as a string. The values are:
Value |
Description |
low |
Worklist has low priority. |
medium |
Worklist has medium priority. |
high |
Worklist has high priority. |
This property is read-write.
Description
This property returns the number of days to select worklist as a number.
This property is read-write.
Description
This property returns the number of days to work the worklist as a number.
This property is read-write.
Description
This property returns the source worklist name for the source event string as a string.
This property is read-write.
The following are example of typical actions you perform using the notification classes.
See Using Notification Templates.
The following example creates a WorklistEntry.
The following is the complete code sample: the steps explain each line.
import PT_WF_WORKLIST:*; Local WorklistEntry &worklist; &worklist = create WorklistEntry(); &worklist.busprocname = "Administer Workflow"; &worklist.busactivity = "Send Note"; &worklist.buseventname = "Worklist Note"; &worklist.worklistname = "Worklist Note"; If (&worklist.Create() <> 0) Then &worklist.oprid = %UserId; Else /* handle error */ End-If; If (&worklist.Save() <> 0) Then /* success, create a corresponding row in */ /* application worklist record... */ Else /* handle error */ End-If;
To create a WorklistEntry:
Import the WorklistEntry class.
You must import the WorklistEntry class before you can use it in your PeopleCode program. In addition, the second line declares the variable &worklist as type WorklistEntry.
import PT_WF_WORKLIST:*; Local WorklistEntry &worklist;
Instantiate a WorklistEntry object.
Using the constructor, create an instance of the WorklistEntry class. This does not create a WorklistEntry. This creates a WorklistEntry object only. You must use the Create method to actually create the WorklistEntry in the system.
&worklist = create WorklistEntry();
Set the required parameters.
Some of the WorklistEntry class properties are required for every WorklistEntry. You must set a value for these properties before you can update or save the WorklistEntry.
&worklist.busprocname = "Administer Workflow"; &worklist.busactivity = "Send Note"; &worklist.buseventname = "Worklist Note"; &worklist.worklistname = "Worklist Note";
Create the WorklistEntry.
After you've set the required values, you need to create the WorklistEntry in the system. This does not update the database. This does, however, add values to the notification tables.
If this method completes successfully, the following properties are populated: instanceid and transactionid.
instanceid
transactionid
If (&worklist.Create() <> 0) Then &worklist.oprid = %Userid; Else /* handle error */ End-If;
Save the WorklistEntry.
After you've created the WorklistEntry, save it. The Save method actually updates the database, and so can be used only in events that allow database updates.
If (&worklist.Save() <> 0) Then /* success, create a corresponding row in */ /* application worklist record... */ Else /* handle error */ End-If;
The following example updates a WorklistEntry so that it is considered worked.
The following is the complete code sample: the steps explain each line.
import PT_WF_WORKLIST:*; Local WorklistEntry &worklist; &worklist = create WorklistEntry(); &worklist.busprocname = "Administer Workflow"; &worklist.busactivity = "Send Note"; &worklist.buseventname = "Worklist Note"; &worklist.worklistname = "Worklist Note"; &worklist.instanceid = 2; &ret = &worklist.SelectByKey(); &worklist.inststatus = "2"; /* mark entry worked */ If (&worklist.Update() <> 0) Then If (&worklist.Save() <> 0) Then /* success */ Else /* handle error */ End-If; Else /* handle error */ End-If;
To update a WorklistEntry:
Import the WorklistEntry class.
You must import the WorklistEntry class before you can use it in your PeopleCode program. In addition, the second line declares the variable &worklist as type WorklistEntry.
import PT_WF_WORKLIST:*; Local WorklistEntry &worklist;
Instantiate a WorklistEntry object.
Using the constructor, create an instance of the WorklistEntry class. This does not create a WorklistEntry. This creates a WorklistEntry object only. You must use the Create method to actually create the WorklistEntry in the database tables, and the Save method to update the tables.
&worklist = create WorklistEntry();
Set the required parameters.
Some of the WorklistEntry class properties are required for every WorklistEntry. You must set a value for these properties before you can update or save the WorklistEntry. The instanceid property, combined with the other properties, indicates a unique WorklistEntry. This value is populated after a WorklistEntry has already been created.
&worklist.busprocname = "Administer Workflow"; &worklist.busactivity = "Send Note"; &worklist.buseventname = "Worklist Note"; &worklist.worklistname = "Worklist Note"; &worklist.instanceid = 2;
Populate the worklist entry with data.
After you've set the keys, populate the worklist entry based on those keys using the SelectByKey method.
&ret = &worklist.SelectByKey();
Update and save the WorklistEntry.
After you've set the required parameters, try to update the WorklistEntry. If that is successful, mark the WorklistEntry as 'worked', and try to save the WorklistEntry. The Save method actually updates the database, and so can be used only in events that allow database updates.
If (&worklist.Update() <> 0) Then &worklist.inststatus = "2" /* mark entry worked */ If (&worklist.Save() <> 0) Then /* success */ Else /* handle error */ End-If; Else /* handle error */ End-if;