Content connector

The content connector can be used to execute actions against content in Alfresco Content Services (ACS) as part of a process. The content connector is graphically represented by the Alfresco logo whilst modeling a process.

Important: The content connector requires a licensed version of Alfresco Content Services (ACS) to interact with.

The content connector does not require any connector variables to be set. It connects to the deployed ACS instance automatically.

Actions

The following actions can be executed using the content connector:

As an example, the implementation value of the copy content action in a service task would be similar to the following:

 <bpmn2:serviceTask id="ServiceTask_00b2568" implementation="content-connector.COPY_CONTENT" />

Common input parameters

The following input parameters are common between content connector actions:

ParameterDescriptionTypeExample
nodeId*Required.** The node ID of the node to operate on in Alfresco Content Services.Stringdioos2a1-2a22-4f42-820d-c2b628751121
files*Required.** A file uploaded in a project and set as a process variable or uploaded as part of a form or another connector to operate on.File
folders*Required.** A process variable of type folder.Folder
locationPath*Required.** The URI of a node to operate on.Stringalfresco:/bc67b437-f9e6-439c-b88b-6d49efa0f734
searchQuery*Required.** The query to use to find the nodes to operate on.String
search_skipCountOptional. The number of items to exclude before generating a result set from the searchQuery.Integer5
search_maxItemsOptional. The maximum number of items to include in the result set from the searchQuery.Integer1
search_rootNodeIdOptional. The node ID to begin the searchQuery from.Stringfdcac4a4-1f51-4e02-820d-c2b669647671
search_includeOptional. Additional information to return about the node from the searchQuery. Values include: properties, aspectNames, path, isLink, allowableOperations, association, isLocked, permissions.Arrayproperties, permissions
search_orderByOptional. Orders the list of properties returned by the searchQuery.Array
search_fieldsOptional. Set the list of properties to be returned about the node in the response of the searchQueryArrayid, name

* One of these parameters is required to identify the content to operate on.

Common output parameters

ParameterDescriptionTypeExample
nodesOptional. A list of nodes operated on by the action.Array
responsesRequired. An list of HTTP responses from the action.JSON
content.errorOptional. Any errors returned by the connector in performing the operation.String

Create a file

The CREATE_NODE action is used to upload files to the Alfresco Content Services repository.

ParameterDescriptionTypeExample
nameRequired. A name for the file including an extension.StringJanuary Orders.docx
autorenameOptional. If set to true then a suffix will be added to the file name if a file with that name already exists.BooleanTrue
nodeTypeOptional. The node type for the new content. The default value is cm:contentStringcm:content
includeOptional. Additional information to return about the node. Values include: properties, aspectNames, path, isLink, allowableOperations, association, isLocked, permissions.Arrayproperties, permissions
fieldsOptional. Set the list of properties to be returned about the node.Arrayid, name

Create a folder

The CREATE_FOLDER action is used to create new folders in the Alfresco Content Services repository.

ParameterDescriptionTypeExample
folderNameRequired. A name for the folder.String2020-shipments
autorenameOptional. If set to true then a suffix will be added to the folder name if a folder with that name already exists.BooleanTrue
nodeTypeOptional. The node type for the new content. The default value is cm:folderStringcm:file
includeOptional. Additional information to return about the node. Values include: properties, aspectNames, path, isLink, allowableOperations, association, isLocked, permissions.Arrayproperties, permissions
fieldsOptional. Set the list of properties to be returned about the node.Arrayid, name

Update content

The UPDATE_CONTENT action is used to upload new versions of files to the Alfresco Content Services repository.

ParameterDescriptionTypeExample
nameOptional. A name for the file including an extension.StringJanuary Orders.docx
textSourceOptional. The source for the update to the file in text format.String
fileSourceOptional. The source for the update to the file in file variable format.Fileorders-source
majorVersionOptional. If set to true then a major version will be created for the file update. If set to false a minor version will be created.BooleanFalse
commentOptional. The version comment to appear in the versioning history.StringMajor update to amend order.
includeOptional. Additional information to return about the node. Values include: properties, aspectNames, path, isLink, allowableOperations, association, isLocked, permissions.Arrayproperties, permissions
fieldsOptional. Set the list of properties to be returned about the node.Arrayid, name

Move content

The MOVE_CONTENT action is used to move files or folders to a new location in the Alfresco Content Services repository. If a folder is moved then its children will also move to the new location.

