You are on page 1of 66

Documentum Developer Conference 2001 9/9/01 12:43

Inside Documentum
Workflow
Gladys Pang

Pang 1
Documentum Developer Conference 2001 9/9/01 12:43

Agenda
 Concepts
 Workflow and Lifecycle
 Building a complex workflow
 Simple workflow
 Path selection
 Dynamic performer
 Advanced Features
 Automated activities
 Distributed workflow
 Workflow and Lifecycle
 Lifecycle procedures

Pang 2
Documentum Developer Conference 2001 9/9/01 12:43

Documentum Workflow
 Mechanism to model a business process
 A network of tasks performed by a user or
the system
 Flow of data from task to task
 Logic that governs the sequence of tasks

Engr.
Dept. Approval
Edit Publish
Review
Mktg.
Approval

You can use Workflow to model a business process. Workflow is task


centric. As in the example, there are Edit, Review, etc.

You can define tasks to be performed by user manually or by the system


automatically. For example, you can make Publish an automatic task.

You can send different numbers of document in a workflow.

You can set up the logic in the workflow to control the flow of the tasks. As in
the Approval tasks, the next task can be forwarded to Publish or rejected to
Edit.

Pang 3
Documentum Developer Conference 2001 9/9/01 12:43

Documentum Lifecycle
 Mechanism to specify the location, security,
ownership and other policies that govern the
document in each phase of its existence
 Modeled as a sequence of states and the
transitions between them
 Entry Criteria
 Actions
 Post Actions

Author Review Publish Retire

Withdrawn

Lifecycle is document centric.

Lifecycle is used to control the location, security, ownership etc for different
phases of the document.

To use Lifecycle, you define phases or states for a document. In each state
the document has different control parameters such as location, permission
and ownership.

You use Lifecycle to control the transition of the states and therefore the
document's control parameters. You can define transition tests and actions
to be run as Entry Criteria, Action, or Post Action during the state transition.

Pang 4
Documentum Developer Conference 2001 9/9/01 12:43

Workflow And Lifecycle


 A document can only have one Lifecycle at a
given time
 It can participate in many Workflow processes
 Lifecycle allows us to factor out the document
policy from the business process
 Lifecycle and Workflow often work in
conjunction to produce the desired system
behavior

Lifecycle Workflow

A document can only have one Lifecycle at a given time. But it can
participate in many Workflow processes.

Lifecycle allows us to factor out the document policy from the business
process.

Lifecycle and Workflow often work in conjunction to produce the desired


system behavior. We will go through this in more detail in the Workflow and
Lifecycle topic which comes in later of the presentation.

Pang 5
Documentum Developer Conference 2001 9/9/01 12:43

Workflow Model
Process Design
and Definition Workflow Manager

Build Time
Workflow Templates
Run Time

Process
Instantiation Server Workflow Engine
and Control

Interaction with Applications


Users and and IT Tools
Application Tools

This is a high level picture for DCTM workflow model.

We have Workflow Manager to create the Workflow definition which is called


workflow template.

At runtime we create a workflow instance which refers to the workflow


template.

The server workflow engine controls the flow logic according to the workflow
definition in the workflow template.

User performs on the tasks through the client application. Or the task itself
be performed by some applications.

Pang 6
Documentum Developer Conference 2001 9/9/01 12:43

Workflow Enactment
Workflow Manager

Workflow Template

Interpreted by
Workflow
Control Data
Maintains

Server Workflow
Engine References Content

Administration
and Control Through
update
method
invocation

Task List Applications

Invokes
Client's Inbox and
Supervisor Task Manager

Here we have a closer look at the Workflow functional components.Starting


from the top, we have Workflow Manager which is used to create workflow
template. Workflow template can also reference alias set and LDAP
integration in its definition.

Coming to the center of the diagram is the workflow runtime control. In the
center is the Server Workflow Engine, maintained by Workflow Supervisor. It
controls automated aspect of the business process

The Workflow Engine references the the routing document (content).

The Workflow Engine also maintains a set of workflow control data. It is


used to control the processing of the existing tasks and to determine the
next tasks.

Going down to the bottom of the picture, task list is created for manual
tasks. In this case, performer receives the task in the Inbox. He completes
the task through the Task Manager interface of the client.

For automatic tasks, the Workflow Engine will invoke the applications
directly. Here the applications can talk to the Workflow Engine through
server methods and/or DFC.

Pang 7
Documentum Developer Conference 2001 9/9/01 12:43

Object Model And Relationship


Business Process
is defined in a is managed by

Workflow Template used to create Workflow Instance


and manage
Process Definition Workflow Instance
dm_process dm_workflow

composed of include one


two or more or more

Activity during execution Task


is represented by
Activity Definition Work Item
dm_activity dmi_
dmi_workitem
associate
associate with one
with or more

Queue Item Package


dmi_queue_item
dmi_queue_item dmi_package
dmi_package

Here is the object model in DCTM server.


* Business Process - what is intended to happen
* On the left is the Design Time Definition. Workflow Template is defined by
- Process Definition - dm_process, representation of what’s intended to
happen
- Activity Definition - dm_activity, representation of what’s intended to
achieve at a logical step
* On the right is the Run Time Management
- Workflow Instance - dm_workflow, controls automated aspect of the
business process and record runtime information of workflow
- Task - record run time information of activity
- Work Item - dmi_workitem, task allocated to task performers
- Queue Item - dmi_queue_item, peer item for work item for querying in
Inbox
- Package - dmi_package, references documents and comments routed
among task

Pang 8
Documentum Developer Conference 2001 9/9/01 12:43

Client Object Model And


Relationship
Task
queries for
Inbox Queue Item
dmi_queue_item
dmi_queue_item

invokes
Task
Work Item
manipulates dmi_
dmi_workitem
Task Manager associate
associate with one
with or more

Queue Item Package


dmi_queue_item
dmi_queue_item dmi_package
dmi_package

Here is the object model in DCTM client.


* Inbox - provides a list of tasks you are responsible for
* Task Manager - provides details of a task and allows user to perform the
task

Pang 9
Documentum Developer Conference 2001 9/9/01 12:43

Agenda
 Concepts
 Building a Workflow
 Simple Workflow
 Path Selection
 Dynamic Performer
 Advanced Features
 Workflow and Lifecycle

Pang 10
Documentum Developer Conference 2001 9/9/01 12:43

Building A Simple Workflow

 Approve Activity - allow delegate and repeat; require sign off

1) Basic process of building a workflow


* Log on the Workflow Manager.
* Drag and drop the activity from template to the drawing panel
* Connect the activities using the flow tool
* Set the parameters in Activity Inspector and Flow Inspector
* Save, validate and install the workflow template

2) Build a simple workflow


