Skip to content
Snippets Groups Projects
Commit f4fae9f8 authored by S.Listl's avatar S.Listl
Browse files

1055717 - Workflow processes documentation

parent b54ad904
No related branches found
No related tags found
No related merge requests found
Showing
with 64 additions and 21 deletions
......@@ -3,6 +3,7 @@
<name>CreateActivity_workflowService</name>
<title>Create activity</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/process/CreateActivity_workflowService/documentation.adoc</documentation>
<process>%aditoprj%/process/CreateActivity_workflowService/process.js</process>
<alias>Data_alias</alias>
<variants>
......
= CreateActivity_workflowService
The service task can be used to create a new activity with the given parameter data.
\ No newline at end of file
......@@ -3,6 +3,7 @@
<name>CreateNotification_workflowService</name>
<title>Create notification</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/process/CreateNotification_workflowService/documentation.adoc</documentation>
<process>%aditoprj%/process/CreateNotification_workflowService/process.js</process>
<variants>
<element>WORKFLOW</element>
......
= CreateNotification_workflowService
This service task creates a notification for the given user with the given title and description.
\ No newline at end of file
......@@ -3,6 +3,7 @@
<name>SendEmail_workflowService</name>
<title>Send email</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/process/SendEmail_workflowService/documentation.adoc</documentation>
<process>%aditoprj%/process/SendEmail_workflowService/process.js</process>
<variants>
<element>WORKFLOW</element>
......
= SendEmail_workflowService
A service task for sending an email from the server to the configured recipient using a document template.
\ No newline at end of file
......@@ -3,6 +3,7 @@
<name>SetAttribute_workflowService</name>
<title>Set attribute</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/process/SetAttribute_workflowService/documentation.adoc</documentation>
<process>%aditoprj%/process/SetAttribute_workflowService/process.js</process>
<alias>Data_alias</alias>
<variants>
......
= SetAttribute_workflowService
Can be used to create a new attributeRelation.
\ No newline at end of file
......@@ -3,6 +3,7 @@
<name>UpdateOffer_workflowService</name>
<title>Update offer</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/process/UpdateOffer_workflowService/documentation.adoc</documentation>
<process>%aditoprj%/process/UpdateOffer_workflowService/process.js</process>
<alias>Data_alias</alias>
<variants>
......
= UpdateOffer_workflowService
Sets the status of an offer.
\ No newline at end of file
= workflowRoles_rest
This webservice provides a list of the user roles for the workflow modeler application, the roles can be filtered by setting the correct headers.
\ No newline at end of file
......@@ -3,21 +3,22 @@ import("system.tools");
function restget (pRequest)
{
let request = JSON.parse(pRequest);
let header = request.header;
let roleIds = header.Ids && JSON.parse(header.Ids);
let userId = header.Userid;
var request = JSON.parse(pRequest);
var header = request.header;
var roleIds = header.Ids && JSON.parse(header.Ids);
var userId = header.Userid;
if (userId)
{
//if a userId is present, get only the roles of that user
let user = tools.getUserByAttribute(tools.NAME, userId);
roleIds = user ? user[tools.ROLENAMES].slice() : [];
}
let roles = tools.getAllRoles([tools.ROLE_PROJECT, tools.ROLE_CUSTOM], false);
var roles = tools.getAllRoles([tools.ROLE_PROJECT, tools.ROLE_CUSTOM], false);
roles = Object.keys(roles).map(function (role)
{
let [title, type, desc, id] = roles[role];
var [title, type, desc, id] = roles[role];
return {
name : title,
id : id,
......@@ -25,7 +26,8 @@ function restget (pRequest)
};
});
let filter = {
//object for handling filtering
var filter = {
EQUAL : "equal",
IGNORECASE : "ignoreCase",
IN : "in",
......@@ -67,13 +69,14 @@ function restget (pRequest)
}
};
//add the filters of the request to the filter object
filter.addIfSet("id", header.Id, filter.EQUAL);
filter.addIfSet("id", roleIds, filter.IN);
filter.addIfSet("name", header.Name, filter.EQUAL);
filter.addIfSet("name", header.Namelike, filter.LIKE);
filter.addIfSet("name", header.Namelikeignorecase, filter.LIKEIGNORECASE);
roles = roles.filter(filter.check, filter);
roles = roles.filter(filter.check, filter); //do the filtering
request.response.body = JSON.stringify(roles);
......
......@@ -2,6 +2,7 @@
<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1">
<name>workflowRoles_rest</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/process/workflowRoles_rest/documentation.adoc</documentation>
<process>%aditoprj%/process/workflowRoles_rest/process.js</process>
<publishAsWebservice v="true" />
<style>REST</style>
......
= workflowServiceTaskParams_rest
The webservice takes the service task name as header and gives back the parameters of that service task that can be used to configure it in the modeler.
\ No newline at end of file
......@@ -2,6 +2,7 @@
<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1">
<name>workflowServiceTaskParams_rest</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/process/workflowServiceTaskParams_rest/documentation.adoc</documentation>
<process>%aditoprj%/process/workflowServiceTaskParams_rest/process.js</process>
<publishAsWebservice v="true" />
<style>REST</style>
......
= workflowServiceTasks_rest
Provides a list of service tasks for the workflow modeler.
\ No newline at end of file
......@@ -4,9 +4,9 @@ import("system.process");
function restget (pRequest)
{
let request = JSON.parse(pRequest);
var request = JSON.parse(pRequest);
let serviceTasks = project.getDataModels(project.DATAMODEL_KIND_PROCESS)
var serviceTasks = project.getDataModels(project.DATAMODEL_KIND_PROCESS)
.filter(function (row)
{
return /.+_workflowService$/.test(row[0]);
......
......@@ -2,6 +2,7 @@
<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1">
<name>workflowServiceTasks_rest</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/process/workflowServiceTasks_rest/documentation.adoc</documentation>
<process>%aditoprj%/process/workflowServiceTasks_rest/process.js</process>
<publishAsWebservice v="true" />
<style>REST</style>
......
= workflowUsers_rest
This webservice is used by the identity management in the workflow modeler so that users can be assigned to user tasks there.
\ No newline at end of file
......@@ -10,14 +10,14 @@ function restget (pRequest)
//minimum required length of the search pattern
const MIN_SEARCHLENGTH = 0;
let request = JSON.parse(pRequest);
let header = request.header;
let userFilter = header.Userfilter
var request = JSON.parse(pRequest);
var header = request.header;
var userFilter = header.Userfilter
? JSON.parse(header.Userfilter)
: {};
//object that helps with filtering, it provides functions for adding conditions to the object and for checking the conditions
let filter = {
var filter = {
EQUAL : "equal",
IGNORECASE : "ignoreCase",
IN : "in",
......@@ -64,6 +64,7 @@ function restget (pRequest)
}
};
//put all filters of the request into the filter object
filter.addIfSet("id", userFilter.id, filter.EQUAL);
filter.addIfSet("id", userFilter.ids && JSON.parse(userFilter.ids), filter.IN);
filter.addIfSet("id", userFilter.idIgnoreCase, filter.IGNORECASE);
......@@ -87,17 +88,21 @@ function restget (pRequest)
return JSON.stringify(request);
/**
* Loads the users depending on the filter and search value. There is an own parameter for the search value, because it is not handled the
* same way as the other filters.
*/
function _getUsers (pSearch)
{
//empty result if the search value does not have the minimal required length
if (pSearch !== undefined && pSearch.trim() < MIN_SEARCHLENGTH)
return [];
//separate words by spaces
let patterns = pSearch && text.replaceAll(pSearch, {"%" : ""}).toUpperCase().split(/\s/).filter(function (pat) {return pat;})
//if the search value contains spaces, it will be split into individual words, every word must be found
var patterns = pSearch && text.replaceAll(pSearch, {"%" : ""}).toUpperCase().split(/\s/).filter(function (pat) {return pat;})
let allUsers = tools.getUsersByAttribute(tools.ISACTIVE, ["true"], tools.PROFILE_DEFAULT);
let resultUsers = [];
var allUsers = tools.getUsersByAttribute(tools.ISACTIVE, ["true"], tools.PROFILE_DEFAULT);
var resultUsers = [];
for (let i = 0, l = allUsers.length; i < l; i++)
{
......@@ -119,7 +124,7 @@ function restget (pRequest)
privileges : [],
searchRating : rating
};
if (filter.check(user) && rating !== 0)
if (rating !== 0 && filter.check(user))
resultUsers.push(user);
}
......@@ -133,7 +138,7 @@ function restget (pRequest)
}
/**
* checks if the pattern is contained in the name
* Checks if the patterns are contained in the name and how good the result is.
*
* @return {Number} higher number -> better result, 0 if no match
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment