Movatterモバイル変換


[0]ホーム

URL:


The latest Alfresco documentation has moved to the Hyland Documentation Portal. Click here for the latest versions:support.hyland.com.
In: process-automationIn: All docs
Close
Alfresco Process Automation

Develop Process Automation

Use the following to develop and customize Process Automation.

External systems communication

Communication with an external system should use theREST connector or theLambda connector.

Important: The REST service and the AWS Lambda account and function need to be hosted outside of the Alfresco hosted environment.

Both connectors can send and return JSON payloads from a process. The REST connector can also be configured as atrigger for webhooks.

Extend the Digital Workspace

The defaultend user interface provided with Process Automation is theAlfresco Digital Workspace.Starting with Process Automation version 7.12, large parts of the Digital Workspace can be easily customized by editing the provided UI, seecreating a custom user interface. If you’re using a version older than 7.12, use the instructions below to extend your Digital Workspace.

Setup

To start developing Digital Workspace customizations:

  1. Request the source code fromSupport.

  2. Unzip the source code into your development environment and create a.env file in the root folder.

  3. Insert the following contents in the.env file:

     # GENERAL AUTH_TYPE="OAUTH" PROVIDER="ALL" LOG_LEVEL="TRACE" ACA_BRANCH="develop" # ADW + APA API_HOST="https://..." API_CONTENT_HOST="https://..." API_PROCESS_HOST="https://..." OAUTH_HOST="https://..." IDENTITY_HOST="https://..." PLUGIN_PROCESS_SERVICE=true APP_CONFIG_APPS_DEPLOYED="[{"name": "..."}]"
  4. Update the contents of the.env file with the following:

    PropertyDescription
    API_HOSTThe API host for the environment in the formathttps://alfresco.com.
    API_CONTENT_HOSTThe API host for the content services in the formathttps://alfresco.com.
    API_PROCESS_HOSTThe API host for the process services in the formathttps://alfresco.com.
    OAUTH_HOSTThe authentication host in the formathttps://alfresco.com/auth/realms/alfresco.
    IDENTITY_HOSTThe identity service host in the formathttps://alfresco.com/auth/realms/alfresco.
    APP_CONFIG_APPS_DEPLOYEDThe name of the deployed application to extend the Digital Workspace against. The name is set when the application is deployed, for example[{"name": "invoice-approval-application"}].
  5. Run the following command from the root of your local Digital Workspace:npm run start content-en-cloud.

  6. Your local Digital Workspace is now connected to your hosted Process Automation application and can be extended, tested and debugged.

Develop

The Digital Workspace is built using the Application Development Framework. There are a set ofcontent components and a set ofprocess components that can be extended.

Note: Process Automation uses the Process ServicesCloud components.

Upload

Once the extended Digital Workspace has been fully customized and tested it can be deployed.

  1. Remove the.env file from your source code.

  2. Upload your source code to your Alfresco S3 bucket.

    Note: Please contactSupport if you do not have the details of this bucket.

  3. Raise aSupport request with this information:

    • A link to the source code in S3.
    • The name of the application to update.

      Note: This should match what is configured in theapp.config.json for the interface.

    • The environment the application is deployed in.
    • When the application should be updated with the new interface.

Extend task list with custom columns

The Digital Workspace provides a default group of columns for your task list. The columns can be changed and configured in theprocess-services-cloud.extension.json file of theProcess Services Cloud extension library.

Here is an example of a task list with default columns preset:

{  "features": {    "taskList": {        "presets": {            "default": [                columns schema            ]        }    }  }}

Task list with default columns

Add a column in the task list using a task property

To display the task list with new columns, edit theprocess-services-cloud.extension.json file, and insert an entry into thefeatures.taskList.presets.default section.

{  "features": {    "taskList": {        "presets": {            "default": [                { ...Default Columns schema },                {                    "id": "app.task.processDefinitionName",                    "key": "processDefinitionName",                    "type": "text",                    "title": "processDefinitionName",                    "sortable": true                },                {                    "id": "app.task.appName",                    "key": "appName",                    "type": "text",                    "title": "appName",                    "sortable": true                }            ]        }    }  }}

When you restart the application you will see the new columns in the task list.

Task list with new columns

Replace a default preset in the task list

To display a task list with new columns already preset, edit theprocess-services-cloud.extension.json file to include the definition of your own set of columns, and insert an entry into thefeatures.taskList.presets.my-task-presets section.

