1.9.0 • Published 6 years ago

ng2-activiti-processlist v1.9.0

Weekly downloads
12
License
Apache-2.0
Repository
github
Last release
6 years ago

Activiti Process List Component

Displays lists of process instances both active and completed, using any defined process filter, and renders details for any chosen instance.

Prerequisites

Before you start using this development framework, make sure you have installed all required software and done all the necessary configuration prerequisites.

If you plan using this component with projects generated by Angular CLI, please refer to the following article: Using ADF with Angular CLI

Install

npm install ng2-activiti-processlist

Activiti Process Instance List

This component renders a list containing all the process instances matched by the parameters specified.

app.component.html

<activiti-process-instance-list 
    [appId]="'1'" 
    [state]="'open'">
</activiti-process-instance-list>

Properties

NameDescription
appIdThe id of the app.
processDefinitionKeyThe processDefinitionKey of the process.
stateDefine state of the processes. Possible values are running, completed and all
sortDefine sort of the processes. Possible values are created-desc, created-asc, ended-desc, ended-asc
schemaColumnList of columns to display in the process instances datatable

Example:

[
    {type: 'text', key: 'id', title: 'Id', sortable: true},
    {type: 'text', key: 'name', title: 'Name', cssClass: 'full-width name-column', sortable: true},
    {type: 'text', key: 'started', title: 'Started', sortable: true},
    {type: 'text', key: 'startedBy.email', title: 'Started By', sortable: true}
]

Events

  • rowClick: Emitted when a row in the process list is clicked
  • onSuccess: Emitted when the list of process instances has been loaded successfully from the server
  • onError: Emitted when an error is encountered loading the list of process instances from the server

Process Filters Component

Process filters are a collection of criteria used to filter process instances, which may be customized by users. This component displays a list of available filters and allows the user to select any given filter as the active filter.

The most common usage is in driving a process instance list in order to allow the user to choose which process instances are displayed in the list.

<activiti-process-instance-filters
    appId="1001">
</activiti-process-instance-filters>

Properties

NameTypeDescription
filterParamFilterParamsModelThe params to filter the task filter. If there is no match the default one (first filter of the list) is selected
appIdstringDisplay filters available to the current user for the application with the specified ID.
appNamestringDisplay filters available to the current user for the application with the specified name.
hasIconbooleanToggle to show or not the filter's icon.

If both appId and appName are specified then appName will take precedence and appId will be ignored.

Events

NameDescription
onSuccessRaised when the list of filters hase been successfully loaded from the server
onErrorRaised when an error occurs
filterClickRaised when the user selects a filter from the list

How filter the activiti process filters

<activiti-process-instance-filters 
   [filterParam]="{index: 0}">
</activiti-filters>

You can use inside the filterParam one of the following property.

FilterParamsModel

{
    "id": "number",
    "name": "string",
    "index": "number"
}
NameTypeDescription
idstringThe id of the task filter.
namestringThe name of the task filter, lowercase is checked.
indexnumberZero-based position of the filter in the array.

How to create an accordion menu with the processes filter

You can create an accordion menu using the AccordionComponent that wrap the activiti task filter. The AccordionComponent is exposed by the alfresco-core.

<adf-accordion>
    <adf-accordion-group 
        [heading]="'Processes'" 
        [isSelected]="true" 
        [headingIcon]="'assessment'">
        <activiti-process-instance-filters
            [appId]="appId"
            (filterClick)="onProcessFilterClick($event)"
            (onSuccess)="onSuccessProcessFilterList($event)">
        </activiti-process-instance-filters>
    </adf-accordion-group>
</adf-accordion>

how-create-accordion-menu

Start Process component

Displays a button which in turn displays a dialog when clicked, allowing the user to specify some basic details needed to start a new process instance.

<activiti-start-process 
    appId="YOUR_APP_ID" >
</activiti-start-process>

Properties

