[ACA-4057]Add method to create process with values (#6296)

* Add method to create process with values

* Change the name of the method to be more precise

* Add 2 content models to subprocessapp

* Change properties names
This commit is contained in:
Cristina Jalba
2020-11-03 19:06:18 +02:00
committed by GitHub
parent 4aea79a68c
commit 39275a0e33
3 changed files with 62 additions and 0 deletions

View File

@@ -262,6 +262,50 @@
"processchild": "processchild",
"processparent": "processparent"
},
"contentModels": {
"contentmodelalltypes": {
"name": "contentmodelalltypes",
"singleCustomType": {
"name": "singleCustomType",
"properties": {
"textProperty": "customtypetext",
"longProperty": "customtypelong",
"intProperty": "customtypeint",
"mltextProperty": "customtypemltext",
"booleanProperty": "customtypeboolean",
"floatProperty": "customtypefloat",
"doubleProperty": "customtypedouble",
"dateProperty": "customtypedate",
"datetimeProperty": "customtypedatetime"
}
},
"singleCustomAspect": {
"name": "singleCustomAspect",
"properties": {
"textProperty": "aspecttext",
"longProperty": "aspectlong",
"intProperty": "aspectint",
"mltextProperty": "aspectmltext",
"booleanProperty": "aspectboolean",
"floatProperty": "aspectfloat",
"doubleProperty": "aspectdouble",
"dateProperty": "aspectdate",
"datetimeProperty": "aspectdatetime"
}
}
},
"contentmodelonlytypes": {
"name": "contentmodelonlytypes",
"customType1": {
"name": "customType",
"properties": {
"textProperty": "text",
"dateProperty": "date",
"datetimeProperty": "datetime"
}
}
}
},
"security": [
{ "role": "ACTIVITI_ADMIN", "groups": [], "users": ["superadminuser"] },
{

View File

@@ -43,6 +43,24 @@ export class ProcessUtil {
}
}
async startProcessByDefinitionNameWithFormValues(appName: string, processDefinitionName: string, values: any, processName?: string): Promise<any> {
try {
const appDefinition = await new ApplicationsUtil(this.api).getAppDefinitionByName(appName);
const processDefinition = await this.getProcessDefinitionByName(appDefinition.deploymentId, processDefinitionName);
const startProcessOptions: any = {
processDefinitionId: processDefinition.id,
name: processName ? processName : processDefinitionName + StringUtil.generateRandomString(5).toLowerCase(),
values
};
return this.api.apiService.activiti.processApi.startNewProcessInstance(startProcessOptions);
} catch (error) {
Logger.error('Start Process - Service error, Response: ', JSON.parse(JSON.stringify(error)));
}
}
async startProcessOfApp(appName: string, processName?: string): Promise<any> {
try {
const appDefinition = await new ApplicationsUtil(this.api).getAppDefinitionByName(appName);