{  "features": {    "taskList": {        "presets": {            "default": [                { Default Columns schema },            ],            "my-task-presets": [                {                    "id": "app.task.name",                    "key": "name",                    "type": "text",                    "title": "Name",                    "sortable": true                },                {                    "id": "app.task.status",                    "key": "status",                    "type": "text",                    "title": "Status",                    "sortable": true                },                {                    "id": "app.task.processDefinitionName",                    "key": "processDefinitionName",                    "type": "text",                    "title": "processDefinitionName",                    "sortable": true                },                {                    "id": "app.task.appName",                    "key": "appName",                    "type": "text",                    "title": "appName",                    "sortable": true                }            ]        }    }  }}

To activate the new columns edit thetask-list-cloud-ext.component file and change thethis.columns = this.extensions.getTaskListPreset property fromdefault tomy-task-presets.

  this.columns = this.extensions.getTaskListPreset('my-task-presets');

Task list additional columns

Add a column in the Task list using a custom template

To display a task list with a custom column template you first need to create a custom component.For example, to create custom templates for the task name, due date, and priority properties edit theprocess-services-cloud.extension.json file in the following way.

import { ChangeDetectionStrategy, Component, Input, OnInit, ViewEncapsulation } from '@angular/core';import { TaskDetailsCloudModel } from '@alfresco/adf-process-services-cloud';@Component({  selector: 'custom-template-name-column',  template: `    <mat-list>        <mat-list-item>            <div mat-line></div>            <div mat-line [ngStyle]="{ 'padding-top': '5px' }">                <span [ngStyle]="{ 'font-weight': 'bold' }">Assignee :</span>                <span> </span>            </div>        </mat-list-item>    </mat-list>    `,  host: { class: 'adf-datatable-content-cell adf-name-column' },})export class TaskNameComponent implements OnInit {  @Input()  context: any;  displayValue: TaskDetailsCloudModel;  constructor() {}  ngOnInit() {    this.displayValue = this.context?.row?.obj;  }}
import { Component, Input, OnInit } from '@angular/core';import { TaskDetailsCloudModel } from '@alfresco/adf-process-services-cloud';@Component({  selector: 'custom-template-priority-column',  template: `    <mat-form-field>      <mat-label>Change Priority</mat-label>      <mat-select [(ngModel)]="selectedValue" name="priority">        <mat-option *ngFor="let priority of priorities" [value]="priority">                  </mat-option>      </mat-select>    </mat-form-field>    `,  host: { class: 'adf-datatable-content-cell adf-name-column' },})export class TaskPriorityComponent implements OnInit {  @Input()  context: any;  displayValue: TaskDetailsCloudModel;  priorities: string[] = ['None', 'High', 'Low', 'Normal'];  selectedValue: string;  constructor() {}  ngOnInit() {    this.displayValue = this.context?.row?.obj;    this.selectedValue = this.displayValue.priority;  }}
import { Component, Input, OnInit } from '@angular/core';import { ProcessInstanceCloud } from '@alfresco/adf-process-services-cloud';@Component({  selector: 'custom-template-duedate-column',  template: `    <mat-form-field>        <input matInput [matDatepicker]="picker" placeholder="Change due date" />        <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>        <mat-datepicker #picker></mat-datepicker>    </mat-form-field>    `,  host: { class: 'adf-datatable-content-cell adf-name-column' },})export class TaskDueDateComponent implements OnInit {  @Input()  context: any;  displayValue: TaskDetailsCloudModel;  constructor() {}  ngOnInit() {    this.displayValue = this.context?.row?.obj;  }}

Register the custom components in thetask-list.module.ts file. For more on how to register a custom component seeRegistration.

@NgModule({    declarations: [TaskNameComponent, TaskPriorityComponent, TaskDueDateComponent ]})export class TasksListCloudModule {    constructor(extensions: ExtensionService) {        extensions.setComponents({            'app.taskList.columns.name': TaskNameComponent,            'app.taskList.columns.priority': TaskPriorityComponent,            'app.taskList.columns.dueDate': TaskDueDateComponent        });    }}

Once you have registered your components, you need to register your new template component. To do this you need to add your new column to theyour-app.extensions.json file:

{  "features": {    "taskList": {        "presets": {            "default": [                {                  "id": "app.task.name",                  "key": "name",                  "title": "Name",                  "type": "text",                  "template": "app.taskList.columns.name",                  "sortable": true                },                {                  "id": "app.task.dueDate",                  "key": "status",                  "title": "Due Date",                  "type": "text",                  "template": "app.taskList.columns.dueDate",                  "sortable": true                },                {                  "id": "app.task.priority",                  "key": "priority",                  "title": "Priority",                  "type": "text",                  "template": "app.taskList.columns.priority",                  "sortable": true                }            ]        }    }  }}

