- BPM
A complete list of all the BPM methods is available herActiviti API. Below you can find some common examples.
Below you can find some example relative to the Activiti process api for all the possible method go to Task Api documentation
listTasks(requestNode)
return a list of task based on the requestNode query
import { TasksApi } from '@alfresco/js-api';
let requestTasks = new ResultListDataRepresentationTaskRepresentation();
let taskApi = TasksApi(this.alfrescoApi);
taskApi.listTasks(requestTasks).then(
(data) => {
console.log('listTasks ' + data);
},
(error) => {
console.log('Error' + error);
});
getTask(taskId)
return the TaskRepresentation of single task by id
Name | Type | Description |
---|---|---|
taskId | String | taskId |
let taskId = '10'; // String | taskId
let taskApi = TasksApi(this.alfrescoApi);
taskApi.getTask(taskId).then(function (data) {
console.log('Task representation ' + data);
}, function (error) {
console.log('Error' + error);
});
filterTasks(requestTasks)
return the ResultListDataRepresentation that is a list of all the task filered
Name | Type | Description |
---|---|---|
requestTasks | TaskFilterRequestRepresentation | requestTasks |
let requestTasks = new TaskFilterRequestRepresentation();
requestTasks.appDefinitionId = 1;
let taskApi = TasksApi(this.alfrescoApi);
taskApi.filterTasks(requestTasks).then(function (data) {
console.log('Task filter list ' + data);
}, function (error) {
console.log('Error' + error);
});
completeTask(taskId)
To complete a task (standalone or without a task form) :
Name | Type | Description |
---|---|---|
taskId | String | taskId |
let taskId = '10'; // String | taskId
let taskApi = TasksApi(this.alfrescoApi);
taskApi.taskApi.completeTask(taskId).then(() => {
console.log('Task completed');
}, function (error) {
console.log('Error' + error);
});
getTaskForm(taskId)
Retrieve the Task Form representation. FormDefinitionRepresentation
Name | Type | Description |
---|---|---|
taskId | String | taskId |
let taskId = '10'; // String | taskId
let taskApi = TasksApi(this.alfrescoApi);
taskApi.getTaskForm(taskId).then(function (data) {
console.log('Task form representation' + data);
}, function (error) {
console.log('Error' + error);
});
completeTaskForm(taskId, completeTaskFormRepresentation)
Complete a Task Form
Name | Type | Description |
---|---|---|
taskId | String | taskId |
completeTaskFormRepresentation | CompleteFormRepresentation | completeTaskFormRepresentation |
let taskId = '10'; // String | taskId
let taskApi = TasksApi(this.alfrescoApi);
taskApi..completeTaskForm(taskId, completeTaskFormRepresentation).then(() => {
console.log('Task completed');
}, function (error) {
console.log('Error' + error);
});
Below you can find some example relative to the Activiti process api for all the possible method go to Process Api documentation
getProcessInstances(requestNode)
Retrieve a list of process instances ResultListDataRepresentation
Name | Type | Description |
---|---|---|
requestNode | ProcessFilterRequestRepresentation | requestNode |
let requestNode = new ProcessInstanceQueryRepresentation();
let processApi = ProcessApi(this.alfrescoApi);
processApi.getProcessInstances(requestNode).then(function (data) {
console.log('All processes' + data);
}, function (error) {
console.log('Error' + error);
});
Filtered process:
let requestNode = new ProcessInstanceQueryRepresentation();
page = 0;
requestNode.sort = 'created-desc';
requestNode.state = 'completed';
let processApi = ProcessApi(this.alfrescoApi);
processApi.getProcessInstances(requestNode).then(function (data) {
console.log('All processes completed' + data);
}, function (error) {
console.log('Error' + error);
});
Below you can find some example relative to the Activiti process api for all the possible method go to Task Api documentation
getModel(modelId, opts)
To retrieve details about a particular model (process, form, decision rule or app) return a ModelRepresentation
Name | Type | Description | Notes |
---|---|---|---|
modelId | Integer | modelId | |
includePermissions | Boolean | includePermissions | [optional] |
let opts = {
'filter': 'myReusableForms',
'modelType': 2
};
let modelsApi = ModelsApi(this.alfrescoApi);
modelsApi.getModels(opts).then(function (data) {
console.log('All your reusable forms' + data);
}, function (error) {
console.log('Error' + error);
});
Below you can find some example relative to the Activiti report api for all the possible method go to Report Api documentation
createDefaultReports()
Create the default reports
No parameters required.
let reportApi = ReportApi(this.alfrescoApi);
reportApi.createDefaultReports();
getReportList()
Retrieve the available report list
No parameters required.
let reportApi = ReportApi(this.alfrescoApi);
reportApi.getReportList();
getReportParams(reportId)
Retrieve the parameters referring to the reportId.
Name | Type | Description | Notes |
---|---|---|---|
reportId | String | reportId |
let reportId = "1"; // String | reportId
let reportApi = ReportApi(this.alfrescoApi);
reportApi.getReportParams(reportId);
getProcessDefinitions()
Retrieve the process definition list for all the apps.
No parameters required.
let reportApi = ReportApi(this.alfrescoApi);
reportApi.getProcessDefinitions();
getTasksByProcessDefinitionId(reportId, processDefinitionId)
Retrieves all tasks that refer to the processDefinitionId
Name | Type | Description | Notes |
---|---|---|---|
reportId | String | reportId | |
processDefinitionId | String | process definition id |
let reportId = "1"; // String | reportId
let processDefinitionId = "1"; // String | processDefinitionId
let reportApi = ReportApi(this.alfrescoApi);
reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);
getReportsByParams(reportId, paramsQuery)
Generate the reports based on the input parameters
Name | Type | Description | Notes |
---|---|---|---|
reportId | String | reportId | |
paramsQuery | Object | Query parameters |
let reportId = "1"; // String | reportId
let paramsQuery = {status: 'ALL'}; // Object | paramsQuery
let reportApi = ReportApi(this.alfrescoApi);
reportApi.getReportsByParams(reportId, paramsQuery);
updateReport(reportId, name)
Update the report details
Name | Type | Description | Notes |
---|---|---|---|
reportId | String | reportId | |
name | String | The report name |
let reportId = "1"; // String | reportId
let name = "new Fake name"; // String | reportId
let reportApi = ReportApi(this.alfrescoApi);
reportApi.updateReport(reportId, name);
exportToCsv(reportId, queryParms)
Export a report as csv
Name | Type | Description | Notes |
---|---|---|---|
reportId | String | reportId | |
queryParms | Object | Query parameters |
let reportId = "1"; // String | reportId
let queryParms = {
'processDefinitionId': 'TEST:99:999',
'dateRange': {
'startDate': '2017-01-01T00:00:00.000Z',
'endDate': '2017-01-24T23:59:59.999Z',
'rangeId': 'currentYear'
},
'slowProcessInstanceInteger': 10,
'status': 'All',
'__reportName': 'FAKE_REPORT_NAME'
};
let reportApi = ReportApi(this.alfrescoApi);
reportApi.exportToCsv(reportId, queryParms);
saveReport(reportId, queryParams)
Save a report
Name | Type | Description | Notes |
---|---|---|---|
reportId | String | reportId | |
queryParms | Object | Query parameters |
let reportId = "1"; // String | reportId
let queryParms = {
'processDefinitionId': 'TEST:99:999',
'dateRange': {
'startDate': '2017-01-01T00:00:00.000Z',
'endDate': '2017-01-24T23:59:59.999Z',
'rangeId': 'currentYear'
},
'slowProcessInstanceInteger': 10,
'status': 'All',
'__reportName': 'FAKE_REPORT_NAME'
};
let reportApi = ReportApi(this.alfrescoApi);
reportApi.saveReport(reportId, queryParms);
deleteReport(reportId)
Delete a report
Name | Type | Description | Notes |
---|---|---|---|
reportId | String | reportId |
let reportId = "1"; // String | reportId
let reportApi = ReportApi(this.alfrescoApi);
reportApi.deleteReport(reportId);