Thursday, June 9, 2011

API steps for workflow

here are the API steps to create a workflow instance:

>create,c,dm_workflow

(from this point on, l is the workflow object id)

>set,c,l,object_name

>your_object_name

>set,c,l,process_id

>your_wf_template_id

>save,c,l

> (if you need to fill out the alias set info, you can do it now)

> execute,c,l

> addpackage,c,l,...... (fill in your parameters. Please refer to the server manual. You have to make one addpackage call for each start activity and package)

________________________________________________________________________________

To start a workflow using APIs, log into the docbase using iapi or iapi32 on NT. Type the following commands at the API> prompt:

retrieve,c,dm_process where object_name = ''
(workflow template id will be returned)

create,c,dm_workflow
(workflow id will be returned)

set,c,l,process_id
(at the SET prompt enter the id of the workflow template)

save,c,l
(OK should be returned)

execute,c,l
(OK should be returned)

addpackage,c,l,Activity,Input:0,Pack age0,dm_document,,,(dmi_package_item id returned)

The 'l' listed above is a lower case L. It's an alias that means to use the last object_id returned.

This can also be done from the Interactive Message Tester in the Desktop Client or from Documentum Administrator

No comments: