Overview

Activiti is a light-weight workflow and Business Process Management (BPM) Platform that uses BPMN standard for defining workflows. It provides a fast and reliable workflow engine for Java. It is open-source and distributed under an Apache license. Each of the Batch Class, Module and Plugin is defined as a BPMN.

Specifications

  • License : Apache License 2.0
  • Version : 5.16.1
  • Process Definition Language : BPMN2.0

Activiti Tables

Activiti tables cab be logically classified as:

  • History Tables (ACT_HI_*): These are the tables that contain historic data, such as past process instances, variables, tasks, etc. Table act_hi_procinstis used for reporting purpose.
    • act_hi_actinst
    • act_hi_attachment
    • act_hi_comment
    • act_hi_detail
    • act_hi_identitylink
    • act_hi_procinst
    • act_hi_taskinst
    • act_hi_varinst
  • Runtime Tables (ACT_RU_*): These are the runtime tables, that contain the runtime data of process instances, user tasks, variables, jobs, etc. Activiti only stores the runtime data during process instance execution, and removes the records when a process instance ends. This keeps the runtime tables small and fast.
    • act_ru_event_subscr
    • act_ru_execution
    • act_ru_identitylink
    • act_ru_job
    • act_ru_task
    • act_ru_variable
  • Identity Tables (ACT_ID_*): These tables contain identity information, such as users, groups, etc.
    • act_id_group
    • act_id_info
    • act_id_membership
    • act_id_user
  • General Tables (ACT_GE_*) :
    • act_ge_bytearray
    • act_ge_property
  • Repository Tables (ACT_RE_*): Tables with this prefix contain static information such as process definitions and process resources (images, rules, etc.).
    • act_re_deployment
    • act_re_model
    • act_re_procdef

BPMN: Business Process Model and Notation

The Business Process Modelling Notation (BPMN) is a standard for representing business processes. Basically, the BPMN specification defines how a task must behave, which constructs can be connected to each other, in a way that cannot be misinterpreted. Ephesoft uses BPMN2.0 standard to represent a workflow. A BPMN file is simply an xml file, comparable to a JPDL file in jBPM.

Each of the following is represented as a BPMN file:

  • Batch Class: Each of the batch class is defined as a BPMN and each of the contained module is denoted by a CallActivity.
  • Module: Each of the module BPMN contains a set of CallActivity elements, each one representing a plugin call.
  • Plugin: Each pre-defined plugin is defined as a BPMN which are deployed when the workflow.deploy property is set to true.
  • Workflow Status Running: Marks the beginning of the workflow for the batch class.
  • Workflow Status Finished: Marks the end of the workflow for a batch class, this BPMN performs the clean-up and changes the status of the Batch instance to FINISHED.

BPMN Constructs

The various BPMN constructs used are:

  • Process: A process element denotes a workflow. All batch classes, modules and plugins are defined as a process. A process is the root element for a workflow.
  • Start Event: The start event denotes the beginning of a process.
  • End Event: The end event denotes the end of a process.
  • CallActivity: This construct signifies a call to a sub-process. Each CallActivity element makes a call to another process that matches the process key specified.
  • Sequence Flow: This construct is used to denote a transition between nodes in the workflow.
  • Exclusive Gateway: A gateway is used to make a decision on which exclusive workflow path will be chosen based on the evaluation of a given condition.
  • Service Task: Used to invoke a particular method of a class. Each of the plugin service method is invoked as a Service Task.
  • Receive Task: This construct is used to denote a wait state, a state that requires a user intervention and triggers the workflow. The wait states for a batch instance i.e. Review and Validation is represented using a receive task.
  • Execution Listener: Used to invoke a piece of code on events such as start and end of a process. Execution listeners are used to update the executed modules and creating backup batch xml for modules.

Configuration

dcma-workflows.properties

Following is the list of configurable properties:

  • Pick Up Service Configuration

Pick up service is a single server executed service with a failover mechanism. Pick up service runs as a scheduler service which keeps a watch on BATCH_INSTANCE table. Every time a batch is ready to be picked and its status is NEW/READY, this service takes a lock on that batch, sets its status as RUNNING and triggers the workflow for that batch. Pick up priority for READY batches is greater than for NEW status batches.

Configurable property Type of value Value options Description
dcma.pickup.cronjob.expression String Any valid cron expression.Default Value:0 0/1 * ? * *(For this value, pick up service will be invoked every one minute.

)

This parameter specifies the schedule for which Pick up service will run. This is specified as a cron job expression.
server.instance.pick.capacity Integer Any Integer Value.Default value: 3 This parameter specifies the maximum number of batches that a pickup service will pick in 1 round of execution, such that ‘batches picked up <=( max process capacity – RUNNING state batches)’
  • Batch Execution Configuration