Restart the application and you will see the custom columns in the task list based on the new custom template.

Task list with custom template

Extend process list with custom columns

The Digital Workspace provides a default group of columns for your process list. The columns can be changed and configured in theprocess-services-cloud.extension.json file of theProcess Services Cloud extension library.

Process list with default columns preset.

{  "features": {    "processList": {        "presets": {            "default": [                columns schema            ]        }    }  }}

Process list with default columns

Add a column in the process list using a process instance property

To display the process list with new columns, edit theprocess-services-cloud.extension.json file, and insert an entry into thefeatures.processList.presets.default section.

{  "features": {    "processList": {        "presets": {            "default": [                { Default Columns schema },                {                    "id": "app.process.processDefinitionId",                    "key": "processDefinitionId",                    "type": "text",                    "title": "ProcessDefinitionId",                    "sortable": true                },                {                    "id": "app.process.appName",                    "key": "appName",                    "type": "text",                    "title": "appName",                    "sortable": true                }            ]        }    }  }}

When you restart the application you will see the new columns in the process list.

Process list with new columns

Replace a default preset in the process list

To display a process list with new columns already preset, edit theprocess-services-cloud.extension.json file to include the definition of your own set of columns, and insert an entry into thefeatures.processList.presets.my-process-presets section.

{  "features": {    "processList": {        "presets": {            "default": [                { Default Columns schema },            ],            "my-process-presets": [                {                    "id": "app.process.id",                    "key": "id",                    "type": "text",                    "title": "Process Id",                    "sortable": true                },                                {                    "id": "app.process.name",                    "key": "name",                    "type": "text",                    "title": "appName",                    "sortable": true                },                {                    "id": "app.process.appName",                    "key": "appName",                    "type": "text",                    "title": "appName",                    "sortable": true                }            ]        }    }  }}

To activate the new columns edit theprocess-list-cloud-ext.component file and change thethis.columns = this.extensions.getProcessListPreset property fromdefault tomy-process-presets.

  this.columns = this.extensions.getProcessListPreset('my-process-presets');

Process list with new columns

Add a column in the process list using a custom template

To display a process list with a custom column template you first need to create a custom component.For example, to create custom templates for the process name, and status properties, edit theprocess-services-cloud.extension.json file in the following way.

import { ChangeDetectionStrategy, Component, Input, OnInit, ViewEncapsulation } from '@angular/core';import { ProcessInstanceCloud } from '@alfresco/adf-process-services-cloud';@Component({  selector: 'custom-template-name-column',  template: `      <mat-list>        <mat-list-item>            <div mat-line></div>            <div mat-line [ngStyle]="{ 'padding-top': '5px' }">                <span [ngStyle]="{ 'font-weight': 'bold' }">ADF_CLOUD_PROCESS_LIST.PROPERTIES.STARTED_BY :</span>                <span> </span>            </div>        </mat-list-item>      </mat-list>    `,  changeDetection: ChangeDetectionStrategy.OnPush,  encapsulation: ViewEncapsulation.None,  host: { class: 'adf-datatable-content-cell adf-name-column' },})export class ProcessNameComponent implements OnInit {  @Input()  context: any;  displayValue: ProcessInstanceCloud;  constructor() {}  ngOnInit() {    this.displayValue = this.context?.row?.obj;  }}
import { ChangeDetectionStrategy, Component, Input, OnInit, ViewEncapsulation } from '@angular/core';import { ProcessInstanceCloud } from '@alfresco/adf-process-services-cloud';@Component({  selector: 'custom-template-status-column',  template: `    <mat-chip-list>        <mat-chip>            <div [ngStyle]="{ 'padding-right': '5px' }">                <mat-icon *ngIf="displayValue.status === 'COMPLETED'" [ngStyle]="{ 'color': 'green' }">check_circle</mat-icon>                <mat-icon *ngIf="displayValue.status === 'RUNNING'"   [ngStyle]="{ 'color': 'green' }">settings</mat-icon>                <mat-icon *ngIf="displayValue.status === 'SUSPENDED'" [ngStyle]="{ 'color': 'red' }">block</mat-icon>                <mat-icon *ngIf="displayValue.status === 'CANCELLED'" [ngStyle]="{ 'color': 'red' }">highlight_off</mat-icon>            </div>            <span></span>        </mat-chip>    </mat-chip-list>     `,  changeDetection: ChangeDetectionStrategy.OnPush,  encapsulation: ViewEncapsulation.None,  host: { class: 'adf-datatable-content-cell adf-name-column' },})export class ProcessStatusComponent implements OnInit {  @Input()  context: any;  displayValue: ProcessInstanceCloud;  constructor() {}  ngOnInit() {    this.displayValue = this.context?.row?.obj;  }}

