cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti HistoryService

mangar
Star Contributor
Star Contributor
How do I access the Activiti HistoryService from an Alfresco WebService?  I don't see it in the list of services in the Serviceregistry.  Do I need to inject it somehow?
2 REPLIES 2

afaust
Legendary Innovator
Legendary Innovator
Hello,

you should not need to use the Activiti HistoryService directly. Simply use the Alfresco WorkflowService to get data from completed tasks. The queryTasks operation can be used to retrieve historic tasks as well without going to the low-level HistoryService, and is available via the ServiceRegistry.

In case you <b>really, really</b> need the Activiti HistoryService directly, you can use the generic getService() operation in the service registry and use a QName with localName = "activitiHistoryService" to retrieve it. I'd advise against using this from an Alfresco "WebService" (in a workflow?) as I know there can be various issues with side-effects due to Activiti sort-of having its own SQL / txn context, which - as I have experienced - may clash with the Alfresco context if used other than how Alfresco integrated the Activiti services into the WorkflowService.

Regards
Axel

mangar
Star Contributor
Star Contributor
Thank you.  I injected the activitiHistoryService straight into my WebService in my bean definition.  I needed the history service to get access to some process variables for reporting.
These are variables from completed workflows.  I could not find any way to get at them through the Alfresco WorkflowService. 

If you know a better way, please tell me.