Pick up service is a single server executed service with a failover mechanism. Pick up service runs as a scheduler service which keeps a watch on BATCH_INSTANCE table. Every time a batch is ready to be picked and its status is NEW/READY, this service takes a lock on that batch, sets its status as RUNNING and triggers the workflow for that batch. Pick up priority for READY batches is greater than for NEW status batches.

Configurable property Type of value Value options Description
server.instance.max.process.capacity Integer Any Integer Value less than CPU count of server.Default value: 5 This parameter specifies the maximum number of batch instances that a server instance can process at a given instance of time.
  • Resume Service Configuration

Resume service, like pick up service, also runs as a scheduler service. This service also keeps an eye on BATCH_INSTANCE table. It picks the batches that are locked by another server instance which is not active now or has gone down (as detected by HeartBeat service). It takes a lock on those batches and resumes the workflow for them.

Configurable property Type of value Value options Description
dcma.resume.cronjob.expression String Any valid cron expression.Default Value:0 0/1 * ? * *(For this value, resume service will be invoked every one minute.

)

This parameter specifies the schedule for which resume service will run. This is specified as a cron job expression.
server.instance.resume.capacity Integer Any Integer Value.Default value: 4 This parameter specifies the max number of batches that a resume service can pick at one go (i.e. in one iteration).
  • Deployment Service

The deployment service is used for deployment of workflows such that batch instances can be executed using the defined batch class configuration. Initially, when the workflow.deploy property is set to true, workflows for default plugins, modules and batch classes are deployed by this service. The workflows (BPMN’s) created for the batch classes configured by users are deployed when the user clicks the Deploy button on Batch Class Management screen.

Configurable property Type of value Value options Description
workflow.deploy String
  • True
  • False

Default Value=true

This parameter re-deploys all the available workflows in the system. Should be set only once during the new installations or upgrades.
newWorkflows.basePath String Valid path of directory.Default Value: {Application}\\SharedFolders/workflows This parameter specifies the path where all BPMN(s) are placed when a new workflow or plugin is deployed.
  • Batch Instance Priority

The property is used to assign a server to work on a fixed set of batches that fall into this priority range. If a batch has a priority that is not included in server’s priority range set, it won’t be processed by this server.

In multi-server environment, one server may either have its priority range set equal to other server’s set or it must be an exclusive set i.e. Intersection of two server priority range must be null.

In case a server while starting fails to satisfy this constraint with respect to an active server, this server would fail to start with an error message in logs.

Configurable property Type of value Value options Description
server.instance.batch.priority.range A String depicting Set of values ranging from 1 to 100. Default Value: 1-100 The priority set syntax can be either a range say from 1-10 or simple set 1,2,3,4,5,6,7,8,9,10Both meaning that batches from priority 1 to 10 (but of no other priority) are to be executed by this server.Different combinations are possible; For example: 1-10|15-25|27,28|100 meaning priority 1 to 10, priority 15 to 25 and priority 27, 28 and100 are to be executed by this server.Note: When a user write 15-25, 15 and 25 are inclusive values. Also no white space allowed in the format.
  • Clean Error Job Service Configuration

Although workflow engine’s runtime tables and in memory data are removed immediately after a batch errors out, if in case some data still persists and needs to be clean, this expression specifies the time after which the clean service for workflow engine’s runtime tables and in memory data are cleaned for error batches.

Configurable property Type of value Value options Description
dcma.clean.error.job.cronjob.expression Cronjob Expression NA Expression governing duration after which the service runs to clean old/unused data.
  • Clean resources wait time Configuration

Whenever a batch is deleted by user or it goes to error, we delete its current executing job. If the job has acquired some resources, this property tells the maximum time in milliseconds to wait for this job to free its resources before deleting it.

Configurable property Type of value Value options Description
batch.clean.resources.wait.time Integer Time in Milliseconds.Default Value= 300000 Maximum time to wait for an executing command/job to release the resources allocated to it, before deleting it.
  • Other Configurations
Configurable property Type of value Value options Description
workflow.error.subject String Valid e-mail subject.Default Value: Error in workflow execution!! This parameter specifies the subject for mail to be sent when some error occurs during batch processing.
wb.hostURL String Valid URL.Default value: http://localhost:8080/dcma/rest This parameter specifies the host URL for sending the batch instance from one Ephesoft instance to another.

 

 

<Back| 4.0.0.0 Release Documentation

Was this article helpful to you?

Engineering

Comments are closed.