Files Capture plugin - bluesoft-rnd/aperte-workflow-core GitHub Wiki
Files Capture plugin allows to perform a set of automated actions on Aperte Workflow processes. Each action is stored as separate rule and executed as part of bigger configuration.
- Performing actions on tasks inside running processes.
- Storing local files as process attachments inside any document repository that supports CMIS standard.
The plugin source code can be obtained from its Aperte Workflow github repository.
Compiled version can be downloaded with Aperte Workflow Bundle from sourceforge repository.
Copy the plugin jar into your existing Aperte Workflow installation. Place it into bundle installation directory. If not changed in PluginServlet init parameters it should be either ${aperte.workflow.home}/osgi-plugins or ${liferay.home}/osgi-plugins.
Plugin runtime configuration is based on following database tables. Because the plugin uses Hibernate as DB abstraction layer the types of the fields were listed as Java types.
Column name | Type | Required | Default value | Description |
---|---|---|---|---|
id | Long | True | Primary key | |
automaticUser | String | True | Name of the user that will be visible as the author of all performed operations. It does not have to be an existing user. | |
filesProperties | String | True | Root runtime directory for the plugin. All subdirectories inside this directory are going to be evaluated. Any normal file is going to be deleted. |
Documents are stored in ${rootFolderPath}/${newFolderPrefix}${processCode}/${subFolder}/ inside CMIS repository.
Column name | Type | Required | Default value | Description |
---|---|---|---|---|
id | Long | True | Primary key | |
configurationId | Long | True | Foreign key on pt_files_checker_config.id | |
folderAttributeName | String | True | cmisFolderId | Under which process attribute a CMIS folder ID for the documents is stored. Use of this attribute is suggested only when process uses a single CMIS folder (without subfolders). |
lookupRunningProcesses | Boolean | False | Lookup running processes. The running process is looked up using email subject (with removed tokens provided by subjectRemovables attribute, removed whitespaces and uppercased) matched to ProcessInstance.keyword. | |
newFolderPrefix | String | False | pt_ | Prefix used when creating a folder dedicated to a process instance on CMIS. |
processIdSubjectLookupRegexp | String | True | When processIdSubjectLookupRegexp is defined and matched and also matching process has been found and matches field processStepName. This action will be performed on the process, propagating further its execution. The regexp should contain one grouping, which will allow the engine to extract ProcessInstance.externalKey. The process to be propagated further has to be waiting in a task in a special task. |
|
processTaskName | String | False | The name of the task. Must match BpmTask.taskName. | |
repositoryAtomUrl | String | True | CMIS repository Atom URL. If not provided, email attachments are ignored and not stored in CMIS. | |
repositoryId | String | True | CMIS repository ID. | |
repositoryUser | String | True | CMIS repository user. | |
repositoryPassword | String | True | CMIS repository password. | |
rootFolderPath | String | False | CMIS repository root folder path. In this root folder, a folder with process name and prefixed with newFolderPrefix is created. In this folder, a sub-folder with a name subFolder is created and email attachments are stored there. If the folders on the path do not exist, the mechanism attempts to create them. | |
runningProcessActionName | String | False | When processIdSubjectLookupRegexp is defined and matched and also matching process has been found and matches field processStepName. This action will be performed on the process, propagating further its execution. The process to be propagated further has to be waiting in a task in a special task. |
INSERT INTO PT_FILES_CHECKER_CONFIG
(ID,
AUTOMATICUSER,
FILESPROPERTIES)
VALUES (92999931,
'test',
'/D:/Aperte/tmp');
INSERT INTO PT_FILES_CHECKER_RULE_CONFIG
(ID,
CONFIGURATION_ID,
FOLDERATTRIBUTENAME,
LOOKUPRUNNINGPROCESSES,
NEWFOLDERPREFIX,
PROCESSIDSUBJECTLOOKUPREGEXP,
PROCESSTASKNAME,
REPOSITORYATOMURL,
REPOSITORYID,
REPOSITORYUSER,
REPOSITORYPASSWORD,
ROOTFOLDERPATH,
RUNNINGPROCESSACTIONNAME,
SUBFOLDER)
VALUES (92999932,
92999931,
'cmisFolderId',
TRUE,
'my_',
'process_(.*)',
'REVIEW_SUBMISSION',
'http://localhost:12080/alfresco/service/cmis',
'bbb7e169-b1c5-4680-bb73-2e38f99432ee',
'admin',
'alfresco',
'my_dir',
'',
'aw_process');
This configuration takes D:/Aperte/tmp as plugin runtime root directory.
Plugin expects subdirectories with names that contains process identification value e.g. process${ProcessInstance.internalId}_ or process-${ProcessInstance.externalKey} inside it's runtime root directory. Inside any of mentioned subdirectories one can put any files that should be stored to CMIS repository.
However no files are going to be processed, if there is no .finish file inside this directory. After uploading to CMIS repository all files are going to be deleted.
Please do note that on file system with journaling, e.g. NTFS, files may end up not being deleted after uploading to CMIS. This can result in CMIS runtime exception.