* integrate JS-API with monorepo * [ci:force] fix token issue [ci:force] migrate docs folder [ci:force] clean personal tokens * [ci:force] gha workflow support * [ci:force] npm publish target * fix js-api test linting * [ci:force] fix test linting, mocks, https scheme * [ci:force] fix https scheme * [ci:force] typescript mappings * [ci:force] update scripts * lint fixes * linting fixes * fix linting * [ci:force] linting fixes * linting fixes * [ci:force] remove js-api upstream and corresponding scripts * [ci:force] jsdoc fixes * fix jsdoc linting * [ci:force] jsdoc fixes * [ci:force] jsdoc fixes * jsdoc fixes * jsdoc fixes * jsdoc fixes * [ci:force] fix jsdoc * [ci:force] reduce code duplication * replace 'chai' expect with node.js assert * replace 'chai' expect with node.js assert * [ci:force] remove chai and chai-spies for js-api testing * [ci:force] cleanup and fix imports * [ci:force] fix linting * [ci:force] fix unit test * [ci:force] fix sonar linting findings * [ci:force] switch activiti api models to interfaces (-2.5% reduction of bundle) * [ci:force] switch activiti api models to interfaces * [ci:force] switch AGS api models to interfaces * [ci:force] switch AGS api models to interfaces * [ci:force] switch search api models to interfaces * [ci:force] switch content api models to interfaces where applicable
13 KiB
ModelsApi
All URIs are relative to /activiti-app/api
Method | HTTP request | Description |
---|---|---|
createModel | POST /enterprise/models | Create a new model |
deleteModel | DELETE /enterprise/models/{modelId} | Delete a model |
duplicateModel | POST /enterprise/models/{modelId}/clone | Duplicate an existing model |
getModelJSON | GET /enterprise/models/{modelId}/editor/json | Get model content |
getModelThumbnail | GET /enterprise/models/{modelId}/thumbnail | Get a model's thumbnail image |
getModel | GET /enterprise/models/{modelId} | Get a model |
getModelsToIncludeInAppDefinition | GET /enterprise/models-for-app-definition | List process definition models shared with the current user |
getModels | GET /enterprise/models | List models (process, form, decision rule or app) |
importNewVersion | POST /enterprise/models/{modelId}/newversion | Create a new version of a model |
importProcessModel | POST /enterprise/process-models/import | Import a BPMN 2.0 XML file |
saveModel | POST /enterprise/models/{modelId}/editor/json | Update model content |
updateModel | PUT /enterprise/models/{modelId} | Update a model |
validateModel | POST /enterprise/models/{modelId}/editor/validate | Validate model content |
createModel
ModelRepresentation createModel(modelRepresentation)
Create a new model
Example
import ModelsApi from 'ModelsApi';
import { AlfrescoApi } from '@alfresco/js-api';
this.alfrescoApi = new AlfrescoApi();
this.alfrescoApi.setConfig({
hostEcm: 'http://127.0.0.1:8080'
});
let modelsApi = new ModelsApi(this.alfrescoApi);
modelsApi.createModel(modelRepresentation).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Parameters
Name | Type | Description | Notes |
---|---|---|---|
modelRepresentation | ModelRepresentation | modelRepresentation |
Return type
deleteModel
deleteModel(modelIdopts)
Delete a model
Example
import ModelsApi from 'ModelsApi';
import { AlfrescoApi } from '@alfresco/js-api';
this.alfrescoApi = new AlfrescoApi();
this.alfrescoApi.setConfig({
hostEcm: 'http://127.0.0.1:8080'
});
let modelsApi = new ModelsApi(this.alfrescoApi);
let opts = {
'cascade': true // | cascade
'deleteRuntimeApp': true // | deleteRuntimeApp
};
modelsApi.deleteModel(modelIdopts).then(() => {
console.log('API called successfully.');
}, function(error) {
console.error(error);
});
Parameters
Name | Type | Description | Notes |
---|---|---|---|
modelId | number | modelId | |
cascade | boolean | cascade | [optional] |
deleteRuntimeApp | boolean | deleteRuntimeApp | [optional] |
Return type
null (empty response body)
duplicateModel
ModelRepresentation duplicateModel(modelIdmodelRepresentation)
Duplicate an existing model
Example
import ModelsApi from 'ModelsApi';
import { AlfrescoApi } from '@alfresco/js-api';
this.alfrescoApi = new AlfrescoApi();
this.alfrescoApi.setConfig({
hostEcm: 'http://127.0.0.1:8080'
});
let modelsApi = new ModelsApi(this.alfrescoApi);
modelsApi.duplicateModel(modelIdmodelRepresentation).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Parameters
Name | Type | Description | Notes |
---|---|---|---|
modelId | number | modelId | |
modelRepresentation | ModelRepresentation | modelRepresentation |
Return type
getModelJSON
ObjectNode getModelJSON(modelId)
Get model content
Example
import ModelsApi from 'ModelsApi';
import { AlfrescoApi } from '@alfresco/js-api';
this.alfrescoApi = new AlfrescoApi();
this.alfrescoApi.setConfig({
hostEcm: 'http://127.0.0.1:8080'
});
let modelsApi = new ModelsApi(this.alfrescoApi);
modelsApi.getModelJSON(modelId).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Parameters
Name | Type | Description | Notes |
---|---|---|---|
modelId | number | modelId |
Return type
getModelThumbnail
string getModelThumbnail(modelId)
Get a model's thumbnail image
Example
import ModelsApi from 'ModelsApi';
import { AlfrescoApi } from '@alfresco/js-api';
this.alfrescoApi = new AlfrescoApi();
this.alfrescoApi.setConfig({
hostEcm: 'http://127.0.0.1:8080'
});
let modelsApi = new ModelsApi(this.alfrescoApi);
modelsApi.getModelThumbnail(modelId).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Parameters
Name | Type | Description | Notes |
---|---|---|---|
modelId | number | modelId |
Return type
string
getModel
ModelRepresentation getModel(modelIdopts)
Get a model
Models act as containers for process, form, decision table and app definitions
Example
import ModelsApi from 'ModelsApi';
import { AlfrescoApi } from '@alfresco/js-api';
this.alfrescoApi = new AlfrescoApi();
this.alfrescoApi.setConfig({
hostEcm: 'http://127.0.0.1:8080'
});
let modelsApi = new ModelsApi(this.alfrescoApi);
let opts = {
'includePermissions': true // | includePermissions
};
modelsApi.getModel(modelIdopts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Parameters
Name | Type | Description | Notes |
---|---|---|---|
modelId | number | modelId | |
includePermissions | boolean | includePermissions | [optional] |
Return type
getModelsToIncludeInAppDefinition
ResultListDataRepresentationModelRepresentation getModelsToIncludeInAppDefinition()
List process definition models shared with the current user
Example
import ModelsApi from 'ModelsApi';
import { AlfrescoApi } from '@alfresco/js-api';
this.alfrescoApi = new AlfrescoApi();
this.alfrescoApi.setConfig({
hostEcm: 'http://127.0.0.1:8080'
});
let modelsApi = new ModelsApi(this.alfrescoApi);
modelsApi.getModelsToIncludeInAppDefinition().then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Parameters
This endpoint does not need any parameter.
Return type
ResultListDataRepresentationModelRepresentation
getModels
ResultListDataRepresentationModelRepresentation getModels(opts)
List models (process, form, decision rule or app)
Example
import ModelsApi from 'ModelsApi';
import { AlfrescoApi } from '@alfresco/js-api';
this.alfrescoApi = new AlfrescoApi();
this.alfrescoApi.setConfig({
hostEcm: 'http://127.0.0.1:8080'
});
let modelsApi = new ModelsApi(this.alfrescoApi);
let opts = {
'filter': filter_example // | filter
'sort': sort_example // | sort
'modelType': 56 // | modelType
'referenceId': 789 // | referenceId
};
modelsApi.getModels(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Parameters
Name | Type | Description | Notes |
---|---|---|---|
filter | string | filter | [optional] |
sort | string | sort | [optional] |
modelType | number | modelType | [optional] |
referenceId | number | referenceId | [optional] |
Return type
ResultListDataRepresentationModelRepresentation
importNewVersion
ModelRepresentation importNewVersion(modelIdfile)
Create a new version of a model
Example
import ModelsApi from 'ModelsApi';
import { AlfrescoApi } from '@alfresco/js-api';
this.alfrescoApi = new AlfrescoApi();
this.alfrescoApi.setConfig({
hostEcm: 'http://127.0.0.1:8080'
});
let modelsApi = new ModelsApi(this.alfrescoApi);
modelsApi.importNewVersion(modelIdfile).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Parameters
Name | Type | Description | Notes |
---|---|---|---|
modelId | number | modelId | |
file | Blob | file |
Return type
importProcessModel
ModelRepresentation importProcessModel(file)
Import a BPMN 2.0 XML file
Example
import ModelsApi from 'ModelsApi';
import { AlfrescoApi } from '@alfresco/js-api';
this.alfrescoApi = new AlfrescoApi();
this.alfrescoApi.setConfig({
hostEcm: 'http://127.0.0.1:8080'
});
let modelsApi = new ModelsApi(this.alfrescoApi);
modelsApi.importProcessModel(file).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Parameters
Name | Type | Description | Notes |
---|---|---|---|
file | Blob | file |
Return type
saveModel
ModelRepresentation saveModel(modelIdvalues)
Update model content
Example
import ModelsApi from 'ModelsApi';
import { AlfrescoApi } from '@alfresco/js-api';
this.alfrescoApi = new AlfrescoApi();
this.alfrescoApi.setConfig({
hostEcm: 'http://127.0.0.1:8080'
});
let modelsApi = new ModelsApi(this.alfrescoApi);
modelsApi.saveModel(modelIdvalues).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Parameters
Name | Type | Description | Notes |
---|---|---|---|
modelId | number | modelId | |
values | any | values |
Return type
updateModel
ModelRepresentation updateModel(modelIdupdatedModel)
Update a model
This method allows you to update the metadata of a model. In order to update the content of the model you will need to call the specific endpoint for that model type.
Example
import ModelsApi from 'ModelsApi';
import { AlfrescoApi } from '@alfresco/js-api';
this.alfrescoApi = new AlfrescoApi();
this.alfrescoApi.setConfig({
hostEcm: 'http://127.0.0.1:8080'
});
let modelsApi = new ModelsApi(this.alfrescoApi);
modelsApi.updateModel(modelIdupdatedModel).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Parameters
Name | Type | Description | Notes |
---|---|---|---|
modelId | number | modelId | |
updatedModel | ModelRepresentation | updatedModel |
Return type
validateModel
ValidationErrorRepresentation validateModel(modelIdopts)
Validate model content
Example
import ModelsApi from 'ModelsApi';
import { AlfrescoApi } from '@alfresco/js-api';
this.alfrescoApi = new AlfrescoApi();
this.alfrescoApi.setConfig({
hostEcm: 'http://127.0.0.1:8080'
});
let modelsApi = new ModelsApi(this.alfrescoApi);
let opts = {
'values': // | values
};
modelsApi.validateModel(modelIdopts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Parameters
Name | Type | Description | Notes |
---|---|---|---|
modelId | number | modelId | |
values | any | values | [optional] |