ParameterDescriptionTypeExample
nodeIdTargetRequired. The node ID of the location to move the content to.String164e0082-5ac1-4afa-a09b-619a8c79f66g
useFilesOptional. Set to true to include files in the search query.BooleanTrue
useFoldersOptional. Set to true to include folders in the search query.BooleanFalse
includeOptional. Additional information to return about the node. Values include: properties, aspectNames, path, isLink, allowableOperations, association, isLocked, permissions.Arrayproperties, permissions
fieldsOptional. Set the list of properties to be returned about the node.Arrayid, name

Copy content

The COPY_CONTENT action is used to make a copy of files or folders and move the copy to a new location in the Alfresco Content Services repository. If a folder is copied then its children will also be replicated in the new location.

ParameterDescriptionTypeExample
nodeIdTargetRequired. The node ID of the location to copy the content to.String164e0082-5ac1-4afa-a09b-619a8c79f66g
useFilesOptional. Set to true to include files in the search query.BooleanTrue
useFoldersOptional. Set to true to include folders in the search query.BooleanFalse
includeOptional. Additional information to return about the node. Values include: properties, aspectNames, path, isLink, allowableOperations, association, isLocked, permissions.Arrayproperties, permissions
fieldsOptional. Set the list of properties to be returned about the node.Arrayid, name

Delete content

The DELETE_CONTENT action is used to delete files and folders from the Alfresco Content Services repository. If deleting a folder then its children will also be deleted.

ParameterDescriptionTypeExample
permanentOptional. If set to true the content will be permanently deleted instead of being moved to the trash can.BooleanFalse
useFilesOptional. Set to true to only include files in the search query.BooleanTrue
useFoldersOptional. Set to true to only include folders in the search query.BooleanFalse

Update content permissions

The SET_PERMISSIONS action is used to update the permissions for files or folders in the Alfresco Content Services repository.

Note: Only one role can be assigned at a time.

ParameterDescriptionTypeExample
usersRequired. A list of users to update permissions for.Arrayhruser, hradmin
roleRequired. The role to assign to the list of users.StringContributor
useFilesOptional. Set to true to only include files in the search query.BooleanTrue
useFoldersOptional. Set to true to only include folders in the search query.BooleanFalse
includeOptional. Additional information to return about the node. Values include: properties, aspectNames, path, isLink, allowableOperations, association, isLocked, permissions.Arrayproperties, permissions
fieldsOptional. Set the list of properties to be returned about the node.Arrayid, name

Update content tags

The UPDATE_TAG action is used to update tags for files and folders in the Alfresco Content Services repository.

ParameterDescriptionTypeExample
tagsRequired. A list of tags to update for the node.Array2020, orders, online
useFilesOptional. Set to true to only include files in the search query.BooleanTrue
useFoldersOptional. Set to true to only include folders in the search query.BooleanFalse
includeOptional. Additional information to return about the node. Values include: properties, aspectNames, path, isLink, allowableOperations, association, isLocked, permissions.Arrayproperties, permissions
fieldsOptional. Set the list of properties to be returned about the node.Arrayid, name

Update content metadata

The UPDATE_METADATA action is used to update the metadata for files and folders in the Alfresco Content Services repository.

ParameterDescriptionTypeExample
metadataRequired, The metadata to assign to the node.*content-metadata**
useFilesOptional. Set to true to only include files in the search query.BooleanTrue
useFoldersOptional. Set to true to only include folders in the search query.BooleanFalse
includeOptional. Additional information to return about the node. Values include: properties, aspectNames, path, isLink, allowableOperations, association, isLocked, permissions.Arrayproperties, permissions
fieldsOptional. Set the list of properties to be returned about the node.Arrayid, name

* Updating metadata allows for variables or values to be mapped to custom types and custom aspects from a defined content model.

Lock content

The LOCK_NODE action is used to lock a node in the Alfresco Content Services repository so that it cannot be edited.

ParameterDescriptionTypeExample
nodeBodyLockRequired.JSONExample below.
useFilesOptional. Set to true to only include files in the search query.BooleanTrue
useFoldersOptional. Set to true to only include folders in the search query.BooleanFalse

The following is an example of the nodeBodyLock syntax:

{
    "nodeId":"d57a6dd9-a11d-4c9d-b115-cea708efceda",
    "nodeBodyLock": {
        "type": "FULL",
        "lifetime": "PERSISTENT"
          }
  }

Unlock content

The UNLOCK_NODE action is used to unlock a node in the Alfresco Content Services repository so that it can be edited again.