* Start with a simple linear workflow template that contains signoff, repeat,
and delegate
* Template detail:
Approve - allow delegate and repeat, require sign off

Pang 11
Documentum Developer Conference 2001 9/9/01 12:43

Building A Simple Workflow


Activity Inspector

1) Basics of the Performer tab


* Performer information
* Delegate, reassign, and signoff information

2) Set Approve task for delegate, repeat, and signoff


* Select the Approve activity
* Bring up the Activity Inspector by double click, menu item, or toolbar
* Go to Performer tab
* Check the appropriate check boxes

Pang 12
Documentum Developer Conference 2001 9/9/01 12:43

Building A Simple Workflow


Flow Inspector

1) Basics of the Package tab


* Package information
* Port/link definition

2) Add the package to the flows


* Multi-select all the flows
* Bring up the Flow Inspector by double click, menu item, or toolbar
* Go to Packages tab
* Add new package
* You can change to an optional package from the Version column
* Check apply to all selected check box
* Apply

Pang 13
Documentum Developer Conference 2001 9/9/01 12:43

Running A Simple Workflow


Start Workflow

1) Invoke Start Workflow


* Log on to Desktop Client
* Navigate to the installed workflow template
* Invoke Start Workflow by double click or Open menu item

2) Start Workflow Component


* Add package
* Add comment and define who to send the comment to

Pang 14
Documentum Developer Conference 2001 9/9/01 12:43

Running A Simple Workflow


Start Workflow
(1) Start with workflow template
(2) Create workflow instance
(3) Execute workflow

dm_activity
Submit
dm_activity
dm_process Review
dm_activity
Approve
dm_activity
Publish

dm_workflow
-----------------------
dormant
running

What’s happening during Start Workflow


1) Start with workflow template
* The workflow template objects: dm_process, a list of dm_activity objects
2) Create workflow instance
* Create a dm_workflow object
* dm_workflow points to the workflow template dm_process
* Save dm_workflow
* dm_workflow is in Dormant state
3) Run the workflow
* Execute dm_workflow
* dm_workflow is in Running state

Pang 15
Documentum Developer Conference 2001 9/9/01 12:43

Running A Simple Workflow


Start Workflow
Add package to start activities

dm_activity
Submit
dm_process Task

dmi_workitem
Submit
dm_workflow ------------------
dormant
dmi_queue_item
Submit
dmi_package
Submit - Doc A dm_note
comment

Inbox
----------
Τ Submit

What’s happening when add package to the workflow


1) The usual workflow template objects
* The workflow template objects: dm_process, a list of dm_activity objects
2) The workflow instance
* dm_workflow which points to the workflow template dm_process
* dm_workflow is in Running state
3) Adding package to workflow triggers the start activities
* Workflow receives the package
* Required packages of the start activities are fulfilled, ready to start
* Workflow engine creates the task objects:
The task objects contains: dmi_workitem, peer dmi_queue_item,
dmi_package to hold the document, dm_note to hold the user comments if
any
* Task is in Dormant state
4) Task in Inbox
* Client Inbox queries dmi_queue_item for the user

Pang 16
Documentum Developer Conference 2001 9/9/01 12:43

Workflow Runtime States


Workflow
termination
criteria is met
Initial state
Execute
Dormant Running Finished

Halt Abort
Resume
Restart

Abort
Halted Terminated

This diagram shows the the workflow states and the related API calls.
API calls are in italic.

Initially workflow is in Dormant state. Once execute, it’s in Running state. If


the workflow runs smoothly to the end, it goes to Finished state.

If there are any error during the execution of the workflow, it becomes
Halted state. You can continue the workflow by restart or resume.

At any time, you can abort the workflow and it changes to Terminated state.

Pang 17
Documentum Developer Conference 2001 9/9/01 12:43

Running A Simple Workflow


Start Workflow
Use IDfWorkflowBuilder in DFC
' Create IDfWorkflowBuilder object.
Set wfBuilder = session.newWorkflowBuilder(processId)
' Save workflow.
wfBuilder.initWorkflow
' Set the workflow to run.
wfBuilder.runWorkflow

' Add package to each start activity.


docIdList.appendId docObjId
wfBuilder.addPackage activityNameStr,
portNameStr,
pkgNameStr,
pkgTypeStr,
noteText,
notePersistent,
docIdList

A more complete example for start workflow:


' Create IDfWorkflowBuilder object.
' Add document to each package in the start activities
Set wfBuilder = session.newWorkflowBuilder(processId) For actIndex = 0 to (actList.getCount() - 1)
' Save workflow only once. ' Find activity object_id and activity name in the template.
wfBuilder.initWorkflow Set actId = sActivities.getId(actIndex)
actName = sActivityNames.getString(actIndex)
' < Any alias set thing goes here. Not covered in presentation. >
Set activity = session.getObject(actId)
' Set the workflow to run.
wfBuilder.runWorkflow ' Find the number of packages.
' < Set dynamic performer here. Will be covered in later slides. pkgCount = activity.getPackageCount()
> ' Get all the packages and insert the INPUT type pkgs
For pkgIndex = 0 To (pkgCount - 1)
If activity.getPortType(pkgIndex) = "INPUT" Then
' Get start activities and their names to IDfList objects. ' We have an INPUT package
' So now we can find out the packages for the start activities.
' Retrieve all the relative data for setting package info.
Set actList = wfBuilder.getStartActivityIds() pkgName = activity.getPackageName(pkgIndex)
Set actNameList = wfBuilder.getStartActivityNames() pkgLabel = activity.getPackageLabel(pkgIndex)
pkgType = activity.getPackageType(pkgIndex)

' Add package to each start activity.


docIdList.appendId docObjId
wfBuilder.addPackage activityNameStr, portNameStr,
pkgNameStr, pkgTypeStr,
noteText, notePersistent,
docIdList
Next pkgIndex
Next actIndex

Pang 18
Documentum Developer Conference 2001 9/9/01 12:43

Running A Simple Workflow


Complete Task

1) Navigate to Inbox
* Log on to Desktop Client
* Navigate to Inbox
2) Invoke Task Manager
* Select task in the Inbox
Task is in Dormant (ready) state
* Invoke Task Manager by double click or Open menu item
3) Task Manager Component
* Task information
* Document information and action
* Comment reviewing, adding, deleting
* Finish or reassign (delegate)
4) Finish Dialog of Task Manager
* Finish the task or also have someone else repeat the task
* Signoff requirement

Pang 19
Documentum Developer Conference 2001 9/9/01 12:43

Running A Simple Workflow


Complete Task
(1) Task in Inbox
(2) Acquire task dm_activity
(3) Complete task Approve
dm_process

dmi_workitem
Approve
dm_workflow ------------------
dormant
acquired
finished
dmi_queue_item
Approve
dmi_package
Approve-DocA dm_note