NameDescription
appId(required): Limit the list of processes which can be started to those contained in the specified app
variablesVariables in input to the process RestVariable**](https://github.com/Alfresco/alfresco-js-api/tree/master/src/alfresco-activiti-rest-api/docs/RestVariable.md)

Events

NameDescription
startRaised when the process start
errorRaised when the start process fail

Process Details component

This component displays detailed information on a specified process instance

<activiti-process-instance-details 
    processInstanceId="YOUR_PROCESS_INSTANCE_ID">
</activiti-process-instance-details>

Properties

NameTypeDescription
processInstanceIdstring(required): The numeric ID of the process instance to display

Events

NameDescription
processCancelledEmitterRaised when the current process is cancelled by the user from within the component
taskFormCompletedEmitterRaised when the form associated with an active task is completed from within the component
showProcessDiagramRaised when the show diagram button is clicked

Process Instance Details Header component

This is a sub-component of the process details component, which renders some general information about the selected process.

<activiti-process-instance-header   
    processInstance="localProcessDetails">
</activiti-process-instance-details>

Properties

NameTypeDescription
processInstancestring(required): Full details of the process instance to display information about
showDiagrambooleanIf the value is true the button show diagram is shown

Events

NameDescription
showProcessDiagramRaised when the show diagram button is clicked

Process Instance Tasks component

Lists both the active and completed tasks associated with a particular process instance

<activiti-process-instance-tasks 
    processInstanceId="YOUR_PROCESS_INSTANCE_ID" 
    showRefreshButton="true">
</activiti-process-instance-tasks>

Properties

NameTypeDescription
processInstanceIdstring(required): The ID of the process instance to display tasks for
showRefreshButtonboolean(default: true): Whether to show a refresh button next to the list of tasks to allow this to be updated from the server

Events

NameDescription
taskFormCompletedEmitterRaised when the form associated with an active task is completed from within the component

Process Instance Comments component

Displays comments associated with a particular process instances and allows the user to add new comments

<activiti-process-instance-comments 
    processInstanceId="YOUR_PROCESS_INSTANCE_ID">
</activiti-process-instance-comments>

Properties

NameTypeDescription
processInstanceIdstring(required): The numeric ID of the process instance to display comments for

Process Attachment List component

This component displays attached documents on a specified process instance

<adf-process-attachment-list 
    [processInstanceId]="YOUR_PROCESS_INSTANCE_ID"
    (attachmentClick="YOUR_ATTACHMENT_CLICK_EMITTER_HANDLER">
</adf-process-attachment-list>

process-attachment-list-sample

Properties

NameTypeDescription
processInstanceIdstring(required): The ID of the process instance to display

Events

NameDescription
attachmentClickRaised when the attachment double clicked or selected view option from context menu by the user from within the component and return a Blob obj of the object clicker
successRaised when the attachment list fetch all the attach and return a list of attachments
errorRaised when the attachment list is not able to fetch the attachments for example network error

Create Process Attachment component

This component displays Upload Component(Drag and Click) to upload the attachment to a specified process instance

<activiti-create-process-attachment 
    [processInstanceId]="YOUR_PROCESS_INSTANCE_ID"
    (error)="YOUR_CREATE_ATTACHMENT_ERROR_HANDLER"
    (success)="YOUR_CREATE_ATTACHMENT_SUCCESS_HANDLER">
</activiti-create-process-attachment>

process-create-attachment

Properties

NameTypeDescription
processInstanceIdstring(required): The ID of the process instance to display

Events

NameDescription
errorRaised when the error occured while creating/uploading the attachment by the user from within the component
successRaised when the attachement created/uploaded successfully from within the component

Build from sources

You can build component from sources with the following commands:

npm install
npm run build

The build task rebuilds all the code, runs tslint, license checks and other quality check tools before performing unit testing.

NPM scripts

CommandDescription
npm run buildBuild component
npm run testRun unit tests in the console
npm run test-browserRun unit tests in the browser
npm run coverageRun unit tests and display code coverage report

Demo

Please check the demo folder for a demo project

cd demo
npm install
npm start

License

Apache Version 2.0

1.10.0-beta6

7 years ago

1.10.0-beta5

7 years ago

1.10.0-beta3

7 years ago

1.10.0-beta1

7 years ago

1.9.0

7 years ago

1.9.0-beta8

7 years ago

1.9.0-beta7

7 years ago

1.9.0-beta6

7 years ago

1.9.0-beta5

7 years ago

1.9.0-beta4

7 years ago

1.9.0-beta3

7 years ago

1.9.0-beta1

7 years ago

1.8.0

7 years ago

1.8.0-beta7

7 years ago

1.8.0-beta6

7 years ago

1.8.0-beta5

7 years ago

1.8.0-beta4

7 years ago

1.8.0-beta1

7 years ago

1.7.0

7 years ago

1.7.0-beta5

7 years ago

1.7.0-beta4

7 years ago

1.7.0-beta3

7 years ago

1.7.0-beta2

7 years ago

1.7.0-beta1

7 years ago

1.6.1

7 years ago

1.6.0

7 years ago

1.6.0-beta14

7 years ago

1.6.0-alpha7

7 years ago

1.6.0-alpha6

7 years ago

1.6.0-alpha5

7 years ago

1.6.0-alpha3

7 years ago

1.6.0-beta13

7 years ago

1.6.0-beta11

7 years ago

1.6.0-beta10

7 years ago

1.6.0-beta9

7 years ago

1.6.0-beta8

7 years ago

1.6.0-beta7

7 years ago

1.6.0-beta6

7 years ago

1.6.0-beta5

7 years ago

1.6.0-beta4

7 years ago

1.6.0-beta3

7 years ago

1.6.0-beta1

7 years ago

1.5.0

7 years ago

1.4.0

7 years ago

1.3.0

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago

0.5.0

7 years ago

0.4.0

7 years ago

0.3.3

8 years ago

0.3.2

8 years ago

0.3.0

8 years ago