Workflow DQL

select distinct xxx_atrb1, due_date, xxxx, task_state, name 
from xxx_custom_folder, dmi_queue_item, dmi_package, dm_workflow, dm_process, dmi_workitem 
where due_date >= date(’03/01/2020′) and due_date <= date(’04/01/2020′) 
and dmi_queue_item.router_id=dmi_package.r_workflow_id 
and dm_workflow.r_object_id=dmi_queue_item.router_id 
and dm_workflow.r_object_id=dmi_workitem.r_workflow_id 
and dm_workflow.process_id=dm_process.r_object_id 
and task_name like ‘%Custom Task Name%’ 
and ANY dmi_package.r_component_id = cms_custom_folder.r_object_id
order by name;

find by date & finished ones:

select distinct cms_custom_id, cms_processing_type, cms_custom_date, cms_task_due_date, due_date, cms_pkg_custom_location, task_state, name 
from cms_custom_folder, dmi_queue_item, dmi_package, dm_workflow, dm_process, dmi_workitem 
where date_sent >= date(’03/01/2020′) and date_sent <= date(’04/01/2020′) 
and task_state in (‘finished’) 
and dmi_queue_item.router_id=dmi_package.r_workflow_id 
and dm_workflow.r_object_id=dmi_queue_item.router_id 
and dm_workflow.r_object_id=dmi_workitem.r_workflow_id 
and dm_workflow.process_id=dm_process.r_object_id 
and task_name like ‘%Custom Task Name%’ 
and ANY dmi_package.r_component_id = cms_custom_folder.r_object_id
order by name;

Deleting workflow with no package:

find all the workflow with no packages….
select distinct(r_workflow_id), r_component_id from dmi_package where any r_component_id like ‘0b027%’ and any r_component_id not in( select r_object_id from cms_custom_folder  )

and then abort+destroy all the workflows…
abort,c,4d027*****
destroy,c,4d027****


select ‘abort,c,’+ r_workflow_id from dmi_package where any r_component_id like ‘0b027%’ and any r_component_id not in ( select r_object_id from cms_custom_folder  )
select ‘destroy,c,’+ r_workflow_id from dmi_package where any r_component_id like ‘0b027%’ and any r_component_id not in ( select r_object_id from cms_custom_folder  )

 

Inbox Item:

select name, stamp, item_id, item_type, event, task_name, router_id, date_sent from dmi_queue_item 
where name = ‘DMS User1’ and delete_flag = ‘0’  and task_name not in (‘event’)  and task_name like ‘%custom task%’ and date_sent >= date(’01/01/2020′) and date_sent <= date(’04/01/2020′) 
order by task_name

Leave a Reply

Your email address will not be published. Required fields are marked *