Inbox
----------
Τ Approve

What’s happening when perform task in Inbox


1) The usual workflow template objects
* The workflow template objects: dm_process, a list of dm_activity objects
2) The workflow instance
* dm_workflow which points to the workflow template dm_process
3) Task in Inbox
* The task objects contains: dmi_workitem, peer dmi_queue_item,
dmi_package to hold the document, dm_note to hold the user comments if
any
* Task is in Dormant state
4) Open task in Task Manager
* Task Manager acquires the task automatically
* Task is in Acquired state
5) Finish task in Task Manager
* Task Manager finishes the task
* Task is in Finished state
* Task is dequeued from Inbox

Pang 20
Documentum Developer Conference 2001 9/9/01 12:43

Running A Simple Workflow


Complete Task
dm_activity
Create next task Publish
(task transition)
dm_process

dmi_workitem
dmi_queue_item
Approve
Approve dmi_package
dm_workflow Approve - DocA
dm_note

dmi_workitem
Publish
--------------
dormant

dmi_queue_item
Publish

dmi_package Inbox
Publish - DocA ----------
Τ Publish

What’s happening when server finishes one task and creates the next task
1) The usual workflow template objects
* The workflow template objects: dm_process, a list of dm_activity objects
2) The workflow instance
* dm_workflow which points to the workflow template dm_process
* Workflow records the previous task is finished
* Workflow Engine creates the new task and points to the new task
3) Previous task
* The task objects contains: dmi_workitem, peer dmi_queue_item,
dmi_package to hold the document, dm_note to hold the user comments if
any
* Task is in Finished state
* Task objects hangs around
4) Next task
* The task objects contains: new dmi_workitem, new peer dmi_queue_item,
new dmi_package to hold the document, existing dm_note to hold the user
comments if any
* Task is in Dormant state
* Task appears in Inbox

Pang 21
Documentum Developer Conference 2001 9/9/01 12:43

Work Item Runtime States

Acquire
Complete
Dormant Acquired Finished
Reassign

WF:Halt Restart
Resume/ WF:Halt
Pause Reassign Restart

D/A/P Paused
WF:Halt

Paused Restart

This diagram shows the the work item states and the related API calls.
API calls are in italic.

Initially work item is in Dormant state. Once acquired, it goes to Acquired


state. If the work item completes, it becomes Finished.

If there are any error during the execution of the work item, it becomes
Paused state. You can continue the work item by resume.

If at any time the workflow containing the work item is halted, the work item
becomes DPaused, APaused, or PPaused depending on the original state of
the work item. Once get into D, A, or P Paused state, the work item will go
back to its original state only if the workflow is restarted.

Pang 22
Documentum Developer Conference 2001 9/9/01 12:43

Running A Simple Workflow


Complete Task
Use IDfWorkitem in DFC
' Acquire work item (IDfWorkitem) to accept task.
If (witem.getRuntimeState() = 0) Then ' 0 = dormant
witem.acquire
End If

' Sign off if needed.


If (witem.isSignOffRequired() = TRUE) Then
witemPersistenObj.signoff userOSNameStr,
passwdStr,
"signoff task"
End If

' Finish the task.


witem.complete

A more complete example for complete task:

' Show the attached documents in the task.


' Acquire the work item (IDfWorkitem) to accept the task.
' Get all the associated packages into IDfCollection collection If (witem.getRuntimeState() = 0) Then ' 0 = dormant
Set collection = m_workItem.getPackages("") witem.acquire
While (collection.Next()) End If
Set typeObject = collection ' Delegate the task to user or group if necessary.
' Attached documents are stored in r_component_id. If (witem.isDelegatable() = TRUE And chooseToDelegate) Then
docCount = witem.delegateTask(delegateUserNameStr)
typeObject.getValueCount("r_component_id") ' Done with the task - So exit function here.
Exit Sub
' Some information about the package.
End If
packageName =
typeObject.getString("r_package_name") ' < Set dynamic performer here. Will be covered in later slides. >
packageObjId = typeObject.getString("r_object_id") ' < Set next activities here. Will be covered in later slides. >
For docIndex = 0 To (docCount - 1)
' Sign off if needed.
Set docObjId = typeObject.getRepeatingId( If (witem.isSignOffRequired() = TRUE) Then
"r_component_id", docIndex) witemPersistenObj.signoff userOSNameStr, passwdStr, "signoff task"
Set docObj = session.getObject(docObjId) End If
docObjType = docObj.getString("r_object_type") ' Repeat the task if necessary.
Next docIndex If (witem.isRepeatable() = TRUE) Then
Wend ' Add user names to the IDfList userNameList.
userNameList.appendString userName
collection.Close
witem.repeat(userNameList)
Set collection = Nothing End If

' Finish the task.


witem.complete

Pang 23
Documentum Developer Conference 2001 9/9/01 12:43

Running A Simple Workflow


Delegate Task
(1) Task in Inbox
(2) Acquire task dm_activity
(3) Delegate task Approve
dm_process

dmi_workitem
dmi_workitem
Approve
Approve
dm_workflow ------------------
------------------
acquired
dormant
dormant dmi_queue_item
dmi_queue_item
dmi_queue_item
Manager DavidMartin Approve
Approve
Approve
-------------
-------------
-------------
Manager
Manager David
David
Martin
dmi_package
Approve-DocA dm_note

Inbox (Martin)
Inbox (David)
(David)
---------------
---------------
Τ
Τ Approve
Τ Approve
Approve

What’s happening when delegate task in Inbox


1) The usual workflow template objects
* The workflow template objects: dm_process, a list of dm_activity objects
2) The workflow instance
* dm_workflow which points to the workflow template dm_process
3) Open Task in Task Manager from Inbox
* The task objects contains: dmi_workitem, peer dmi_queue_item,
dmi_package to hold the document, dm_note to hold the user comments if
any
* Task changes from Dormant to Acquired state
4) Reassign task in Task Manager
* Workflow Engine changes the performer name in dmi_workitem and
dmi_queue_item
* Task reset to Dormant state
* Task removes from original performer Inbox and appears in the new
performer Inbox

Pang 24
Documentum Developer Conference 2001 9/9/01 12:43

Running A Simple Workflow


Repeat Task
(1) Task in Inbox dm_activity
(2) Acquire task Approve
dm_process
(3) Repeat task
(4) Complete task

dmi_queue_item
dm_workflow Approve
--------------
dmi_workitem David
Approve
----------------
David, Complete
David, Acquired
Dormant dmi_package
Martin, Dormant Approve - DocA
dm_note
dmi_queue_item
Approve
-------------- Inbox (David) Inbox
Inbox(David)
(Martin)
Martin -------------- --------------
--------------
ΤΤApprove
Approve

