I have import this api
There's already a people search component
You can look into its source if you want to customize it
I need API call from component level so I need ADF service to call User filter and Group Filter
Scenario for process named 'taskAssignProcess':
Tried to use alfrescoApiService:AlfrescoApiService methods (alfrescoApiService.getInstance().activiti.adminGroupsApi, alfrescoApiService.getInstance().activiti.groupsApi..) in order to obtain necessary users and groups according to scenario, but problem is that all involed users need to have high level capability such as Administration of tenant of this group in order this scenario works using alfrescoApiService:AlfrescoApiService methods.
In code bellow I am getting groups using AlfrescoApiService in TaskDetails Component.. and passing it to custom service called dropDownService.
this.taskListService.getTaskDetails(taskId).subscribe( (res: TaskDetailsModel) =>
this.taskDetails = res; this.dropDownService.setTaskAssignee(this.taskDetails.assignee.id);this.alfApi.getInstance().activiti.adminGroupsApi.getGroup(3003, opts2)
.then(grupaMngri => this.dropDownService.setMngGroup(grupaMngri["groups"]); this.alfApi.getInstance().activiti.adminGroupsApi.getGroup(3003, opts2)
.then(grupaMngri => this.dropDownService.setMngGroup(grupaMngri["groups"]);
); });
In dropdown user custom ADF component that extends Widget Component I am getting groups and assignee id from dropDownService and using it to fill dropdown user list according to scenario above
this.taskAssigneeId=this.dropDownService.getTaskAssignee(); this.dropDownService.taskAssignIdUpdate.subscribe( ((id:number)=> this.taskAssigneeId=id) ); let opts = { includeAllUsers: true }; this.mngGroups = this.dropDownService.getMngGroups(); this.dropDownService.mngsUpdated.subscribe( (dDMngs: TempGroup[]) => this.mngGroups = dDMngs); this.mngGroups.forEach(group => { this.alfApi.getInstance().activiti.adminGroupsApi.getGroup(group["id"], opts).then(grupa => { if (grupa["manager"]["id"] === this.taskAssigneeId) { grupa["users"].forEach(user => { let tempUser = new TempUser(user["id"], user["email"]); this.dropDownUsers.push(tempUser); }); };
REST
In order to use rest calls Tried to use AuthenticationService using AuthenticationService.getToken() in order to obtain token in certain ADF components or services but received token is being null. Even if I could get token probably rest call from …/activiti-app/api-explorer.html#/ wouldn't work if user in process that is using ADF does not have tenant capabilities.
So.. question still remains: How to Call APS API from ADF ?
Scenario for process named 'taskAssignProcess':
Tried to use alfrescoApiService:AlfrescoApiService methods (alfrescoApiService.getInstance().activiti.adminGroupsApi, alfrescoApiService.getInstance().activiti.groupsApi..) in order to obtain necessary users and groups according to scenario, but problem is that all involed users need to have high level capability such as Administration of tenant of this group in order this scenario works using alfrescoApiService:AlfrescoApiService methods.
In code bellow I am getting groups using AlfrescoApiService in TaskDetails Component.. and passing it to custom service called dropDownService.
this.taskListService.getTaskDetails(taskId).subscribe( (res: TaskDetailsModel) =>
this.taskDetails = res; this.dropDownService.setTaskAssignee(this.taskDetails.assignee.id);this.alfApi.getInstance().activiti.adminGroupsApi.getGroup(3003, opts2)
.then(grupaMngri => this.dropDownService.setMngGroup(grupaMngri["groups"]); this.alfApi.getInstance().activiti.adminGroupsApi.getGroup(3003, opts2)
.then(grupaMngri => this.dropDownService.setMngGroup(grupaMngri["groups"]);
); });
In dropdown user custom ADF component that extends Widget Component I am getting groups and assignee id from dropDownService and using it to fill dropdown user list according to scenario above
this.taskAssigneeId=this.dropDownService.getTaskAssignee(); this.dropDownService.taskAssignIdUpdate.subscribe( ((id:number)=> this.taskAssigneeId=id) ); let opts = { includeAllUsers: true }; this.mngGroups = this.dropDownService.getMngGroups(); this.dropDownService.mngsUpdated.subscribe( (dDMngs: TempGroup[]) => this.mngGroups = dDMngs); this.mngGroups.forEach(group => { this.alfApi.getInstance().activiti.adminGroupsApi.getGroup(group["id"], opts).then(grupa => { if (grupa["manager"]["id"] === this.taskAssigneeId) { grupa["users"].forEach(user => { let tempUser = new TempUser(user["id"], user["email"]); this.dropDownUsers.push(tempUser); }); };
REST
In order to use rest calls Tried to use AuthenticationService using AuthenticationService.getToken() in order to obtain token in certain ADF components or services but received token is being null. Even if I could get token probably rest call from …/activiti-app/api-explorer.html#/ wouldn't work if user in process that is using ADF does not have tenant capabilities.
So.. question still remains: How to Call APS API from ADF ?
Discussions, help and advice about the Alfresco Development Framework.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.