mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[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:
@@ -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"] },
|
||||
{
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user