EazflowReference
Version 3 (Petr Mourek, 07/09/2009 10:09 am)
| 1 | 1 | {{>toc}} |
|
|---|---|---|---|
| 2 | 1 | ||
| 3 | 1 | h1. [[/|Eazflow]] - Developer reference documentation |
|
| 4 | 1 | ||
| 5 | 1 | h2. Overview |
|
| 6 | 1 | ||
| 7 | 1 | h3. Introduction |
|
| 8 | 1 | ||
| 9 | 1 | The workflow is represented by a *_Process_*. During the lifetime of a _Process_, different *_Activities_* are performed on it. When an _Activity_ requests user input, a form is presented to the user. The user enters required data into the form-fields. Form-field values are stored in *_Variables_* of the _Process_. When a particular _Activity_ gets *_finished_*, a *_Transition_* to another _Activity_ is made and the next _Activity_ is *_started_*. |
|
| 10 | 1 | ||
| 11 | 1 | Availability of _Processes_, _Activities, _Variables_ and _Transitions_ to a *_User_* is controlled by *_Access-rights_* with *_Role_*-based rules. There are two types of user _Roles_: *_Global roles_* and *_Instance roles_*. _Users_ authenticate themselves to the system (username/password). Each _User_ has a set of _Global roles_ assigned. In adition to these _Global roles_, a specific local _Instance role_ set can be supplied on each instance of _Process_. This mechanism represents situations where a user has a special position within *some* processes, e.g. the initiator, assigned solver etc. |
|
| 12 | 1 | ||
| 13 | 1 | h3. Definitions and Instances |
|
| 14 | 1 | ||
| 15 | 1 | Main types of entities (process, activity, transition, etc.) occur in definitions and instances. |
|
| 16 | 1 | ||
| 17 | 1 | *_Definition_* entities *describe* the *model* of the given workflow process, all of its possible activities, transitions, variables with their types, validation rules etc. |
|
| 18 | 1 | ||
| 19 | 1 | Typically, the administrators will instantiate new definition entities when adding a new process definition, or introducing an activity step to an already defined process. The developers may implement new definition entity classes to provide new variable types like e.g. a PDF report. |
|
| 20 | 1 | ||
| 21 | 1 | *_Instance_* entities *represent* individual process instances, performed activities and transitions and actual variable values as they are carried out. |
|
| 22 | 1 | ||
| 23 | 1 | Typically, the users will (mostly without realizing it) instantiate new instance entities when starting a new process, or following a transition to enter a new activity. |
|
| 24 | 1 | ||
| 25 | 1 | h2. Internals |
|
| 26 | 1 | ||
| 27 | 1 | h3. Main entities (domain classes) |
|
| 28 | 1 | ||
| 29 | 1 | h4. Process-definition classes |
|
| 30 | 1 | ||
| 31 | 2 | Roman Mackovčák | * "DefProcess":/embedded/eazflow/grails-app/domain/DefProcess.html - main process-definition entity class |
| 32 | 2 | Roman Mackovčák | * "DefActivity":/embedded/eazflow/grails-app/domain/DefActivity.html - base class for all activity-definition classes |
| 33 | 2 | Roman Mackovčák | ** "DefAStart":/embedded/eazflow/grails-app/domain/DefAStart.html - first activity type of the process, this type of activity is started by the system when a new process is created |
| 34 | 2 | Roman Mackovčák | ** "DefAUserAction":/embedded/eazflow/grails-app/domain/DefAUserAction.html - activity type for user interaction - in this type of activity, users are filling in variable-fields and then choosing transition to the next activity |
| 35 | 2 | Roman Mackovčák | ** "DefAFinish":/embedded/eazflow/grails-app/domain/DefAFinish.html - last activity type of the process, process is finished when it reaches this type of activity |
| 36 | 2 | Roman Mackovčák | * "DefTransition":/embedded/eazflow/grails-app/domain/DefTransition.html - defines a possible transition from an activity definition into another |
| 37 | 1 | ||
| 38 | 1 | h4. Variable (type) definition classes |
|
| 39 | 1 | ||
| 40 | 2 | Roman Mackovčák | * "TypeCompositeDef":/embedded/eazflow/grails-app/domain/TypeCompositeDef.html - defines a composite structure consisting of member fields (which may, recursively, also be composite, see below) |
| 41 | 2 | Roman Mackovčák | ** "TypeProcessDef":/embedded/eazflow/grails-app/domain/TypeProcessDef.html - subclass of !TypeCompositeDef, defines a root for the structure of process variables (each !DefProcess has a !TypeProcessDef assigned) |
| 42 | 2 | Roman Mackovčák | * "TypeMember":/embedded/eazflow/grails-app/domain/TypeMember.html - base composite-member class - defines a member field of a composite type (!TypeCompositeDef) |
| 43 | 2 | Roman Mackovčák | ** "TypeString":/embedded/eazflow/grails-app/domain/TypeString.html, "TypeText":/embedded/eazflow/grails-app/domain/TypeText.html, "TypeInteger":/embedded/eazflow/grails-app/domain/TypeInteger.html, "TypeSysuser":/embedded/eazflow/grails-app/domain/TypeSysuser.html, "TypeFormula":/embedded/eazflow/grails-app/domain/TypeFormula.html, ... - classes for definition of composite-member fields of simple type, all type-specific functionality is handled here |
| 44 | 2 | Roman Mackovčák | ** "TypeComposite":/embedded/eazflow/grails-app/domain/TypeComposite.html - defines a composite-member of another composite type (nested structure) |
| 45 | 1 | ||
| 46 | 1 | h4. Process-instance classes |
|
| 47 | 1 | ||
| 48 | 2 | Roman Mackovčák | * "RunProcess":/embedded/eazflow/grails-app/domain/RunProcess.html - main process-instance entity class |
| 49 | 2 | Roman Mackovčák | * "RunActivity":/embedded/eazflow/grails-app/domain/RunActivity.html, "RunAStart":/embedded/eazflow/grails-app/domain/RunAStart.html, "RunAUserAction":/embedded/eazflow/grails-app/domain/RunAUserAction.html, "RunAFinish":/embedded/eazflow/grails-app/domain/RunAFinish.html - classes representing instances of activities, corresponding to DefA... classes |
| 50 | 2 | Roman Mackovčák | * "RunTransition":/embedded/eazflow/grails-app/domain/RunTransition.html - represents a transition made between activities (RunA... instances) according to a DefTransition |
| 51 | 1 | ||
| 52 | 1 | h4. Variable-instance classes |
|
| 53 | 1 | ||
| 54 | 2 | Roman Mackovčák | * "Variable":/embedded/eazflow/src/groovy/Variable.html - acts as an interface for accessing all data-fields |
| 55 | 2 | Roman Mackovčák | * "ValueStorage":/embedded/eazflow/grails-app/domain/ValueStorage.html - stores values of variables |
| 56 | 1 | ||
| 57 | 1 | h4. Authentication & authorization (users, roles, access rights) |
|
| 58 | 1 | ||
| 59 | 3 | Petr Mourek | * "User":/embedded/eazflow/grails-app/domain/User.html - represents a user which can log-in to the system; a user may have roles (!RoleGlobal) assigned |
| 60 | 2 | Roman Mackovčák | * "RoleGlobal":/embedded/eazflow/grails-app/domain/RoleGlobal.html - global roles are assigned to users in the system globally (e.g. _system.administrator_, _company.director_), typically by the administrator |
| 61 | 2 | Roman Mackovčák | * "RoleInstance":/embedded/eazflow/grails-app/domain/RoleInstance.html - instance roles are assigned per process-instance (e.g. _process.author_, _process.supervisor_), typically automatically by the system based on some process variable values |
| 62 | 1 | ||
| 63 | 2 | Roman Mackovčák | * "ProcessRoleUser":/embedded/eazflow/grails-app/domain/ProcessRoleUser.html - a materialized relation which assigns (for a particular process) an instance role directly to a user (e.g. for some process instance, user _u1_ has the instance role _process.author_) |
| 64 | 2 | Roman Mackovčák | * "ProcessRoleGlobal":/embedded/eazflow/grails-app/domain/ProcessRoleGlobal.html - a materialized relation which assigns (for a particular process) an instance role to a global role (e.g. all users having the global role _company.director_ have for some process the instance role _process.supervisor_) |
| 65 | 1 | ||
| 66 | 2 | Roman Mackovčák | * "AccessRightDefProcess":/embedded/eazflow/grails-app/domain/AccessRight.html - access to process-definitions (NONE/EXECUTE)- who can start which processes |
| 67 | 2 | Roman Mackovčák | * "AccessRightProcess":/embedded/eazflow/grails-app/domain/AccessRightProcess.html - access to process-instances (NONE/READONLY/WRITABLE) |
| 68 | 2 | Roman Mackovčák | * "AccessRightActivity":/embedded/eazflow/grails-app/domain/AccessRightActivity.html - access to process per activity (NONE/READONLY/WRITABLE/DELETE) |
| 69 | 2 | Roman Mackovčák | * "AccessRightTransition":/embedded/eazflow/grails-app/domain/AccessRightActivity.html - access to transitions (NONE/EXECUTE) |
| 70 | 2 | Roman Mackovčák | * "AccessRightVariable":/embedded/eazflow/grails-app/domain/AccessRightVariable.html - access to process variables (NONE/READONLY/WRITABLE/MANDATORY) |
| 71 | 1 | ||
| 72 | 1 | Access in each category is defined by a list of rules consisting of weight, patterns for matching role-code, process-code, activity-code, transition-code, variable-code (the set of codes depends on the category) and the access right (operation allowed). For a particular test, the rule matching all code-patterns and having the greatest weight defines the access right granted. |
|
| 73 | 1 | ||
| 74 | 2 | Roman Mackovčák | * "RenderConfigVariable":/embedded/eazflow/grails-app/domain/RenderConfigVariable.html - in a way similar to the access-right definitions, rendering of process-variables is configured by rules of code-patterns; each rule defines whether the corresponding variable is rendered in the _main_ section (or in the details section only) and whether composite type containing the variable is rendered folded or unfolded |
| 75 | 1 | ||
| 76 | 1 | h3. Services |
|
| 77 | 1 | ||
| 78 | 2 | Roman Mackovčák | * "AuthenticationService":/embedded/eazflow/grails-app/services/AuthenticationService.html - authenticates a user by username and password |
| 79 | 2 | Roman Mackovčák | * "AuthorizationService":/embedded/eazflow/grails-app/services/AuthorizationService.html - access rights-related functionality |
| 80 | 2 | Roman Mackovčák | * "ProcessService":/embedded/eazflow/grails-app/services/ProcessService.html - process creation/deletion, activity creation/startup/finish, etc. |
| 81 | 2 | Roman Mackovčák | * "ValidationService":/embedded/eazflow/grails-app/services/ValidationService.html - validation of process-variables and other validation rules |
| 82 | 2 | Roman Mackovčák | * "RunQueueService":/embedded/eazflow/grails-app/services/RunQueueService.html - processing of queued transitions |
| 83 | 1 | ||
| 84 | 1 | h3. Controllers |
|
| 85 | 1 | ||
| 86 | 2 | Roman Mackovčák | * "WorklistController":/embedded/eazflow/grails-app/controllers/WorklistController.html - all main process-related functionality (list all, list TODO, search, view, edit, etc.) |
| 87 | 2 | Roman Mackovčák | * "UserController":/embedded/eazflow/grails-app/controllers/UserController.html - user login/logout, welcome screen, user preferences setup |
| 88 | 1 | ||
| 89 | 1 | h3. Rendering of variables |
|
| 90 | 1 | ||
| 91 | 1 | The most important part of a process display is the pane with process-variables. The rendering of the variables (i.e. their labels, values, edit-boxes etc.) is performed in the _show_ action of _WorklistController_. Actually, all variables of a process are contained within one structure (tree) defined by TypeProcessDef assigned to the process and all variables are rendered as part of rendering this process-variable-structure. |
|
| 92 | 1 | ||
| 93 | 2 | Roman Mackovčák | Rendering of variables is handled by <eazf:renderNode> and related tags (of the "EazflowTaglib tag library":/embedded/eazflow/grails-app/taglib/EazflowTagLib.html) with the help of templates named _views/Type/_Type....gsp_. |
| 94 | 1 | ||
| 95 | 1 | h4. Variable and rendering logic |
|
| 96 | 1 | ||
| 97 | 1 | Basically, for a _<some_typename>_ type, there is a _Type<some_typename>_ class inheriting from _TypeMember_, which defines the special functionality of the type (type conversion for storage, validation, saving from the submitted form, etc.). Furthermore, there are _views/Type/_Type<some_typename>.gsp_, _views/Type/_Type<some_typename>Label.gsp_ and _views/Type/_Type<some_typename>Body.gsp_ templates, which define the rendering. When a particular template doesn't exist, a template for the superclass is used, so in most cases only the _views/Type/_Type<some_typename>Body.gsp_ template (if any at all) has to be overridden when implementing a new variable type. |
|
| 98 | 1 | ||
| 99 | 1 | Templates present in the main grails-app views directory take precedence over plugin templates, so rendering of plugin-defined types can also be easily customized. |
|
| 100 | 1 | ||
| 101 | 1 | Look into _TypeInteger_ (_grails-app/domain/TypeInteger.groovy_, _views/Type/_TypeIntegerBody.gsp_) and _TypeSysuser_ (_grails-app/domain/TypeSysuser.groovy_, _views/Type/_TypeSysuserBody.gsp_) for examples of how new types should be defined. |