What’s happening when repeat task in Inbox


1) The usual workflow template objects
* The workflow template objects: dm_process, a list of dm_activity objects
2) The workflow instance
* dm_workflow which points to the workflow template dm_process
3) Open task in Task Manager from Inbox
* The task objects contains: dmi_workitem, peer dmi_queue_item,
dmi_package to hold the document, dm_note to hold the user comments if
any
* Task changes from Dormant to Acquired state
4) Repeat and finish task in Task Manager
* Workflow Engine marks the original performer done with the task
* Workflow Engine adds the new performer name to the dmi_workitem and
creates new dmi_queue_item for the new performer
* Task removes from original performer Inbox and appears in the new
performer Inbox

Pang 25
Documentum Developer Conference 2001 9/9/01 12:43

Agenda
 Concepts
 Building a Workflow
 Simple Workflow
 Path Selection
 Dynamic Performer
 Advanced Features
 Workflow and Lifecycle

Pang 26
Documentum Developer Conference 2001 9/9/01 12:43

Adding Path Selection

 Transition logic at Submit and Review


 Trigger logic at Revise
 Archive will wait on an event notification before it starts

Adding Peer Review such that multiple persons can review the document.
Adding multiple Approve so that there can be multiple persons to sign off.
Adding Archive activity.

Changing the basic workflow template to multiple paths with decision logic
for trigger and transition
1) Activities
* Transition logic at Submit and Review
Allow the performer of Submit and Review to determine the next tasks
* Trigger logic at Revise
Allow Revise to start when any of the previous activity has finished
* Archive will wait on an event for notifying Publish is done before it starts
2) Flows
* Reject flow from Review to Revise

Pang 27
Documentum Developer Conference 2001 9/9/01 12:43

Adding Path Selection


Setting Transition Condition

1) Basics of the Transition tab


* Determine what to do when the task is completed
* Transition types:
- all - all next tasks will be started
- manual transition - performer chooses the next tasks (forward or reject)
- auto transition - server picks the next tasks based on the condition
defined

2) Set Submit task for manual transition


* Select the Submit activity
* Bring up the Activity Inspector by double click, menu item, or toolbar
* Go to Transition tab
* Check the appropriate radio button

Pang 28
Documentum Developer Conference 2001 9/9/01 12:43

Adding Path Selection


Setting Trigger Condition

1) Basics of the Trigger tab


* Determine when to start this task
* Trigger conditions:
- all - all previous tasks are done
- some - certain number of previous tasks are done
- event - the task will not start until a certain event arrives
* Number of times the activity can run

2) Set Revise task for manual transition


* Select the Revise activity
* Bring up the Activity Inspector by double click, menu item, or toolbar
* Go to Trigger tab
* Check the appropriate radio button and specify 1 input

Pang 29
Documentum Developer Conference 2001 9/9/01 12:43

Adding Path Selection


Reject Path

There is no build-in reject path as compared to router. So you have to add


the reject paths explicitly.

1) Set Review task for manual transition


* Select the Review activity
* Bring up the Activity Inspector by double click, menu item, or toolbar
* Go to Transition tab
* Check the appropriate radio button

Pang 30
Documentum Developer Conference 2001 9/9/01 12:43

Adding Path Selection


Event Trigger

1) Set Archive task for event transition


* Select the Archive activity
* Bring up the Activity Inspector by double click, menu item, or toolbar
* Go to Trigger tab
* Check the wait on event check box and specify an event name

Pang 31
Documentum Developer Conference 2001 9/9/01 12:43

Managing Path Selection


Select Next Tasks

1) Navigate to Inbox
* Log on to Desktop Client
* Navigate to Inbox
2) Invoke Task Manager
* Select task in the Inbox
* Invoke Task Manager by double click or Open menu item
* Task changes from Dormant to Acquired state
3) Finish Dialog of Task Manager
* Finish the task by selecting the next activities

Pang 32
Documentum Developer Conference 2001 9/9/01 12:43

Managing Path Selection


Select Next Tasks
(1) Acquire task
as usual dm_activity
Revise dm_activity
(2) Select next tasks Approve1
(3) Complete task dm_activity
as usual Review
dm_process dm_activity
Approve2

dmi_workitem
dm_workflow Review
--------------
Next Task = Revise

dmi_queue_item
Review
dmi_package
Review - DocA
Inbox
----------
Τ Review

What’s happening during select next tasks


1) The usual workflow template objects
* The workflow template objects: dm_process, a list of dm_activity objects
2) The workflow instance
* dm_workflow which points to the workflow template dm_process
3) Open task in Task Manager from Inbox
* The task objects contains: dmi_workitem, peer dmi_queue_item,
dmi_package to hold the document, dm_note to hold the user comments if
any
* Task changes from Dormant to Acquired state
4) Select next tasks and finish
* Workflow Engine marks the selected next tasks to the current work item
* Task Manager finishes the task
* Task is in Finished state
* Task is dequeued from Inbox

Pang 33
Documentum Developer Conference 2001 9/9/01 12:43

Managing Path Selection


Select Next Tasks
Use IDfWorkitem::setOutput in DFC
' Acquire work item (IDfWorkitem) to accept task.
If (witem.getRuntimeState() = 0) Then ' 0 = dormant
witem.acquire
End If

’ Determine transition type.


If (witem.isManualTransition() = TRUE) Then
' Get the activity and add it to the IDfList of next acts.
outList.append activityObj
' Add the forward/reject activities to the output.
witem.setOutputByActivities outList
End If

' Finish the task.


witem.complete

A more complete example with select output path:


' Acquire the work item (IDfWorkitem) to accept the task.
' Sign off if needed.
If (witem.getRuntimeState() = 0) Then ' 0 = dormant If (witem.isSignOffRequired() =
witem.acquire TRUE) Then
End If witemPersistenObj.signoff
userOSNameStr, passwdStr, "signoff
task"
' < Set dynamic performer here. Will be covered in later slides. > End If

' Repeat the task if necessary.


'Determine transition type. If (witem.isRepeatable() = TRUE)
If (witem.isManualTransition() = TRUE) Then Then
' Get the possible forward activities into IDfList. ' Add user names to the IDfList
userNameList.
Set forwardActObjs = witem.getForwardActivities()
userNameList.appendString
' Get the rejectable activities into IDfList. userName
Set rejectActObjs = witem.getRejectActivities() witem.repeat(userNameList)
End If

' Loop the forward and reject activities and ' Finish the task.
' decide which paths to take. witem.complete

' Get the activity and add it to the IDfList of next acts.
outList.append activityObj
' Add the forward/reject activities to the output.
witem.setOutputByActivities outList
End If