ParameterDescriptionTypeExample
useFilesOptional. Set to true to only include files in the search query.BooleanTrue
useFoldersOptional. Set to true to only include folders in the search query.BooleanFalse

Select a file

The SELECT_FILE action is used to select a file from the Alfresco Content Services repository to be used in the process.

No additional input parameters are required to select a file. The following output parameter is included that contains the selected file:

ParameterDescriptionTypeExample
filesRequired. The files returned as a file variable.Fileorders-file

Select a folder

The SELECT_FOLDER action is used to select a folder from the Alfresco Content Services repository to be used in the process.

No additional input parameters are required to select a folder. The following output parameter is included that contains the selected folder:

ParameterDescriptionTypeExample
foldersRequired. The folder returned as a process variable of type folder.Folder2020-shipments

Select content metadata

The SELECT_METADATA action is used to select the metadata from a file or folder from Alfresco Content Services.

ParameterDescriptionTypeExample
useFilesOptional. Set to true to only include files in the search query.BooleanTrue
useFoldersOptional. Set to true to only include folders in the search query.BooleanFalse

The following is an example response of the selected metadata:

{
    "164e0082-5ac1-4afa-a09b-619a8c79f66f": {
        "cm:categories": [],
        "cm:lastThumbnailModification": [
            "imgpreview:1588671895595"
    ]
  }
}

Events

The following events can be configured as event triggers using the content connector:

Common output parameters

All events share a common set of output parameters:

ParameterDescriptionTypeExample
typeThe Java class of the resource.String
idThe node ID of the node that is created.Stringdioos2a1-2a22-4f42-820d-c2b628751121
nodeTypeThe content type that is created.Stringcm:file
isFileA flag for whether the node is a file.BooleanTrue
isFolderA flag for whether the node is a folder.BooleanFalse
primaryHierarchyAn array of parent nodesArrayioos2a1-2a22-4f42-820d-c2b628751121, 164e0082-5ac1-4afa-a09b-619a8c79f66f
propertiesThe properties of the created node.JSON
affectedPropertiesBeforeThe properties of the node before the event.JSON
affectedPropertiesAfterThe properties of the node after the event.JSON
aspectsThe list of aspects of the created node that are prefixed.Arraycm:versionable
aspectNamesBeforeA list of the prefixed aspect names before the event.Arraycm:versionable
aspectNamesAfterA list of the prefixed aspect names after the event.Arraycm:versionable, cm:reviewed

Content created

This event is fired when a file or folder is created in Alfresco Content Services that matches the input parameters defined in the trigger event.

For a file the event is called FILE_CREATED.

For a folder the event is called FOLDER_CREATED.

ParameterDescriptionTypeExample
nodeNameThe name of the node that is created.String2020-orders
parentFolderThe node ID of the parent folder.Stringdioos2a1-2a22-4f42-820d-c2b628751121
nodeTypeThe content type of the node that is created.Stringcm:file

Content updated

This event is fired when the properties of a file or folder in Alfresco Content Services are updated to match the input parameters defined in the trigger event.

For a file the event is called FILE_UPDATED.

For a folder the event is called FOLDER_UPDATED.

ParameterDescriptionTypeExample
propertiesThe properties that must be matched for the event to be fired.JSON
parentFolderThe node ID of the parent folder.Stringdioos2a1-2a22-4f42-820d-c2b628751121
nodeTypeThe content type of the node that is updated.Stringcm:file

Content moved

This event is fired when a file or folder is moved to a new location in Alfresco Content Services that matches the input parameters defined in the trigger event.

For a file the event is called FILE_MOVED.

For a folder the event is called FOLDER_MOVED.

ParameterDescriptionTypeExample
targetFolderThe node ID of the folder the node is moved to for an event to fire.String164e0082-5ac1-4afa-a09b-619a8c79f66f
nodeTypeThe content type of the node that is moved.Stringcm:file

Content deleted

This event is fired when a file or folder is deleted from Alfresco Content Services that matches the input parameters defined in the trigger event.

For a file the event is called FILE_DELETED.

For a folder the event is called FOLDER_DELETED.

ParameterDescriptionTypeExample
parentFolderThe node ID of the folder the node is deleted in.Stringdioos2a1-2a22-4f42-820d-c2b628751121
nodeTypeThe content type of the node that is deleted.Stringcm:file

© 2023 Alfresco Software, Inc. All Rights Reserved.