cancel
Showing results for 
Search instead for 
Did you mean: 

How do you query a document and related workflow

jarrett
Champ in-the-making
Champ in-the-making
Hello,

I am trying to query the Alfresco database to link a piece of content to its workflow and I cannot seem to get this. I am able to query all the information about the document and all the information about the workflow but I cannot link the two together. Any example queries or information would be greatly appreciated.
2 REPLIES 2

dgenard
Champ on-the-rise
Champ on-the-rise
In Java, you can use WorkflowService.
See method
public List<WorkflowInstance> getWorkflowsForContent(NodeRef packageItem, boolean active)
which gives list of workflows related to a document or space.

Denis

jarrett
Champ in-the-making
Champ in-the-making
Thank you Denis, your response is a huge help.

We have also figured out how to query the MySQL DB directly for reporting purposes. This query also returns the information too. 


select t.ID_ AS task_id,t.CREATE_ AS created,t.END_ AS ended,t.NAME_ AS task_step,t.DESCRIPTION_ AS task_description,t.ACTORID_ AS actor,t.PROCINST_ AS task_proc_instance_id,c.child_node_name AS document_name,c.child_node_id AS doc_id from ((JBPM_TASKINSTANCE t join alf_node_properties p on(((p.string_value = concat(_utf8'jbpm$',t.PROCINST_)) and (p.qname = _latin1'{http://www.alfresco.org/model/bpm/1.0}workflowInstanceId')))) join alf_child_assoc c on((c.parent_node_id = p.node_id)))