Monday, June 22, 2009

How do I troubleshoot workflows which contain automatic activity

To troubleshoot workflows which contain automatic activity that does not run follow the steps below:
1. Check if workflow agent is up and running.
Here is what you look in the docbase log file to see if workflow agent has started up fine.
Wed Mar 10 19:52:06 2004 122000 [DM_WORKFLOW_I_AGENT_START]info: "Workflow agent master (pid : 3512, session 010003e880000007) is started sucessfully."
Wed Mar 10 19:52:07 2004 122000 [DM_WORKFLOW_I_AGENT_START]info: "Workflow agent worker (pid : 2872, session 010003e88000000a) is started sucessfully."
Wed Mar 10 19:52:08 2004 122000 [DM_WORKFLOW_I_AGENT_START]info: "Workflow agent worker (pid : 2860, session 010003e88000000b) is started sucessfully."
Wed Mar 10 19:52:09 2004 122000 [DM_WORKFLOW_I_AGENT_START]info: "Workflow agent worker (pid : 2892, session 010003e88000000c) is started sucessfully."

When docbase starts up, it starts workflow agent master and worker threads and prints above message to server logfile
Workflow agent cannot be started manually. It starts up during docbase startup.

2. The default out of the box automatic workflow method that we ship with server is called dm_noop_auto_method.
When automatic activity does not run please create a simple workflow with first activity as dm_noop_auto_method and second activity as a manual task.
Please turn on trace launch for dm_noop_auto_method, and run the workflow.
Trace launch information in logged in the docbase log.

Set Trace Launch attribute to True on the custom method object and run the Workflow again. Any errors that are encountered with the method will be displayed in the Server log. Review the server log and the trace launch information, check the method verb. The method verb and trace launch attribute can be checked

3. Check for wrong

spellings and case sensitivity in the method verb.
Dump the dm_noop_auto_method and compare with one in-house.

4. Dump the method object, check the attributes, use_method_content, method verb. If the
use_method_content attribute is set to True, your method verb attribute should not include a ?-f? parameter, it?s not necessary.
Example : ./dmbasic eEntry_Point

5. If you have users that are not receiving tasks following an automatic activity, check the
workflow_disabled attribute on those specific users. Dump the user, using the Dump API.
Example: dump ,c,

6. Please dump the server config object
dump,c,serverconfig

Please look for following two parameters.
wf_agent_worker_threads : 3
wf_sleep_interval : 3

By default out of the box server comes with these two parameters set to 3.

How to check timeout?
You can check your method timeouts using the following query
select r_object_id,object_name,launch_async,timeout_min,timeout_default,timeout_max from dm_method
where the timeout values are min <= default <= max. These values are valid for synchronous methods.


Why do I recieve an error message stating that 'Activity instance failed' ?

You may find that some of the documents make the transition and repeated requests to force the transition of the other documents eventually succeeds.For each method, the server launches a process to run it. For workflow automatic activity methods, the process is always launched synchronously. That means, if the process does not finish within time_out, the server kills the process. The time_out value comes from exec_time_out attribute of dm_activity, and it must fall between timeout_min and timeout_max attributes of the dm_method. Therefore this value can exist between 30 seconds and 7 days.

To resolve the above issue increase the timeout for automatic activities in your workflow. By default when creating an automatic activity the timeout for is 60 seconds.

How to know the r_runtime_state of the failed activites?

select r_runtime_state from dm_workflow where r_object_id in (select router_id from dmi_queue_item where where message like 'Activity instance%failed%' and router_id!='0000000000000000')


select a.r_object_id,a.object_name,a.process_id,a.supervisor_name,a.r_runtime_state,b.task_number,b.task_state,b.task_name,b.message,b.sent_by,b.date_sent from dm_workflow a,dmi_queue_item b where a.r_object_id=b.router_id and a.r_object_id in (select router_id from dmi_queue_item where message like 'Activity instance%failed%' and router_id!='0000000000000000')

No comments: