Translate the article in Google translate.
____
[size="4"]
Workflow[/size]
Introduction.
First of all, indicate that if this example / product is for someone is because the receiver knows and enjoys PHPRunner .
Although execution is performed in PHP and MySQL, is not a solution for anyone wanting a workflow for that platform operating as the design and construction are highly adapted to the functionality of said product, PHPRunner .
Also, in order to understand what I try to express in this text is necessary to know the operating philosophy product philosophy is not going to explain in this article and can be obtained from the copious information available to the manufacturer on its website.
In this latest version I used PHPRunner 9.8 where the manufacturer has incorporated many new features and especially the PHP runtime version 7.1 can be
Workflow design objectives
The workflow used in this solution is a very simple solution, but powerful, based on a layout state change and the transition from one state to another is done through which I called "process".
Although my professional life, has mainly been linked to a company of the Spanish government, I think this type of solution is valid for any company that processes are described and run it through workflows with concepts of records, statements, procedures and users.
The solution has these basic principles that strongly condition:
It is for users of the product PHPRunner.
You must manage the generation of Word documents in your DOCX format.
Must be able to store and manage DOCS document, PDF and other format required.
Multiflow or should be managed in the same product multiple workflows so users only need to connect to a single application.
Procedures should appear and will only allow execution if the user is authorized.
Users group will have different performance depending on the type of record.
The system will have a management "Alerts" to remember situations requiring user action to date.
technical solution applied.
Later will detail how they have "achieved" these goals. Now I will explain some of the technical solutions that have been used.
For generating DOCX or PDF documents you will use Jasper Reports Server , in its free or opensource version. The integration was done using the REST interface incorporating this solution for PHP, so that the documents to produce, as the reports are desired, they are very powerful and high quality. This integration ,, itself may be valid for anyone wanting to incorporate PHPRunner a tool very powerful and inexpensive reports. Normally we do not use this type of product to make reports, I much prefer the solution to integrate PHPExcel and produce reports in XLSX format.
To use Jasper Reports Server must not be a specialist in J2EE, which is what this solution is constructed. Nothing more than follow the standard installation instructions and then install the solution iReports to define reports. There is a lot of information and examples for using this product basic form.
To manage file I used in the example the simplest solution, ie, store files in BLOB fields in tables. You can easily spend the solution to store them in file system or any other product of documentary archive.
For signing and verification of digitally signed documents, I have not incorporated any solution. In Spain it is provided-for AGE (General State Administration) - @signature that allows users to sign and verify signed documents, either PDF or any other format, so that complexity is not the application is incorporated if not users will use the solution they like. What is the solution if it incorporates a document in the file may have one or more files, these may be different or self in its various states of processing.
All types of records will have a set of basic data that will be shared in all basic tables. This does not deny that for each type of record there specific forms for each of them, both high and editing them.
The basic model tables are:

For each type of file, you can extend the data model with specific tables of this type in the manner explained in the following drawing.

It is observed that these extensions can be level or type of record each of the instances of record.
One of the problems I have not been able to solve the access management that incorporates PHPRunner are dependencies that a user can or can not access a type of record "ClaveExpedientes" and yes to others, so I have defined a data structure which manages these dependencies and through functionality PHPRunner these restrictions that already have integrated the solution.
Tables to support this model of access management are:

Here you can see several concepts that should explain.
Each type of records has a set of access groups. A user can belong or not these groups and can belong to several groups.
In the definition of access group will report available if this group who may or not to register cases of records or even edit them.
Records formalities are the actions of transience from one state to another of the various states the type of record. The state sets what steps can be executed in that case docket. Also, the state determines which access groups will be able to perform these procedures.
There is the concept of utility. A utility is an action on the case file that does not depend on status. To run this "utility" it must be associated with a group that the user has access.
Users will always work with a single type of record. What always be able to do is change file type from one to another that have been assigned. When accessing the application will do with the last type of record with whom they have worked.
Aspects of presentation and interface.
We used one of the Bootstrap templates that brings PHPRunner and has been customized to allow this:

We will see that head out the title of the record type with which we are working at that time.
The application menu remains on the left edge and contextual menu options to the user. Some options according to the security definitions that have as PHPRunner model and other-those that have Icons- according to the type of record with whom we are working, the user connected to the case docket and we have selected.
Other aspects of the interface are completely open to the possibilities of PHPRunner and what the facility / company requires.
Also, note that in the query file cases that can treat the user has used the functionality of flaps for records that can be processed by the user and connected state and all cases of these records. This is customizable through PHPRunner.

In the figure it shows that the code file is red because there is an expired alert. Remember that an alert is a "message" that beats a date which tells us to do an action on that file. For example, waiting for a reply within 20 working days of the request for such documentation.
Security and interface
To facilitate maintenance and reuse code has created a set of functions to be implemented in the various events in PHPRunner can add code. Normally it used session variables to store, maintain and use the information provided in the functions
Some of the features are:
CargaListaUtilidad (). Stored in $ _SESSION [ 'CodigoUtilidades'] utilities type of file that the user can use.
CargaListaTramites () . Stored in $ _SESSION [ 'CodigoTramites'] procedures that can perform the user in this case Docket previously selected.
InsertLogTramites ($ values, $ OldValues). To add a new LOG process to be executed.
InsertLogUtilidades ($ values, $ OldValues). To add a new LOG procedural or utility is executed.
EstadosSiguientes ($ CodigoTramite) . This feature makes the set of states that this case file may be based on its current state. Typically used for the user to decide by selecting state, what state wants to take the record being processed.
MiraListados ($ idtramite). Currently the documents generated by the system are automatically made when you execute a procedure. That is, depending on the performance of a processing system generates documents that are associated with that process. Remember that the documents obtained by running reports in Jasper Reports Server requesting them through REST commands. The document formats are all allowing Jasper Reports Server.
ControlAccesos (). This function is used in the codes of procedures or utilities to verify that whoever is running has permission to do so. As does PHPRunner, if anyone knows or is left with a URL and run outside the control of the application, it is not allows execution.
DarNumeroExpediente (). It is a simple function that is customizable, to assign a new case number or case file in the system.
DarNumeroDocumento (). Like the above is a custom feature to assign a new document number system.
ControlAccesoAlExpte (). Using the variables $ _SESSION [ 'PuedeDarAltaExpte'], $ _SESSION [ 'PuedeDarEditaExpte'] and $ _SESSION [ 'PuedeDarVerExpte'] inform the system whether the user can execute these actions on the type of file that is selected.
They insist they are functions are basic and can be customized for each facility or company.
The application can be seen in http://fhumanes.es/workflow/ with the admin/admin user.
The data model in MySQL Workbench and PHPRunner project can download it from these links -are in ZIP format for compatibility in navegadores-.