1.9.0 • Published 6 years ago

ng2-activiti-tasklist v1.9.0

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

APS Task List Component

Displays lists of process instances both active and completed, using any defined process filter, and render details of 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-tasklist

Activiti Task List

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

<activiti-tasklist 
    [appId]="'1'" 
    [state]="'open'" 
    [assignment]="'assignee'">
</activiti-tasklist>

You can also use HTML-based schema declaration like shown below:

<activiti-tasklist ...>
    <data-columns>
        <data-column key="name" title="NAME" class="full-width name-column"></data-column>
        <data-column key="created" title="Created" class="hidden"></data-column>
    </data-columns>
</activiti-tasklist>

DataColumn Properties

Here's the list of available properties you can define for a Data Column definition.

NameTypeDefaultDescription
keystringData source key, can be either column/property key like title or property path like createdBy.name
typestring (text|image|date)textValue type
formatstringValue format (if supported by components), for example format of the date
sortablebooleantrueToggles ability to sort by this column, for example by clicking the column header
titlestringDisplay title of the column, typically used for column headers
templateTemplateRefCustom column template
sr-titlestringScreen reader title, used for accessibility purposes
classstringAdditional CSS class to be applied to column (header and cells)

Events

NameDescription
onSuccessRaised when the task list is loaded
rowClickRaised when the task in the list is clicked

Properties

NameTypeDefaultDescription
appIdstringThe id of the app.
processDefinitionKeystringThe processDefinitionKey of the process.
assignmentstringThe assignment of the process. Possible values are: assignee : where the current user is the assignee candidate: where the current user is a task candidate group_x: where the task is assigned to a group where the current user is a member of. no value: where the current user is involved
statestringDefine state of the processes. Possible values are: completed, active
hasIconbooleantrueToggle the icon on the left .
landingTaskIdstringDefine which task id should be selected after the reloading. If the task id doesn't exist or nothing is passed it will select the first task
sortstringDefine the sort of the processes. Possible values are : created-desc, created-asc, due-desc, due-asc
dataDataTableAdapterJSON object that represent the number and the type of the columns that you want show

Example:

[
 {"type": "text", "key": "id", "title": "Id"},
 {"type": "text", "key": "name", "title": "Name", "cssClass": "full-width name-column", "sortable": true},
 {"type": "text", "key": "formKey", "title": "Form Key", "sortable": true},
 {"type": "text", "key": "created", "title": "Created", "sortable": true}
]

Activiti Task Details

The component shows the details of the task id passed in input

<activiti-task-details 
    [taskId]="taskId">
</activiti-task-details>

Properties

NameTypeDefaultDescription
taskIdstring(required) The id of the task details that we are asking for.
showNextTaskbooleantrueAutomatically render the next one, when the task is completed.
showFormTitlebooleantrueToggle rendering of the form title.
readOnlyFormbooleanfalseToggle readonly state of the form. Enforces all form widgets render readonly if enabled.
showFormRefreshButtonbooleantrueToggle rendering of the Refresh button.
showFormSaveButtonbooleantrueToggle rendering of the Save outcome button.
showFormCompleteButtonbooleantrueToggle rendering of the Form Complete outcome button
peopleIconImageUrlstringDefine a custom people icon image
showHeaderbooleantrueToggle task details Header component
showHeaderContentbooleantrueToggle collapsed/expanded state of the Header component
showInvolvePeoplebooleantrueToggle Involve People feature for Header component
showCommentsbooleantrueToggle Comments feature for Header component
showChecklistbooleantrueToggle Checklist feature for Header component

Events

NameDescription
formLoadedRaised when form is loaded or reloaded.
formSavedRaised when form is submitted with Save or custom outcomes.
formCompletedRaised when form is submitted with Complete outcome.
taskCreatedRaised when a checklist task is created.
executeOutcomeRaised when any outcome is executed, default behaviour can be prevented via event.preventDefault()
onErrorRaised at any error

Custom 'empty Activiti Task Details' template

By default the Activiti Task Details provides the following message for the empty task details:

No Tasks

This can be changed by adding the following custom html template:

<activiti-task-details [taskId]="taskId">
    <no-task-details-template>
        <template>
             <h1>Sorry, no tasks here</h1>
             <img src="example.jpg">
        </template>
    </no-task-details-template>
</activiti-task-details>    

