07 Jul

Workflow analytics on Alfresco 4.2.e and AAAR v3.1

analytics-iconThis post describes an issue that could happens on the workflow analytics, using Alfresco Community 4.2.e and AAAR v3.1. The post is written in collaboration with Pablo Vásquez from Smart Solutions & Services (Chile). From our prospective this is the result of a collaboration and a practical example on how the community can help in practice.

The problem

If you use Alfresco Community 4.2.e and AAAR v3.1 to develop your own dashboards and analytics, you could face the problem described below. During the data extraction (executing the AAAR_Extract script) the workflows definition will succeed and the extraction of the workflows instances, could fail with the error below in the console:

HTTP – ERROR (version 5.3.0.0-213, build 1 from 2015-02-02_12-17-08 by buildguy) : I was unable to save the HTTP result to file because of a I/O error: Server returned HTTP response code: 500 for URL:http://localhost:8080/alfresco/service/api/workflow-instances?state=completed&completedAfter=2000-01-01T00:00:00.000+00:00

The solution

After some tests you can check that adding an exclusion, the API doesn’t shot the error 500. In particular, the following URL responds with the workflows instances completed, excluding the workflow instances invitation for sites.

http://localhost:8080/alfresco/service/api/workflow-instances?exclude=activiti$activitiInvitationNominated&state=COMPLETED&completedAfter=2000-01-01T00:00:00.000+00:00

During the tests you can include only “jbpm$wcmwf:*” [even if you don’t use jbpm] and the URL works (don’t understand why).

Developing the bugfix

The solution for the correct extraction? Identify the AAAR_Kettle_v5.sql file (for Alfresco 4.2) in the installation folder for PostgreSql (here you can find the path in the public project). Edit the line 12,659 of the file:

url || url_workflow_instances_suffix || ”?state=completed&completedAfter=” || (select coalesce(max(end_date_id),”2000-01-01”::date) from dm_dim_workflow_instances where alfresco_id = dm_dim_alfresco.id) || ”T00:00:00.000+00:00” as workflow_instances_completed_url,

to:

url || url_workflow_instances_suffix || ”?exclude=activiti$activitiInvitationModerated,activiti$activitiInvitationNominated&state=completed&completedAfter=” || (select coalesce(max(end_date_id),”2000-01-01”::date) from dm_dim_workflow_instances where alfresco_id = dm_dim_alfresco.id) || ”T00:00:00.000+00:00” as workflow_instances_completed_url,

Now you can proceed to reinstall the AAAR (following the instructions described here) and the extraction of workflow informations will work. 🙂

As you can see, apparently the URL for Alfresco 4.2 requires the exclusion.

PabloPablo Vásquez Moreno

Smart Solutions & Services (S3Chile)

 .

.

Leave a Reply

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

Time limit is exhausted. Please reload CAPTCHA.