Professional Documents
Culture Documents
Inside Documentum Workflow
Inside Documentum Workflow
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 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
Withdrawn
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
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.
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
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
Invokes
Client's Inbox and
Supervisor Task Manager
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
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
Pang 8
Documentum Developer Conference 2001 9/9/01 12:43
invokes
Task
Work Item
manipulates dmi_
dmi_workitem
Task Manager associate
associate with one
with or more
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
Pang 11
Documentum Developer Conference 2001 9/9/01 12:43
Pang 12
Documentum Developer Conference 2001 9/9/01 12:43
Pang 13
Documentum Developer Conference 2001 9/9/01 12:43
Pang 14
Documentum Developer Conference 2001 9/9/01 12:43
dm_activity
Submit
dm_activity
dm_process Review
dm_activity
Approve
dm_activity
Publish
dm_workflow
-----------------------
dormant
running
Pang 15
Documentum Developer Conference 2001 9/9/01 12:43
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
Pang 16
Documentum Developer Conference 2001 9/9/01 12:43
Halt Abort
Resume
Restart
Abort
Halted Terminated
This diagram shows the the workflow states and the related API calls.
API calls are in italic.
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
Pang 18
Documentum Developer Conference 2001 9/9/01 12:43
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
dmi_workitem
Approve
dm_workflow ------------------
dormant
acquired
finished
dmi_queue_item
Approve
dmi_package
Approve-DocA dm_note
Inbox
----------
Τ Approve
Pang 20
Documentum Developer Conference 2001 9/9/01 12:43
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
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.
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
Pang 23
Documentum Developer Conference 2001 9/9/01 12:43
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
Pang 24
Documentum Developer Conference 2001 9/9/01 12:43
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
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 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
Pang 28
Documentum Developer Conference 2001 9/9/01 12:43
Pang 29
Documentum Developer Conference 2001 9/9/01 12:43
Pang 30
Documentum Developer Conference 2001 9/9/01 12:43
Pang 31
Documentum Developer Conference 2001 9/9/01 12:43
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
dmi_workitem
dm_workflow Review
--------------
Next Task = Revise
dmi_queue_item
Review
dmi_package
Review - DocA
Inbox
----------
Τ Review
Pang 33
Documentum Developer Conference 2001 9/9/01 12:43
' 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
(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
Pang 35
Documentum Developer Conference 2001 9/9/01 12:43
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
Pang 38
Documentum Developer Conference 2001 9/9/01 12:43
Pang 39
Documentum Developer Conference 2001 9/9/01 12:43
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
dm_workflow
----------------
dm_workflow
PeerReview - UserA dmi_workitem
PeerReview - UserB Submit
dmi_queue_item
Submit
dmi_package
Inbox
Submit - DocA
----------
Τ Submit
Pang 41
Documentum Developer Conference 2001 9/9/01 12:43
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
Pang 42
Documentum Developer Conference 2001 9/9/01 12:43
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.
Pang 44
Documentum Developer Conference 2001 9/9/01 12:43
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
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
Pang 47
Documentum Developer Conference 2001 9/9/01 12:43
Assuming Publish will be done in the lifecycle Action during document promote
==> Publish = Promote in WF
Pang 48
Documentum Developer Conference 2001 9/9/01 12:43
dmi_package
dm_sysobject
Publish - DocA
Publish -
Execution Log
Inbox
----------
Pang 49
Documentum Developer Conference 2001 9/9/01 12:43
Pang 50
Documentum Developer Conference 2001 9/9/01 12:43
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
' 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
Pang 53
Documentum Developer Conference 2001 9/9/01 12:43
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
Lifecycle Workflow
Pang 58
Documentum Developer Conference 2001 9/9/01 12:43
Start WF Promote
Review
Pang 59
Documentum Developer Conference 2001 9/9/01 12:43
Promote Promote
Pang 60
Documentum Developer Conference 2001 9/9/01 12:43
Lifecycle Transition
Promote
Start
(Begin Transaction)
Entry Criteria
No
Success?
Yes
Action
No
Success?
Yes
Post Action End
End (Abort Transaction)
(Commit 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.
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
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