This topic is locked

Multiple workflows in a single PHPRunner application (version 2)

4/9/2020 5:31:15 AM
PHPRunner Tips and Tricks
fhumanes author

The information of version 1 can be found in this article.
I have finished encoding this version. I have not received any suggestions from any user because I have not received any. The only one I received a long time ago was to put all the product in English and that is what I have done.
I have incorporated quite a few changes from the previous version, usually to simplify both the data model and the use of the solution.
There is a part that has become quite complex, and that is multi-language. Not only is the application in English and Spanish, but the contents of tables and catalogs (not all) are in both languages, with the possibility of extending them to more languages.
On a technical level, it is similar to the previous version. It is Mysql and PHP, storing the Word and Excel files in "filesystem". To build Word and Excel documents I have used the PHPOffice libraries (you can check them on GITHUB).
What is this solution?
It is a solution of multiple workflows carried out in PHPRunner. The fact of being multiple is because normally when the mechanization of processes of a department or company is undertaken, there are usually several processes that are managed in that unit and for functionality, it is better that in an application they are managed all of them. If the processes were many and very different, this solution would not work and it would be necessary to divide them into groups of similar processes.
For what could it be used?
The application uses the state change management workflow technique. In other words, a file always has a single state and depending on that state it may transit (process) to one or more others, by the group of users who have access to it.
For this (simple) form of workflow, and taking into account that its main potential is the creation of documents (Word and Excel) and its document management, the application is valid for:
Management of administrative procedures of any public administration.

Management of HR processes of any company.

Process management of a medium / large IT department, for the management of job requests between Units.

Any simple process that involves several Units and where it requires documentary management (documents that are received and / or generated)
What security management is used?
Generally uses the access control system of PHPRunner, but also uses an additional and complementary security system, for each of the mechanized processes. This management is by groups or user profiles, based on accesses in the status of the file.
Explanations of the application interface


(1) .- When you identify yourself in the application you have to indicate which Process you want to work with. Also, at any time you can change Process through this menu option.
(2) .- For those users who can create new expedient, this option appears and from there they go to the form that allows them to register a new expedient.
(3) .- In this option you can consult the expedient that are in the system.
(4) .- In this option, you will be presented graphically with the logic of states and transitions between them, which the Process contemplates.
(5) .- It is the submenu where all the process parameterization tables and their document templates and code to produce the documents are.
(6) .- This submenu of access control to the Process and user management.
(7) .- It is the submenu of the catalog tables management, where they are in multi-language and the application configuration.
Being in the "expedient tray" query, it shows:
(8) .- Shows the Expedient that the connected user will be able to process. The process ends if the File changes status.
(9) .- Shows the Expedient created by the connected user. This is important for, for example, managing HR and quickly consulting how my file is going.
(10) .- Shows all the Active Expedient, that is, those that have not yet reached the final stage of the Process.
(11) .- Shows all the Expedient regardless of the states.
(12) .- The system has a set of alarms that you can put in each Expedient, for example, to remember how long you can expect additional documentation or administrative deadlines. The system uses that information in those 2 columns (Active Alarms and Urgent Alarms). Active informs that there is an alarm that is in force and urgent that at least one active alarm has expired on its date and requires immediate action. If the file has an urgent alarm, the expedient code turns red.


(1) .- Once a Expedient has been selected from the “Expedient Tray”, this option appears, showing the information of the selected Expedient and what we can do with said Expedient.
(2) .- The procedures that, depending on the state and the user connected, can be performed will appear in the Procedures submenu.
(3) .- The Utilities that the user can make also appear. These Utilities are actions that do not depend on the status of the File, but depend exclusively on the profile of the connected user. They can be actions that only affect the selected Expedient or another set of Expedients.
(4) .- It is general information of the selected Expedient with which we have chosen to work.
(5) .- Shows the actions that can be done (viewing, editing) and also the number of complementary information records. There are at least 3 additional information.

  • The Alerts (6).
  • The associated Documents (7).
  • Log or Audit of all the actions (procedures and profits) that have been made (8).


In the Flowchart option, the application builds a graph (1) using the state change diagram technique where it shows all the states of the Process and the Procedures that can be done.
At the bottom (2) shows the groups or profiles that can carry out each of the procedures.
What examples of Procedures have you performed?
So that you can see that it is a multi-workflow product I have put 2 examples:

  • EX01 - Settlement of Travel Expenses
  • EX04- Payroll advance request.
    [size="5"]The most complete example, because it has developed Word and Excel documents is EX04[/size]
    [size="4"]DEMO:[/size] https://fhumanes.com/workflow2/
    The users in the demo are (the login and password are the same):
    admin.- System administrator

    user1.- General user

    user2.- General user

    boss1.- Chief user of user1 and user2

    rrhh1.- HR user.

    accounting1.- Accounting User
    Testing access controls in this type of solution is complex, so it is possible that a problem may appear that you have to solve.
    How to incorporate another Process?
    Very important, you have to have assessed whether this solution can mechanize said Process and for this you have to see if it is one of the types that have been described or write fernandohumanes@gmail.com, to advise you.
    The data you have to have are:

  • Flowchart of the process. I use the free Bizagi Modeler tool.


  • The documents that must be obtained in the processing.
  • The information (data) that we are going to have to extend the data model and for this it is necessary to know the basic data of the File.
    Having this, the first thing we have to do is:
  • Create and register all the names of States, Procedures and Utilities, in the languages that we have (option of super catalogs). Similar to how EX04 and EX01 are


  • Give a code to the Process and register it in the parameters submenu.
  • Give you the values for the numbering of the Files of this Process.
  • Authorize the user "admin" to the new process.


  • Enter all the parameters of the new Process.


  • Open the project with PHPRunner, to generate the basic forms of the new Process.


We copy the views of the Process that most resembles and identify them with the code of the new Process.

  • These views are personalized with what the new Process requires.
    [size="4"]As it can be a bit complex at first, for those who want me to create a version for you with 2 Processes that you will have to pass the information to me, I will make the transformation and send it to you by email.[/size]
  • It is checked if all the parameters are complete by viewing the flowchart that the system generates through the menu option.
  • When the process is already working, then we start preparing documents in the process.


The report / document can be Word or Excel and can always have 3 files:

  • The Word or Excel template. required
  • The PHP code to make the document (file with txt extension). required
  • The condition PHP code. This is used for cases where depending on some value of File you have to use different templates. Not required.


As always, you can ask me any questions through fernandohumanes@gmail.com and I leave the codes on my portal so that you can install it on your computers.

fhumanes author 4/12/2020

Hello:
Thanks to Henk Hermsen for letting me know of a mistake.
"Fatal error: Uncaught Error: Class 'EditiPhoneCheckbox' not found"
By mistake, use a phone number validation plugin.
The change is in the "expedient_tray" view, change the "CodeExpedient" field to "edit" to be a field of type "text".
The project is already corrected and can be downloaded from my portal.
Cheers,
Fernando