Pang 34
Documentum Developer Conference 2001 9/9/01 12:43

Managing Path Selection


Trigger And Transition Settings
(1) Determine next tasks:
- All, manual or auto transition (1)Transition Condition: All, Manual, Auto?

(2) Trigger conditions


of next tasks
(3) Task transition dm_activity dm_activity
Current Next
dm_process

(2)Fulfill Trigger
dmi_workitem Conditions?
Current
dm_workflow -----------dmi_queue_item
finished Current dmi_package
Current

dmi_workitem
Next
-----------dmi_queue_item Inbox
dormant Next dmi_package ----------
(3)Create New Task Next Τ Next

What’s happening during task transition and triggering


1) The usual workflow template objects
* The workflow template objects: dm_process, a list of dm_activity objects
2) The workflow instance
* dm_workflow which points to the workflow template dm_process
3) The current task is finished
* Task is in Finished state
* Check the corresponding activity definition
* Determine if the transition is all, manual, or auto
* Find out the next task based on the transition conditions
4) Before creating the next task
* Check the corresponding activity definition
* Determine if the trigger conditions are fulfilled: number of previous finished
tasks, wait on event
* Workflow Engine waits if the trigger conditions are not fulfilled
5) Create the new task

Pang 35
Documentum Developer Conference 2001 9/9/01 12:43

Managing Path Selection


Send Event to Workflow
Use IDfSession::queue in DFC
Function MyPublishApplication

Publish Job here

Set sysObject = workflowObject


Set queueId = sysObject.queue(toUserName,
eventNameStr,
priorityInt,
sendMailBool,
dueDate,
messageStr)
...
End Function

This wait on event mechanism is useful when you have a task that has to be
performed externally to DCTM system.

You will have a task (Publish) to notify the external agent and then finish to
the next task. It will be the next task to wait for the finish event of the
external agent. The external agent will perform its operation. When the
external agent is done with the task, it simply notifies the workflow by
sending a finish event. Once the workflow receives the event, the next task
(Archive) will be triggered.

Pang 36
Documentum Developer Conference 2001 9/9/01 12:43

Agenda
 Concepts
 Building a Workflow
 Simple Workflow
 Path Selection
 Dynamic Performer
 Advanced Features
 Workflow and Lifecycle

Pang 37
Documentum Developer Conference 2001 9/9/01 12:43

Dynamic Performer Selection

 Submit chooses performer of PeerReview


 Performer for Approve will be the manager of the performer of
Review

Changing Peer Review and Review from multiple to one activity.


Changing their performers to be assigned dynamically.

Changing the multi-path workflow template to single path with dynamic


performer
1) Activities
* Peer Review (performer to be chosen in Submit)
Submit task performer will choose some users to perform on Peer Review
* Review (performer to be resolved from previous task performer)
Review will be performed by Revise performer’s manager

Pang 38
Documentum Developer Conference 2001 9/9/01 12:43

Dynamic Performer Selection


Peer Review

1) Basics of the Select Performer Wizard


* performer types
* Performer values:
- Real user name
- To be picked at runtime by some previous activities
- To be resolved from alias set of document or previous performer

2) Set Peer Review performer to be select at runtime by Submit


* Select the Peer Review activity
* Bring up the Activity Inspector by double click, menu item, or toolbar
* Go to Performer tab
* Select Some Users from Group
* Select to be assigned at runtime in activity Submit
* Next to select a default group name
* Define a real default group name

Pang 39
Documentum Developer Conference 2001 9/9/01 12:43

Managing Dynamic Performer

1) Navigate to Inbox
* Log on to Desktop Client
* Navigate to Inbox
2) Invoke Task Manager
* Select task in the Inbox
* Invoke Task Manager by double click or Open menu item
* Task changes from Dormant to Acquired state
3) Finish Dialog of Task Manager
* Select performers for Peer Performer task
* Choose any number of users from the predefined group
* Finish task

Pang 40
Documentum Developer Conference 2001 9/9/01 12:43

Managing Dynamic Performer


(1) Acquire task as usual
(2) Select dynamic performers
(3) Complete task as usual
dm_process
--------------- dm_activity dm_activity
Submit->PeerReview Submit PeerReview

dm_workflow
----------------
dm_workflow
PeerReview - UserA dmi_workitem
PeerReview - UserB Submit

dmi_queue_item
Submit
dmi_package
Inbox
Submit - DocA
----------
Τ Submit

What’s happening during select dynamic performers


1) The usual workflow template objects
* The workflow template objects: dm_process, a list of dm_activity objects
2) The workflow instance
* dm_workflow which points to the workflow template dm_process
3) Open task in Task Manager from Inbox
* The task objects contains: dmi_workitem, peer dmi_queue_item,
dmi_package to hold the document, dm_note to hold the user comments if
any
* Task changes from Dormant to Acquired state
4) Select dynamic performer
* Workflow Engine marks the selected performers for Peer Review in
dm_workflow object
5) Finish task
* Task Manager finishes the task
* Task is in Finished state
* Task is dequeued from Inbox

Pang 41
Documentum Developer Conference 2001 9/9/01 12:43

Managing Dynamic Performer


Task transition when using dynamic performer

dm_process
--------------- dm_activity dm_activity
Submit->PeerReview Submit PeerReview

dm_workflow
---------------- dmi_workitem
PeerReview - WriterGreen PeerReview
PeerReview - WriterCooley dmi_queue_item
-------------
WriterGreenPeerReviewdmi_package
PeerReview -
DocA
dmi_workitem
PeerReview
dmi_queue_item
--------------
WriterCooley PeerReviewdmi_package Inbox (WriterGreen)
PeerReview -
----------------
DocA Inbox (WriterCooley)
Τ PeerReview
----------------
Τ PeerReview

What’s happening during task transition using dynamic performer


1) The usual workflow template objects
* The workflow template objects: dm_process, a list of dm_activity objects
2) The workflow instance
* dm_workflow which points to the workflow template dm_process
3) The next task is determined
* See detail in Task Transition for Trigger and Transition in previous slides
4) Before creating the next task
* Check the corresponding activity definition
* Determine if the performer is determined dynamically
* Workflow Engine reads the performer selection from dm_workflow object
5) Create the new tasks

Pang 42
Documentum Developer Conference 2001 9/9/01 12:43

Managing Dynamic Performer


Using IDfWorkflow::setPerformers in DFC
' Acquire the work item (IDfWorkitem) to accept the task.
If (witem.getRuntimeState() = 0) Then ' 0 = dormant
witem.acquire
End If

' Set dynamic performer if required.


nameList.appendString performerName
workflow.setPerformers actName, nameList

' Finish the task.


witem.complete

A more complete example for displaying dynamic performer to choose from:


