Alfresco 7.3 - Alfresco Embedded Activiti Engine

cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco 7.3 - Alfresco Embedded Activiti Engine

angelborroy
Alfresco Employee
3 0 4,541

Alfresco provides different BPM engines:

  • Alfresco Embedded Activiti Engine for ACS, that is integrated with the Alfresco Repository service. There is UI support using Share web application, but ADF applications (like ACA and ADW) are not supporting this engine. It's available for both Community and Enterprise versions of ACS.
  • Alfresco Process Services (APS) is an additional product that provides an AngularJS UI working with an independent Activiti Engine. It may be integrated with ACS to read, modify or create documents in the Repository. This product is Enteprise and it requires licensing.
  • Alfresco Process Automation (APA) is a Cloud Native BPM engine that is only available via PaaS and requires subscription.

 

Alfresco Embedded Activiti Engine

Screenshot 2023-03-31 at 11.05.02.png

Workflow definitions, using BPMN standard notation, are deployed to the Alfresco Repository using different approaches:

  • Create a Repository Alfresco addon (JAR or AMP packaging) that includes the process definition and additional resources. Building this kind of addons is described by Jeff Potts on his Alfresco Developer Series Tutorial. Once deployed, the new workflow definition is registered in the workflowBootstrap Spring Bean.
  • Upload a XML file with the BPMN definition to Repository > Data Dictionary > Workflow Definitions folder in the Alfresco Repository. Once the property Workflow Deployed of this file is checked, the workflow definition is available in the Repository.

Processes or Workflows are created from workflow definitions by starting a new instance. BPMN activities and variables definitions are taken by users to populate the values and to attach Repository documents (items).

 

ACS Workflow Development APIs

There is a number of APIs that can be used within the Repository to manage workflow operations.

Java API

The following sample list workflow definitions using workflowBootstrap Spring Bean from JavaScript Console.

var context =
Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext(); var workflowBootstrap =
context.getBean('workflowBootstrap', Packages.org.alfresco.repo.workflow.WorkflowDeployer); logger.log(workflowBootstrap.getWorkflowDefinitions());

Workflow Admin Console

# Show workflow definitions
show definitions all
# Show running processes
show workflows all
# Show running processes for workflow definition activitiAdhoc
show workflows 'activiti$activitiAdhoc v1'
# Show running paths for process activiti$101
show paths activiti$101
# Get information (values, items, users) from process activiti$101
desc workflow activiti$101
# Show running tasks for process activiti$101
show tasks activiti$101
# Get information (values, items, users) from task activiti$147
desc task activiti$147
# Get all running tasks (COMPLETED state is not working, use REST API v1 for that)
query task taskState=IN_PROGRESS

REST API v0

/api/workflow-definitions
/api/workflow-definitions/{workflowDefinitionId}
/api/workflow-definitions/{workflow_definition_id}/workflow-instances

/api/workflow-instances
/api/workflow-instances/{workflow_instance_id}
/api/workflow-instances/{workflow_instance_id}/diagram
/api/workflow-instances/{workflow_instance_id}/task-instances

/api/workflow/task/end/{taskId}
/api/workflow/task/end/{taskId}/{transitionId}

You can even get the diagram representation of a running process, that is not available in any other API.

REST API v1

http://localhost:8080/alfresco/api/-default-/public/workflow/versions/1/deployments

http://localhost:8080/alfresco/api/-default-/public/workflow/versions/1/process-definitions
http://localhost:8080/alfresco/api/-default-/public/workflow/versions/1/process-definitions/activitiAdhoc:1:4/image

http://localhost:8080/alfresco/api/-default-/public/workflow/versions/1/processes
http://localhost:8080/alfresco/api/-default-/public/workflow/versions/1/processes/460/variables
http://localhost:8080/alfresco/api/-default-/public/workflow/versions/1/processes/460/items
http://localhost:8080/alfresco/api/-default-/public/workflow/versions/1/processes/460/tasks
http://localhost:8080/alfresco/api/-default-/public/workflow/versions/1/tasks/506/candidates

http://localhost:8080/alfresco/api/-default-/public/workflow/versions/1/processes?where=(status=completed)

This is the only API to get workflow definition diagram (using the "image" endpoint) and to get the processes that has been completed (using the where=(status=completed) filter).

 

Video recording

Additional details are available in the following video recording:

About the Author
Angel Borroy is Hyland Developer Evangelist. Over the last 15 years, he has been working as a software architect on Java, BPM, document management and electronic signatures. He has been working with Alfresco during the last years to customize several implementations in large organizations and to provide add-ons to the Community based on Record Management and Electronic Signature. He writes (sometimes) on his personal blog http://angelborroy.wordpress.com. He is (proud) member of the Order of the Bee.