drafting specification docs

This commit is contained in:
Dennis Eichhorn 2022-03-28 21:27:25 +02:00
parent 242ba08457
commit 06c7709042
6 changed files with 583 additions and 48 deletions

View File

@ -1,3 +1,4 @@
# Developer Content
* [Specification]({%}&page=Dev/specification)
* [Structure]({%}&page=Dev/structure)

View File

@ -1,60 +1,158 @@
# Specification
```json
## Files
A workflow relies on some mandatory files which must be provided when creating a workflow. Additionally, workflows may provide optional files to enhance the user experience and provide additional functionality. The following names are reserved file names and must not be used for other purposes. Apart from these file names you may create and upload any template, helper or model files to create a workflow suitable to your needs.
### Controllers & Models (mandatory)
* WorkflowController.php
* WorkflowInstance.php
* WorkflowInstanceMapper.php
#### WorkflowController.php
The **WorkflowController.php** file must implement the **WorkflowControllerInterface** class. This file is mostly responsible to perform all actions associated with the workflow. Some of the functionality which would normally be implemented in this controller file are:
* Creating and updating workflow instances
* Performing workflow specific actions
* Displaying workflow information through templates (see below)
* Exporting and importing data from and to workflows
##### WorkflowControllerInterface
```php
interface WorkflowControllerInterface
{
"steps": [
{
"name": "step-name",
"event-name": "unique-event-name-generated-on-upload",
"type": 1,
"template": "visual-template",
"users": [],
"groups": [],
"event-listeners": [
"event-to-listen-for-1"
"event-to-listen-for-2"
],
"pre": {
"event-trigger": [
"event-to-trigger-1"
"event-to-trigger-2"
],
"script": [
"script-to-run-1"
"script-to-run-2"
]
},
"post": {
"event-trigger": [
"event-to-trigger-1"
"event-to-trigger-2"
],
"script": [
"script-to-run-1"
"script-to-run-2"
]
}
},
{
....
}
]
/**
* Create instance from request
*
* @param RequestAbstract $request Request
*
* @return WorkflowInstanceAbstract
*
* @since 1.0.0
*/
public function createInstanceFromRequest(RequestAbstract $request) : WorkflowInstanceAbstract;
/**
* Create list of all instances for this workflow from a request
*
* @param RequestAbstract $request Request
*
* @return array
*
* @since 1.0.0
*/
public function getInstanceListFromRequest(RequestAbstract $request) : array;
/**
* Change workflow instance state
*
* @param RequestAbstract $request Request
*
* @return WorkflowInstanceAbstract
*
* @since 1.0.0
*/
public function apiChangeState(RequestAbstract $request, ResponseAbstract $response, $data = null) : void;
/**
* Store instance model in the database
*
* @param WorkflowInstanceAbstract $instance Instance
*
* @return void
*
* @since 1.0.0
*/
public function createInstanceDbModel(WorkflowInstanceAbstract $instance) : void;
}
```
Good synergy with job module required... job runs every x and might invoke a workflow/workflow-step
#### WorkflowInstance.php
## Type
The **WorkflowInstance.php** file hast to extend the **WorkflowInstanceAbstract.php** file. The workflow instance should contain most if not all of the information associated with a specific workflow instance. Since workflow data is highly dependent on the type of workflow every workflow must implement its own workflow instance model.
* 1 = Autorun after previous event
* 2 = Only if event listener is called
> Additional models may be useful depending on the workflow structure.
Every step receives the status code of all steps + the custom data created from the previous steps
#### WorkflowInstanceMapper.php
After every step the handler writes custom data to the workflow run information.
The **WorkflowInstanceMapper.php** file has to extend the **DataMapperFactory.php** file. This file is responsible for reading, creating, updating and deleting a workflow instance in the database. If data needs to be stored in a database the workflow also must provide a **db.json** file (see below) which creates the database tables for the workflow.
This means every workflow has a configuration and whenever a new workflow get's triggered a new "workflow entry" is created.
> Additional mappers may be necessary if additional models are defined for the workflow.
## Template
### Routes & Hooks (mandatory)
e.g. user interface for this step
* Hooks.php
* Routes.php
Both the hooks file and the routes file follow the same implementation guidelines as for modules. However the hooks and routes files for workflows will only be loaded when handling workflow actions.
### Database (optional but often necessary)
* db.json
The **db.json** file foollows the same implementation guidelines as for modules. This file is used to setup the database tables associated with the workflow (e.g. instance table).
Tables must follow the format `workflow_{workflow_id}_yourtablename` where `{workflow_id}` will be automatically replaced with the workflow id during the workflow setup process.
### Language file (optional but recommended)
* lang.php
Instead of using a fixed localization it is recommended to create a **lang.php** file which contains all the localizations. Even if only one localization is initially used this is the recommended way because it makes it very easy to extend to additional languages later on if necessary.
Format (example):
```php
<?php
declare(strict_types=1);
return [
'en' => [
'Identifier' => 'Translation in English',
],
'de' => [
'Identifier' => 'Translation in German',
],
'it' => [
'Identifier' => 'Translation in Italian',
],
];
```
### Template files (optional but often recommended)
* instance-create.tpl.php
* instance-list.tpl.php
* instance-profile.tpl.php
* template-profile.tpl.php
#### instance-create.tpl.php
The **instance-create.tpl.php** is used to display a form which can be used to create a new workflow instance.
#### instance-list.tpl.php
The **instance-list.tpl.php** is used to show all instances of a workflow in a list.
#### instance-profile.tpl.php
The **instance-profile.tpl.php** is used to show the workflow instance with all its information (e.g. state, status, user data, ...). Additionally, this template may also contain user input options.
#### template-profile.tpl.php
The **template-profile.tpl.php** file may contain the workflow information for the admin, settings options for the workflow, file editor and more to manage the workflow.
### Export files (optional)
* Excel: *.xls.php / *.xlsx.php
* Word: *.doc.php / *.docx.php
* Powerpoint: *.ppt.php / *.pptx.php
* Pdf: *.pdf.php
* Json: *.json.php
* Csv: *.csv.php
The export files can be used to export workflow instance information in different layouts.

View File

@ -2,4 +2,8 @@
## ER
![ER](Modules/Workflow/Docs/Dev/img/er.png)
![ER](Modules/Workflow/Docs/Dev/img/er.png)
## Call graph
![Call graph](Modules/Workflow/Docs/Dev/img/workflow_execution_path.drawio.svg)

View File

@ -0,0 +1,397 @@
<svg host="65bd71144e" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="805px" height="571px" viewBox="-0.5 -0.5 805 571" content="&lt;mxfile&gt;&lt;diagram id=&quot;lAG8qWWMxqnCsTKCQktL&quot; name=&quot;Page-1&quot;&gt;3VvbcuI4EP0aqmYfMuWbDH4kBGamardqajNbmX0UWGBVhOWVTcD79SvZkm8yAQzYO8kDkduyabVOt7qPxMiebQ9fGIyCP6iPyMgy/MPIfhpZlmkbHv8nJGkumZh2Ltgw7MtOpeAZ/4uk0JDSHfZRXOuYUEoSHNWFKxqGaJXUZJAxuq93W1NS/9YIbpAmeF5BoktfsJ8EchTAKOVfEd4E6ptNQ97ZQtVZCuIA+nRfEdnzkT1jlCZ5a3uYISKMp+ySP7c4crdQjKEwOesBK3/iDZKdHJxULEnVaJHPBy8vKUsCuqEhJPNS+hgkW8JvmryJyDIbzxtiCeYWE6IDTn5ykfEZyKu/VWfefhKoMNRFKi/0ccihxXTHVlIxqWoC2QYVps5lQufKc3LwXxDdooSlvANDBCb4rT6hUOJiU/QrTccb0nrtltQNOf3+TWAQim5NkxLCsSpMtw9wgp4jmI1pz92lbs6jdhD2RYd3hyjvOibIH5HOZkvo7UvkjqUoqIBWya6xieNehq6QhujM8VdxAHQcOGAoHABtyDOChSZvYgj8f+hHFIumS7iyj0vGWxvR+jT1tzjkXXjA3HF7CNdd8M9phGc0TBglBLHfNAP2gCDPqCHIdHUImVYLhtwbYEjF/DtjaKxjyBsKQuMjEJpGEeExNcE0HAAFxaxLFPD1rkcU6G51DxR4LSuKMxQMPG3IcxlDAhj6BIcb3jwWNDhihg0atj0gXBy7F7iobKO28lhD4UVpUxn0D4Y3G8Ritf7EmhVYQLfLXdxLJmKOG+sI0NeRSQsiJrdAhO5N7yKiS6J7HmacFsxMBsOMo5nlT/SQlLChvIm5FcoMZkAAAaMRU8Z6TLkXgMCFeUinSokH7DQrldSFqJRk3SQuy2Ipu7qoWjJdHXgq/t4OePLR73mKW2SQjYlz7MaM5ErJpxqTUqhxHqL1muOFstc14cYus/CA0lexelZu/d8W0CLzTRs27GMBBRfmW9fwAooJqGD9Sl7A0JEObp7GHUH65ATSc0VvgXSrLSLlRWUcwVCVlQsc+gI1EukiqHPwrgKhExN4X9Jd1iOh4iNApZvkL+N6VN836ArQDCS2118KYVuX+UTHpFK9tRan7aESBEsf9DRMq+Hy0zTCF8fHNSZkRgllWW/bNaBnjoWch9yKfJ39CUDzQPyKKnesp7FrvBsRLoi0Jwmyu8VZW8/Z74IpuwVTg1Fkll6daVXsh0NVr6SZNekHVi3Mq2KvBoCVnrPosOJp3bWwMpfQRNYlsDIMdz5d3AVWxcrWS7Tqh4ttI2OHY2Nb6Ni2quHDIcsx+wxYOj1TMfK82DP5eGYGTo9mdnS65x4OrDjQWgE2lP8qZU6USXM+g2lZ+hhYFEoruhP25zVSWtRG2pqyx0lWTGVN4q8gE9VUzjCcWUGJCgz50sQ9cPMNaqHX3MQZvwu500xCQZKVvFhGHZwgye52DMFpyYIGS4JcvaD4K85ZrXK/uWJ795+dOGuShcKHODtpM+UdTCs6ZONX9xV2i53I1kn8HS4RqU8XJHgT8vaKmxDxcPqoGKCpvLHFvp/NMUP8++Eye58wfhbyM1OAxxF4kkrK00CmVUyPhvvi4I982aigSqozmePwqI88GJ8NoOhxlWzlV1dSRG7d9+qP0/U6RtcyQ8pNO7tYB2aucEtzdBF37cM4KEJfq9e0OODNabsxaERE7zzaTn9RY5fcVjvXJ5juKWMwrXST4D+ucPNMhme8r5fXrlcJslyDzpDTV9kFJGQJV695RNl1jUJaCHpB0QcJQa4xOhGCTAO0houucFdvse8QdRy9/l5QtufpULH/rGc+PXLH7oDbz8DUht4pIl+SvHTdoVa70bVTMO5QCY3TRmVdkb631e6/XgbvOnUs93q6BngDgLlr1t/RCUDLMQ0wmBMAvW6v4PgH2kb8C+X6CrcCbvknl3wL4wSGfFgXciY3AClogLTfHWz9HAD3d7xO6zEAF+bhtslsOOAK5RgNbsi62wrFL8tfGeSLfflbDXv+Hw==&lt;/diagram&gt;&lt;/mxfile&gt;">
<defs/>
<g>
<path d="M 425 70 L 425 85 Q 425 95 415 95 L 195 95 Q 185 95 185 104.32 L 185 113.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 185 118.88 L 181.5 111.88 L 185 113.63 L 188.5 111.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<ellipse cx="425" cy="35" rx="35" ry="35" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 68px; height: 1px; padding-top: 35px; margin-left: 391px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
API call
</div>
</div>
</div>
</foreignObject>
<text x="425" y="39" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
API call
</text>
</switch>
</g>
<path d="M 585 160 L 638.63 160" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 643.88 160 L 636.88 163.5 L 638.63 160 L 636.88 156.5 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<rect x="465" y="130" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 160px; margin-left: 466px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
Cli event endpoint
<br/>
(Admin Module / ApiController)
</div>
</div>
</div>
</foreignObject>
<text x="525" y="164" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
Cli event endpoint...
</text>
</switch>
</g>
<path d="M 255 285 L 298.63 285" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 303.88 285 L 296.88 288.5 L 298.63 285 L 296.88 281.5 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<rect x="135" y="255" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 285px; margin-left: 136px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
Cli Application
</div>
</div>
</div>
</foreignObject>
<text x="195" y="289" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
Cli Application
</text>
</switch>
</g>
<path d="M 425 285 L 468.63 285" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 473.88 285 L 466.88 288.5 L 468.63 285 L 466.88 281.5 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<rect x="305" y="255" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 285px; margin-left: 306px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
Event handling (Admin Module / CliController)
</div>
</div>
</div>
</foreignObject>
<text x="365" y="289" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
Event handling (Admi...
</text>
</switch>
</g>
<path d="M 225 160 L 278.63 160" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 283.88 160 L 276.88 163.5 L 278.63 160 L 276.88 156.5 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<path d="M 185 120 L 225 160 L 185 200 L 145 160 Z" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 78px; height: 1px; padding-top: 160px; margin-left: 146px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
Triggers events
</div>
</div>
</div>
</foreignObject>
<text x="185" y="164" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
Triggers even...
</text>
</switch>
</g>
<path d="M 555 285 L 608.63 285" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 613.88 285 L 606.88 288.5 L 608.63 285 L 606.88 281.5 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<path d="M 515 245 L 555 285 L 515 325 L 475 285 Z" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 78px; height: 1px; padding-top: 285px; margin-left: 476px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
Re-triggers original event
</div>
</div>
</div>
</foreignObject>
<text x="515" y="289" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
Re-triggers o...
</text>
</switch>
</g>
<path d="M 305 400 L 368.63 400" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 373.88 400 L 366.88 403.5 L 368.63 400 L 366.88 396.5 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<rect x="185" y="370" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 400px; margin-left: 186px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
Workflow event hook (Workflow Module / CliController)
</div>
</div>
</div>
</foreignObject>
<text x="245" y="404" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
Workflow event hook...
</text>
</switch>
</g>
<path d="M 455 400 L 508.63 400" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 513.88 400 L 506.88 403.5 L 508.63 400 L 506.88 396.5 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<path d="M 415 360 L 455 400 L 415 440 L 375 400 Z" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 78px; height: 1px; padding-top: 400px; margin-left: 376px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
<span>
Find workflows which are bound to the event
</span>
</div>
</div>
</div>
</foreignObject>
<text x="415" y="404" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
Find workflow...
</text>
</switch>
</g>
<path d="M 60 60 L 60 123.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 60 128.88 L 56.5 121.88 L 60 123.63 L 63.5 121.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<rect x="0" y="0" width="120" height="60" fill="#60a917" stroke="#2d7600" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 30px; margin-left: 1px;">
<div data-drawio-colors="color: #ffffff; " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(255, 255, 255); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
Any Module (Api)
</div>
</div>
</div>
</foreignObject>
<text x="60" y="34" fill="#ffffff" font-family="Helvetica" font-size="12px" text-anchor="middle">
Any Module (Api)
</text>
</switch>
</g>
<path d="M 60 190 L 60 243.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 60 248.88 L 56.5 241.88 L 60 243.63 L 63.5 241.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<rect x="0" y="130" width="120" height="60" fill="#60a917" stroke="#2d7600" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 160px; margin-left: 1px;">
<div data-drawio-colors="color: #ffffff; " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(255, 255, 255); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
Admin Module (Api)
</div>
</div>
</div>
</foreignObject>
<text x="60" y="164" fill="#ffffff" font-family="Helvetica" font-size="12px" text-anchor="middle">
Admin Module (Api)
</text>
</switch>
</g>
<path d="M 60 310 L 60 373.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 60 378.88 L 56.5 371.88 L 60 373.63 L 63.5 371.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<rect x="0" y="250" width="120" height="60" fill="#1ba1e2" stroke="#006eaf" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 280px; margin-left: 1px;">
<div data-drawio-colors="color: #ffffff; " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(255, 255, 255); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
Admin Module (Cli)
</div>
</div>
</div>
</foreignObject>
<text x="60" y="284" fill="#ffffff" font-family="Helvetica" font-size="12px" text-anchor="middle">
Admin Module (Cli)
</text>
</switch>
</g>
<path d="M 60 440 L 60 503.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 60 508.88 L 56.5 501.88 L 60 503.63 L 63.5 501.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<rect x="0" y="380" width="120" height="60" fill="#1ba1e2" stroke="#006eaf" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 410px; margin-left: 1px;">
<div data-drawio-colors="color: #ffffff; " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(255, 255, 255); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
Workflow Module (Cli)
</div>
</div>
</div>
</foreignObject>
<text x="60" y="414" fill="#ffffff" font-family="Helvetica" font-size="12px" text-anchor="middle">
Workflow Module (Cli)
</text>
</switch>
</g>
<rect x="0" y="510" width="120" height="60" fill="#1ba1e2" stroke="#006eaf" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 540px; margin-left: 1px;">
<div data-drawio-colors="color: #ffffff; " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(255, 255, 255); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
Workflow Endpoint (Cli)
</div>
</div>
</div>
</foreignObject>
<text x="60" y="544" fill="#ffffff" font-family="Helvetica" font-size="12px" text-anchor="middle">
Workflow Endpoint (C...
</text>
</switch>
</g>
<path d="M 405 160 L 458.63 160" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 463.88 160 L 456.88 163.5 L 458.63 160 L 456.88 156.5 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<rect x="285" y="130" width="120" height="60" rx="9" ry="9" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 160px; margin-left: 286px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
<span>
Every event is cought by the Admin Module with a wildcard hook
</span>
</div>
</div>
</div>
</foreignObject>
<text x="345" y="164" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
Every event is cough...
</text>
</switch>
</g>
<path d="M 685 200 L 685 217.5 Q 685 227.5 675 227.5 L 205 227.5 Q 195 227.5 195 237.5 L 195 248.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 195 253.88 L 191.5 246.88 L 195 248.63 L 198.5 246.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 231px; margin-left: 461px;">
<div data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;">
Use
<br style="font-size: 12px"/>
Cli App
</div>
</div>
</div>
</foreignObject>
<text x="461" y="235" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
Use...
</text>
</switch>
</g>
<path d="M 725 160 L 755 160 Q 765 160 765 170 L 765 275 Q 765 285 755 285 L 741.37 285" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" stroke-dasharray="3 3" pointer-events="stroke"/>
<path d="M 736.12 285 L 743.12 281.5 L 741.37 285 L 743.12 288.5 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 221px; margin-left: 767px;">
<div data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;">
Fallback: use
<br style="font-size: 12px"/>
Wep App
</div>
</div>
</div>
</foreignObject>
<text x="767" y="224" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
Fallback: use...
</text>
</switch>
</g>
<path d="M 685 120 L 725 160 L 685 200 L 645 160 Z" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 78px; height: 1px; padding-top: 160px; margin-left: 646px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
Forwards event
</div>
</div>
</div>
</foreignObject>
<text x="685" y="164" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
Forwards event
</text>
</switch>
</g>
<path d="M 675 315 L 675 332.5 Q 675 342.5 665 342.5 L 255 342.5 Q 245 342.5 245 352.5 L 245 363.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 245 368.88 L 241.5 361.88 L 245 363.63 L 248.5 361.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<rect x="615" y="255" width="120" height="60" rx="9" ry="9" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 285px; margin-left: 616px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
<span>
Every event is cought by the Workflow Module with a wildcard hook
</span>
</div>
</div>
</div>
</foreignObject>
<text x="675" y="289" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
Every event is cough...
</text>
</switch>
</g>
<path d="M 575 430 L 575 450 Q 575 460 565 460 L 430 460 Q 420 460 420 470 L 420 483.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/>
<path d="M 420 488.88 L 416.5 481.88 L 420 483.63 L 423.5 481.88 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<rect x="515" y="370" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 400px; margin-left: 516px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
Workflow Template &amp; Instance
</div>
</div>
</div>
</foreignObject>
<text x="575" y="404" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
Workflow Template &amp;...
</text>
</switch>
</g>
<path d="M 420 490 L 460 530 L 420 570 L 380 530 Z" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/>
<g transform="translate(-0.5 -0.5)">
<switch>
<foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;">
<div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 78px; height: 1px; padding-top: 530px; margin-left: 381px;">
<div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;">
<div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">
Modify Workflow instance state
</div>
</div>
</div>
</foreignObject>
<text x="420" y="534" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">
Modify Workfl...
</text>
</switch>
</g>
</g>
<switch>
<g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/>
<a transform="translate(0,-5)" xlink:href="https://www.diagrams.net/doc/faq/svg-export-text-problems" target="_blank">
<text text-anchor="middle" font-size="10px" x="50%" y="100%">
Viewer does not support full SVG 1.1
</text>
</a>
</switch>
</svg>

After

Width:  |  Height:  |  Size: 35 KiB

2
Docs/Help/en/SUMMARY.md Normal file
View File

@ -0,0 +1,2 @@
# User Content

View File

@ -0,0 +1,33 @@
# Introduction
The **Workflow** module allows organizations to automize and structure internal processes and guidelines. With workflows it's essentially possible to extend and modify how the application behaves based on the companies needs. Examples for workflows can be approval processes, step-by-step instructions which must be followed and many more.
## Target Group
The target group for this module is every organization which would like to create organization specific workflows/processes. The implementation of such workflows requires programming knowledge in PHP and potentially JavaScript. Other modules may provide their own example workflows which provide a good starting point and may be useful with minor configuration adjustments.
# Requirements
Workflows need to check many user actions and see if any workflows are linked to these user actions. This process is slow because of the large amount of potnetial user actions. In order to avoid the application slowing down it is recommended to run these checks asynchrounisly. However for this to be possible the application must have permissions to execute and run the cli application which is not possible on all server environments (e.g. simple web servers).
By default the application will test during the installation process if the Cli application can be executed from within the web application.
> Make sure you add the php.exe path to the environment variables on Windows!
# Setup
This module doesn't have any additional setup requirements since it is installed during the application install process.
# Features
## Permission Management
It's possible to only give selected users and groups access to certain workflows.
## Input handling
The workflows can be created in a way which allows UI interaction by the user, automatic modification through actions within the application and it's also possible to allow workflows to handle uploaded user data.
## Localization
The module allows users to create workflows which also support localization.