' Find the act_choose_by entries for the current activity name.
' Find out the default group if choosing for "some users from group".
actChooseCount = process.getActChooseByCount()
If (perfType = 8 And InStr(groupValue, "%") = 1) Then
For actChooseIndex = 0 To actChooseCount - 1 ' Need to check if the default group is an alias name
actChooseBy = processObj.getActChooseBy(actChooseIndex) ' Then resolve alias before setting it.
If (StrComp(actChooseBy, currActivityName) = 0) Then
' Try to resolve the alias.
actChooseFor = Set wfPerObj = workflow
processObj.getActChooseFor(actChooseIndex) groupValue = session.resolveAlias(wfPerObj.getObjectId(),
groupValue)
' Find the "select from" group value. It's the performer_name End If
defaultPerfGroup = groupValue
' in the activity object. If it's an alias name, need to resolve
' alias to figure out the group value. ' Find out the user should choose "one or more user values"
' or a group value.
If (perfType = 3) Then ' 3 = specific user
' Obtain the activity object.
chooseType = CHOOSE_SINGLE_USER_FROM_ALL_USERS
Set processPersistentObj = processObj ElseIf (perfType = 4) Then ' 4 = all users in group
locateIndex = processPersistentObj.apiGet("locate", chooseType = CHOOSE_SINGLE_GROUP_FROM_ALL_GROUPS
ElseIf (perfType = 5 Or perfType = 6) Then ' 5,6 = single user in group
"r_act_name," & currActivityName)
chooseType = CHOOSE_SINGLE_GROUP_FROM_ALL_GROUPS
Set actObjId = processObj.getActivityDefId(locateIndex) ElseIf (perfType = 8) Then ' 8 = some users in group
Set actObj = session.GetObject(actObjId) chooseType = CHOOSE_ANY_FROM_DEFAULT_GROUP
End If
' Find out the performer type and name for the activity. ' Provide interface for user to choose the dynamic performers.
perfType = actObj.getPerformerType
groupValue = actObj.getPerformerName End If
Next actChooseIndex

Pang 43
Documentum Developer Conference 2001 9/9/01 12:43

Performer Alias
Review

Assume the user has alias set which contains the manager alias.

1) Basics of the performer alias options in Select Performer Wizard


* Workflow initiator defines
* Resolve from specific alias set
* Resolve from document’s alias set
* Resolve from previous performer’s alias set

2) Set Review performer to be resolved at runtime from previous performer’s


alias set
* Select the Review activity
* Bring up the Activity Inspector by double click, menu item, or toolbar
* Go to Performer tab
* Select Specific User
* Select to be resolved from alias set at runtime
* Next to select resolve from previous performer

Pang 44
Documentum Developer Conference 2001 9/9/01 12:43

Managing Performer Alias


Task transition when using performer alias
dm_activity
Review
dm_activity
-----------------
Revise
dm_process %manager
resolved from prev perf

dmi_workitem
Revise
dm_workflow dmi_queue_item
-------------
WriterMary Revise dmi_package
Revise - DocA

dmi_workitem
Review
dmi_queue_item
----------------
ManagerDavid Review dmi_package
Inbox
Review - DocA
dm_alias_set ----------
dm_user
-------------------------- Τ Review
WriterMary manager = ManagerDavid

What’s happening during task transition using performer alias


1) The usual workflow template objects
* The workflow template objects: dm_process, a list of dm_activity objects
2) The workflow instance
* dm_workflow which points to the workflow template dm_process
3) The next task is determined
* See detail in Task Transition for Trigger and Transition in previous slides
4) Before creating the next task
* Check the corresponding activity definition
* Determine if the performer is determined from alias set
* Workflow Engine resolves the alias name to a real user or group according
to the resolution setting
5) Create the new tasks

Pang 45
Documentum Developer Conference 2001 9/9/01 12:43

Agenda
 Concepts
 Building a Complex Workflow
 Advanced Features
 Automated Activities
 Distributed workflow
 Workflow and Lifecycle

Pang 46
Documentum Developer Conference 2001 9/9/01 12:43

Automatic Task
 Publish and Archive become auto
tasks

 Publish and Archive become auto tasks

Changing Publish and Archive into automatic tasks


1) Activities
* Publish and Archive
Change to auto task to run workflow methods

Pang 47
Documentum Developer Conference 2001 9/9/01 12:43

Adding Automatic Task

Assuming Publish will be done in the lifecycle Action during document promote
==> Publish = Promote in WF

1) Basics of the Performer tab in Auto Mode


* Performer
* Execution method
* Execution result
* Execution time – how long the server should run the method before timing out
* Error handling

2) Set Publish to automatic activity


* Select the Publish activity
* Bring up the Activity Inspector by double click, menu item, or toolbar
* Go to Performer tab
* Select perform automatically
* Select user in Select Performer Wizard
* Select Promote method, save result, 60 seconds, and stop execution (60 sec
has to be between the min and max attribute values on dm_method)

Pang 48
Documentum Developer Conference 2001 9/9/01 12:43

Managing Automatic Task


Automatic task

dm_process dm_activity dm_method


Publish PublishMethod

No Queue Item for Automatic Task!


dm_workflow dmi_workitem
Publish

dmi_package
dm_sysobject
Publish - DocA
Publish -
Execution Log

Inbox
----------

What’s happening during select dynamic performers


1) The usual workflow template objects
* The workflow template objects: dm_process, a list of dm_activity objects
2) The workflow instance
* dm_workflow which points to the workflow template dm_process
3) Automatic task is created
* The task objects contains: dmi_workitem, dmi_package to hold the
document, dm_note to hold the user comments if any
* No peer dmi_queue_item
* Task references its auto method
4) Executing automatic task
* Workflow Engine runs the method defined in dm_activity
* Method acquires and completes the task
* Workflow Engine saves execution log and handles error according to the
dm_activity definition

Pang 49
Documentum Developer Conference 2001 9/9/01 12:43

Workflow Automatic Activities


Basic code structure
Sub MyAutoMethod(ByVal stub1 As String, ByVal docbase As String, _
ByVal stub2 As String, ByVal user As String, _
ByVal stub3 As String, ByVal workItemId As String, _
ByVal stub4 As String, ByVal ticket As String, _
ByVal stub5 As String, ByVal mode As String)
' Session connection.
...
' Get work item object.
Set workItem = session.GetObject(clientX.getId(workItemId))
' Acquire the work item.
workItem.acquire
' Custom operations go here.
...
' Complete the workitem.
workItem.complete
End Sub

A more complete example for writing a workflow method:

Sub MyAutoMethod(ByVal stub1 As String, ByVal docbase As String, _


' Get work item id object.
ByVal stub2 As String, ByVal user As String, _ errorMsg = "Getting work item id object"
ByVal stub3 As String, ByVal workItemId As String, _ Set workItemIdObj = clientX.getId(workItemId)
ByVal stub4 As String, ByVal ticket As String, _ ' Get work item object.
errorMsg = "Getting work item object"
ByVal stub5 As String, ByVal mode As String)
Set workItem = session.GetObject(workItemIdObj)
On Error GoTo MyAutoMethod_Error
Dim clientX As Object 'dfclib.DfClientX ' Acquire the work item only when mode = "0" for not restarting.
If mode = "0" Then
Dim client As Object 'IDfClient
errorMsg = "Acquiring work item"
Dim errorMsg as String workItem.acquire
Dim session As Object 'IDfSession End If
Dim workItem As Object
' My custom operations go here.
Dim workItemIdObj As Object
' Complete the workitem. Assume there is only
' Get a session. ' one output port for this task.
errorMsg = "Completing work item"
errorMsg = "Connecting to docbase"
workItem.complete
Set clientX = CreateObject("Documentum.Dfc")
Set loginInfo = clientX.getLoginInfo() Exit Sub
MyAutoMethod_Error:
loginInfo.setUser user
Print errorMsg ' This message will go to the result log.
logininfo.setPassword ticket dmExit (100)
Set client = clientX.getLocalClient() End Sub
Set session = client.getSharedSession(docbase, loginInfo,
"WF_Auto_Method")

Pang 50
Documentum Developer Conference 2001 9/9/01 12:43

Workflow Automatic Activities


 Sample method
 Promote Lifecycle

Pang 51
Documentum Developer Conference 2001 9/9/01 12:43
' (c) Copyright Documentum, Inc., 2001
' WF_PromoteLifeCycle
' -- This method is used for Workflow. It acquires the work item,
' promotes all documents of the current work item, and completes
' the work item.
Sub PromoteLifeCycle(ByVal stub1 As String, ByVal docbase As String, ByVal stub2 As String, _
ByVal user As String, ByVal stub3 As String, ByVal workItemId As String, _
ByVal stub4 As String, ByVal ticket As String, ByVal stub5 As String,
ByVal mode As String)
On Error GoTo PromoteLifeCycle_Error
Dim clientX As Object 'dfclib.DfClientX
Dim client As Object 'IDfClient
Dim doc, docIdObj, packageCollection, session, workItem As Object
Dim docIdStr, errorMsg, lifeCycleState as String
Dim lifeCycleOverride, lifeCycleTestOnly as Boolean

lifeCycleState = "" ' Promote to the next default state.


lifeCycleOverride = False
lifeCycleTestOnly = False

' Get a session.


Set clientX = CreateObject("Documentum.Dfc")
Set loginInfo = clientX.getLoginInfo()
loginInfo.setUser user
logininfo.setPassword ticket
Set client = clientX.getLocalClient()
Set session = client.getSharedSession(docbase, loginInfo, "WF_Auto_Method")

' Get work item object.


Set workItem = session.GetObject(clientX.getId(workItemId))
' Acquire the work item only when mode = "0" for not restarting.
If mode = "0" Then
workItem.acquire
End If

' Promote document life cycle for each document.


Set packageCollection = workItem.getPackages("")
While packageCollection.Next
docIdStr = packageCollection.getString("r_component_id")
Set docIdObj = clientX.getId(docIdStr)
Set doc = session.GetObject(docIdObj)
doc.promote lifeCycleState, lifeCycleOverride, lifeCycleTestOnly
Wend
packageCollection.Close

' Complete the workitem. Assume there is only one output port for this task.
workItem.complete

Exit Sub
PromoteLifeCycle_Error:
Print errorMsg
dmExit (100)
End Sub

Pang 52
Documentum Developer Conference 2001 9/9/01 12:43

Workflow Automatic Activities


 When there is an execution error in
automatic task
 Stop Execution - Task will be put in Paused
state and reassigned to Workflow Supervisor
 Continue Execution - Task will be continued
to the next task
 What should a Workflow Supervisor do
when error occurs
 Check execution results
 Fix the problem
 Rerun the task!

Pang 53
Documentum Developer Conference 2001 9/9/01 12:43

Workflow Automatic Activities

1) Navigate to Inbox
* Log on to Desktop Client
* Navigate to Inbox
2) Invoke Task Manager
* Select task in the Inbox
* Invoke Task Manager by double click or Open menu item
* Notice the add-on to the instruction by the Desktop Client Task Manager
3) Finish task
* Showing the execution log
* Finish task by choosing either to
- rerun the automatic method - no more human interaction
- or, manually complete the task - get the normal Finish Dialog

Pang 54
Documentum Developer Conference 2001 9/9/01 12:43

Agenda
 Concepts
 Building a Complex Workflow
 Advanced Features
 Automated Activities
 Distributed workflow
 Workflow and Lifecycle

Pang 55
Documentum Developer Conference 2001 9/9/01 12:43

Distributed Workflow
 Distributed
 route a foreign document
 route to a remote user
 Federated environment
 notion of home Docbase
 users, groups, types, and ACLs are known to all
participating Docbases
 Workflow definitions, workflow initiator, and all
runtime objects are all in single Docbase
 Only queue item is replicated to user’s
home Docbase

When a work item is assigned to a remote user, a work item and the peer
queue item are generated in the Docbase where the process definition and
the containing workflow reside.

The notification agent for the source Docbase replicates the queue item in
the user’s home Docbase. Using these queue items, the home Inbox
connects to the source Docbase and retrieves all information necessary for
the user to perform the work item tasks. A remote user must be able to
connect to the source Docbase to work on a replicated queue item.

Pang 56
Documentum Developer Conference 2001 9/9/01 12:43

Agenda
 Concepts
 Building a Complex Workflow
 Advanced Features
 Workflow and Lifecycle
 Lifecycle Procedures

Pang 57
Documentum Developer Conference 2001 9/9/01 12:43

Workflow And Lifecycle


 A Document can have only lifecycle at a
given time
 It can participate in many workflow processes
 Lifecycle allows us to factor out the document
policy from the process
 Lifecycle and Workflow often work in
conjunction to produce the desired system
behavior

Lifecycle Workflow

Pang 58
Documentum Developer Conference 2001 9/9/01 12:43

Workflow And Lifecycle


Application 1

Author In Review Published Archived

Start WF Promote

S Submit Approve Publish E

Review

Example using document Lifecycle to drive Workflow process


* When document is promoted from Author to In Review state, the state
transition logic of In Review triggers to start workflow, providing the
document as the content for the workflow
* The workflow continues to Submit, Review, Approve and Publish
* Publish invokes the promote Lifecycle method. The document is promoted
to Published state from In Review state

Pang 59
Documentum Developer Conference 2001 9/9/01 12:43

Workflow And Lifecycle


Application 2

Author In Review Published Archived

Promote Promote

S Submit Review Publish

Auto Promote Approve

Example using Workflow process to drive document Lifecycle


* Starting from a workflow, after the document is submitted, workflow runs
an automatic promote Lifecycle task on the document
* Document is promoted from Author to In Review state
* The workflow continues to Review, Approve and Publish
* Publish invokes the promote Lifecycle method. The document is promoted
to Published state from In Review state

Pang 60
Documentum Developer Conference 2001 9/9/01 12:43

Lifecycle Transition
Promote
Start
(Begin Transaction)
Entry Criteria

No
Success?
Yes

Change Lifecycle State

Action

No
Success?
Yes
Post Action End
End (Abort Transaction)
(Commit Transaction)

During the promote, server goes through a sequence of tests/standard


actions/procedures as defined in a state of a Lifecycle. These steps are
done in a transaction.

For each state of a Lifecycle, there are Entry Criteria, Action, and Post
Action. You can define the transition tests, standard actions and/or
procedures for each of these steps in DDS.

During a promotion, the Entry Criteria will be executed. If it fails, the


transaction will be aborted and the promotion fails.

If the Entry Criteria succeeds, the Lifecycle state of the document will be
changed to the next state. And then the Actions will be executed. If it fails,
the transaction will be aborted and the promotion fails.

After Actions, the Post Actions will be executed and the transaction will be
completed. The promotion does not depend on the result of the Post
Actions.

Pang 61
Documentum Developer Conference 2001 9/9/01 12:43

Lifecycle Procedures
 Sample procedure
 launching Workflow from Lifecycle

Pang 62
Documentum Developer Conference 2001 9/9/01 12:43
' (c) Copyright Documentum, Inc., 2001
' Sample_Lifecycle_StartWF ' Set package for workflow activities.
' -- This script launches the workflow Sample_WF_Lifecycle_Template ' Assume there is only one package going
' with the document attached to this document life cycle. ' to all starting activities.
' This function has to be called EntryCriteria. ' Prepare the doc id list for add package.
' This is used in the Entry Criteria procedure of life cycle ErrorStack = "Creating document id list"
' Sample_Lifecycle_For_WF. Set docIdList = clientX.getList()
Set docId = clientX.getId(ObjectId)
' The returned value of EntryCriteria will be false if error
docIdList.appendId docId
' is encountered; true, otherwise.
Public Function EntryCriteria(ByVal SessionID As String, _ ' Find out start activities id and names.
ByVal ObjectId As String, _ ErrorStack = "Getting workflow start activity ids"
Set actIdList = wfBuilder.getStartActivityIds()
ByVal UserName As String, _ ErrorStack = "Getting workflow start activity names"
ByVal TargetState As String, _ Set actNameList = wfBuilder.getStartActivityNames()
ByRef ErrorStack As String) As Boolean
' For each start activity/package, add package.
On Error GoTo EntryCriteria_Error ErrorStack = "Looping start activities to add package"
Dim clientX as Object 'dfclib.DfClientX actCount = actIdList.getCount
Dim client as Object 'IDfClient For actIndex = 0 To actCount - 1
ErrorStack = "Getting workflow start activity index =" _
Dim session as Object 'IDfSession
+ Str(actIndex)
Dim process as Object 'IDfProcess Set actId = actIdList.getId(actIndex)
Dim wfBuilder as Object 'IDfWorkflowBuilder Set act = session.getObject(actId)
Dim docId, actId, processId as Object 'IDfId
actName = actNameList.getString(actIndex)
Dim docIdList, actIdList, actNameList as Object 'IDfList pkgCount = act.getPackageCount()
Dim act as Object 'IDfActivity For pkgIndex = 0 To pkgCount - 1
Dim actCount, actIndex, pkgCount, pkgIndex as Integer portType = act.getPortType(pkgIndex)
If portType = "INPUT" Then
Dim actName, portName, portType, pkgName, pkgLabel, _ portName = act.getPortName(pkgIndex)
pkgType, queryString as String pkgName = act.getPackageName(pkgIndex)
pkgLabel = act.getPackageLabel(pkgIndex)
pkgType = act.getPackageType(pkgIndex)
' Get a session.
ErrorStack = "Getting session" ' Attach the current document.
Set clientX = CreateObject("Documentum.Dfc") ErrorStack = "Adding package to activity=" + _
Set client = clientX.getLocalClient() actName + ",pkgName=" + pkgName
wfBuilder.addPackage actName, portName, _
Set session = client.adoptDMCLSession(SessionID) pkgName, pkgType, _
"This is a note", False, _
' Get the workflow template object id. docIdList
End If
ErrorStack = "Getting workflow template id"
Next pkgIndex
queryString = "dm_process where object_name = Next actIndex
'Sample_WF_Lifecycle_Template'"
Set processId = session.getIdByQualification(queryString) ' Sucess and done.
EntryCriteria = True
Exit Function
' Create workflow builder with corresponding process. EntryCriteria_Error:
ErrorStack = "Creating new workflow builder with process id = " + _ ' Error handling.
processId.toString() Print ErrorStack
EntryCriteria = False
Set wfBuilder = session.newWorkflowBuilder(processId) End Function

' Assume there is no performer aliasing in workflow.


ErrorStack = "Initializing workflow"
dfcVersion = clientX.getDFCVersion
If InStr(1, dfcVersion, "4.1", 1) = 1 Then
wfBuilder.initWorkflow
ErrorStack = "Running workflow"
wfBuilder.runWorkflow
Else
wfBuilder.startWorkflow ' For 4.0.X docbase
End If

Pang 63
Documentum Developer Conference 2001 9/9/01 12:43

Questions?

Pang 64
Documentum Developer Conference 2001 9/9/01 12:43

Summary
 Workflow features
 Build a complex workflow
 Run workflow using DFC
 Server runtime object detail
 Using Workflow and Lifecycle
together

Pang 65
Documentum Developer Conference 2001 9/9/01 12:43

Workflow Teminology
Activity (design time)
- task definition, included in a workflow template
Dynamic Performer (both design and run time)
- performer to be defined at runtime
Flow or Link (design time)
- connects two activities
Package (both design and run time)
- design time - store the definition for the routing documents
- run time - a placeholder to store the routing documents and comments
Performer (both design and run time)
- user or group who works on the task in workflow
Performer Alias (both design and run time)
- performer defined in an alias representation
Port (design time)
- part of the activity definition, placeholder for a link. From activity’s point of
view, it only sees ports but not links
Task (run time)
- a logical step of work in a workflow at runtime
Workflow Instance (run time)
- workflow at runtime
Workflow Template (design time)
- workflow definition set up at design time

Pang 66

You might also like