Note that can put any HTML content as part of the template, includuing other Angualr components.

Activiti Apps Component

The component shows all the available apps.

<activiti-apps 
    [layoutType]="'GRID'">
</activiti-apps>

Properties

NameTypeDescription
layoutTypestring(required) Define the layout of the apps. There are two possible values: GRID or LIST.
filtersAppIdObjectProvide a way to filter the apps to show.

Events

NameDescription
appClickRaised when an app entry is clicked

How filter the activiti apps

If you want show some specific apps you can specify them through the filtersAppId parameters

<activiti-apps 
    [filtersAppId]="'[
        {defaultAppId: 'tasks'}, 
        {deploymentId: '15037'}, 
        {name : 'my app name'}]'">
</activiti-apps>

In this specific case only the Tasks app, the app with deploymentId 15037 and the app with "my app name" will be showed how-filter-apps

You can use inside the filter one of the following property

{ 
    "defaultAppId": "string", 
    "deploymentId": "string", 
    "name": "string", 
    "id": "number", 
    "modelId": "number",
    "tenantId": "number"
}

Activiti Filter

The component shows all the available filters.

<activiti-filters></activiti-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
filterClickRaised when the filter in the list is clicked
onSuccessRaised when the list is loaded
onErrorRaised if there is an error during the loading

How filter the activiti task filters

<activiti-filters 
   [filterParam]="{name:'My tasks'}">
</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
indexstringThe zero-based position of the filter in the array.

How to create an accordion menu with the task 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]="'Tasks'" [isSelected]="true" [headingIcon]="'assignment'">
        <activiti-filters
            [appId]="appId"
            [hasIcon]="false"
            (filterClick)="onTaskFilterClick($event)"
            (onSuccess)="onSuccessTaskFilterList($event)"
            #activitifilter>
        </activiti-filters>
    </adf-accordion-group>
</adf-accordion>

how-create-accordion-menu

Activiti Checklist Component

The component shows the checklist task functionality.

<activiti-checklist 
    [readOnly]="false" 
    [taskId]="taskId" 
    [assignee]="taskAssignee.id" 
</activiti-checklist>

Properties

NameTypeDescription
taskIdstring(required) The id of the parent task which sub tasks are attached on.
readOnlyFormbooleanToggle readonly state of the form. Enforces all form widgets render readonly if enabled.
assigneestring(required) The assignee id where the subtasks are assigned to.

Task Attachment List Component

This component displays attached documents on a specified task

<adf-task-attachment-list 
    [taskId]="YOUR_TASK_ID" 
    (attachmentClick)="YOUR_HANDLER">
</adf-task-attachment-list>

task-attachment-list-sample

Properties

NameTypeDescription
taskIdstring(required): The ID of the task 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 Task Attachment Component

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

<adf-create-task-attachment 
    [taskId]="YOUR_TASK_ID" 
    (error)="YOUR_CREATE_ATTACHMENT_ERROR_HANDLER"
    (success)="YOUR_CREATE_ATTACHMENT_SUCCESS_HANDLER">
</adf-create-task-attachment>

task-create-attachment

Properties

NameTypeDescription
taskIdstring(required): The numeric ID of the task 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

Activiti Task Header

The component shows all the information related to a task. The purpose of the component is populate the local variable called properties (array of CardViewModel), with all the information that we want display.

<activiti-task-header
    [taskDetails]="taskDetails">
</activiti-task-header>

Properties

NameTypeDefaultDescription
taskDetailsTaskDetailsModel(required) The task details related to the task.
formNamestringThe name of the form.

adf-task-header

Events

NameDescription
claimRaised when the task is claimed.

TaskDetailsModel

{ 
    "id": "string", 
    "assignee": "User", 
    "dueDate": "data", 
    "endDate": "string", 
    "description": "string"
}

Task People Component

This component displays involved users to a specified task

<activiti-people 
    [people]="YOUR_INVOLVED_PEOPLE_LIST" 
    [taskId]="YOUR_TASK_ID"
    [readOnly]="YOUR_READ_ONLY_FLAG">
</activiti-people>

activiti-people

Properties

NameTypeDescription
peopleUser[]The array of User object to display
taskIdstringThe numeric ID of the task
readOnlybooleanThe boolean flag

Events

No Events

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-beta4

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-alpha2

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-beta2

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