Register the custom components in theprocess-list.module.ts file. For more on how to register a custom component seeRegistration.

@NgModule({    declarations: [ ProcessNameComponent, ProcessStatusComponent ]})export class ProcessListCloudModule {    constructor(extensions: ExtensionService) {        extensions.setComponents({            'app.processList.columns.name': ProcessNameComponent,            'app.processList.columns.status': ProcessStatusComponent        });    }}

Once you have registered your components, you need to register your new template component. To do this you need to add your new column to theyour-app.extensions.json file:

{  "features": {    "processList": {        "presets": {            "default": [                {                  "id": "app.process.name",                  "key": "name",                  "title": "ADF_CLOUD_PROCESS_LIST.PROPERTIES.NAME",                  "type": "text",                  "template": "app.processList.columns.name",                  "sortable": true                },                {                  "id": "app.process.status",                  "key": "status",                  "title": "ADF_CLOUD_PROCESS_LIST.PROPERTIES.STATUS",                  "type": "text",                  "template": "app.processList.columns.status",                  "sortable": true                }            ]        }    }  }}

Restart the application and you will see the custom columns in the process list based on the new custom template.

Process list custom template

Create a custom user interface

Starting with Process Automation version 7.12, custom user interfaces can be modified, starting from the default interface. If you’re using older Process Automation version and wish to modify the user interface, seeextending digital workspace instead.

To create a custom user interface:

  1. Sign in to the Modeling Application and open a project.

  2. Click the three dots next toUI and then selectCreate Custom UI.

  3. Enter the name of the custom UI.

If you want to develop the custom UI basing on the existing default UI of the application, selectGenerate from template and clickdownload source code link. Once your custom UI is ready to be deployed selectUpload (you need to build your application and create a zip from the build).

Develop a custom user interface

Custom UIs can be developed using hyland nx generators.

The downloaded zip includes instructions how to customize application. To see the instructions, refer toplugins-generators.md file within the downloaded ZIP package.

Upload

Once the custom interface has been fully developed and tested it can be deployed.

  1. Sign in to the Modeling Application and open a project.

  2. Select the created custom UI under the UI drop-down list.

  3. ClickUpload.

  4. Upload the custom UI as a ZIP file.

Custom form fields

To include custom form fields within a form, theform field customizations must be included in thecustomization of Digital Workspace or thedevelopment of a custom user interface.

Note: The custom field can beincluded in a form before the custom interface has been deployed.

REST API

The REST APIs are accessed differently depending on whether a service is an application or platform-specific. For application endpoints, the application name will form part of the endpoint.

The OpenAPI specifications for application endpoints require the{application-name} element in the URL:

  • Application runtime bundle:{domain-name}/{application-name}/rb/swagger-ui/index.html.
  • Application query service:{domain-name}//{application-name}/query/swagger-ui/index.html.

The query service can also use GraphQL to expand the querying and can be accessed at:{domain-name}/{application-name}/notifications/graphiql.

Clean up historical data

You can use the REST API or the Create cleanup job process from within the Admin App to clean up your historical data.

Clean up using REST API

You can clean up historical data using the REST API by using specific keys as input paramaters.

PropertyDescription
historicRetentionDaysRequired. The number of days to retain any completed or cancelled processes.
processDefinitionKeysOptional. A list of process definition keys to clean up. If omitted, all current process definitions are queried from the database and applied to delete the criteria. The default isnull.
limitSizeOptional. A parameter that specifies the delete query size limit for performance. The default is1000 rows.
schemaPrefixOptional. A parameter that specifies the schema prefix, i.e.public. The default is an empty string.
asyncOptional. A parameter that specifies the job execution strategy via the task executor. The default is true.

For example:

POST /v1/admin/batch/jobs/executions/cleanup-query-process-instance-history-job

{  "historicRetentionDays": 10,  "processDefinitionKeys": ["ConnectorProcess", "HeadersConnectorProcess"],  "limitSize": 100,  "schemaPrefix": "public",  "async": true}

Replay service task using REST API

If a service task does not complete due to a Cloud connector failure it’s possible to replay the task and send a new integration request. To do this you must provide the execution id and the definition id of the service task:

POST /v1/executions/{executionId}/replay/service-task

{   "flowNodeId": "flowNodeId"}

Edit this page

Suggest an edit on GitHub
By clicking "Accept Cookies", you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts.View Cookie Policy.

[8]ページ先頭

©2009-2025 Movatter.jp