Top 10 Features To Lessen Code Written in ProcessMaker

Conditional Editor

One of the most frequent features I see being requested since we moved from 2.x to 3.x is the conditional editor. I always thought that it wasn't really used, but boy was I wrong! I am now asked almost on every call for this feature.

There are two types of conditional editors that I am asked for, I will list them in order of popularity:

  1. Logical Conditional Editor
  2. Role Based Conditional Editor

Logical Conditional Editor

Provide a GUI for a Process Architect to be able to define logic for fields on the form being shown or hidden.

For example, a Process Architect may wish to show and mark required, a zipcode text box if the value in the country dropdown is equal to "United States". If the value is not equal to "United States", he will want to remove the required mark and hide the box.

This is a simple example, but we should be able to support complex criteria sets.

For further reference, please see the conditional editor that we have for 2.x: http://wiki.processmaker.com/index.php/2.5.X/DynaForms#Defining_a_Condition

Role Based Conditional Editor

Provide a GUI for a Process Architect to be able to define field level security based on users roles and/or permissions. The users roles/permissions would determine whether or not they are able to access and/or view a specific field on the form.

For example, a Process Architect may wish to show the approval field to any user, so that they can see what the outcome of a decision was, but only allow the user with the supervisor permission in their role to edit the field.

This is a simple example, but we should be able to support complex criteria sets such as multiple roles and multiple permissions with nested permissions.

This has not been implemented in the past in ProcessMaker, but it is something I am seeing being requested more every day.

Data First - Entity Modeling

Provide a GUI for creating data entities and using them within a process and across multiple processes.

So, say for example, someone were to build a workflow system that would handle deliveries of prescription medications and other medical devices. The workflow itself is about approvals and form submissions and requests as well as integrating with the point of delivery systems and erps etc
However, there would need to be a patient data model that all workflows would use and have access to.
There would need to also be a prescription data model. A patient would have many types of different prescriptions and many prescriptions would be associated to many different patients.
There would be nurses and caregivers as well as physician data models. These would all need to be related and correlated to the patients and prescriptions.
Each data model would need to have a GUI to build it out in the system and tie it to other data models to create the relationships.
Each data model would need different types of attributes and objects or even nested attributes and objects. Each data model could be completely different to another one.
Once the model entity is created and defined, it would need to be published via the REST API and accessible just any other endpoint in the system. For each object and property of a data model, an HTTP method would need to be created etc
These data models would not be tied any individual process or workflow, rather, it would be at a system/global level, accessible via any process or workflow or no process or workflow at all, for that matter!
We should be able to kick off workflows directly from the entity itself, and when done so, it automatically can pull in the data from the entity directly into the case.
So, let's take an example:
James Johnson wants to retire. So, he submits an application that he is 68 and wants to get his pension and retire.
This looks up to the Client entity where James already exists and creates a new record in the associated record to Client: Retiree. It automatically sets the status of Retiree.status = applied.
This also creates a workflow for him to be approved. After the workflow is completed, James is approved for pension.
Two weeks later, based on business rules and algorithms, it is determined that James Johnson is actually 58 and not 68 and therefore not eligible for pension.
This can then kick off another workflow for a human to review this mistake and make any corrections.
Two weeks later, Finance might start a workflow to make sure that James Johnson has reimbursed the pension fund for anything that he may have received until the error was caught and corrected.
Maybe a month later, James Johnson may want to open up a brokerage account with the same firm. He would still be related to the same record of Client. When the broker evaluates his application, the broker will also be able to see that James Johnson has over 3 million dollars in his retirement fund and will take this into account with how he deals with James Johnson as well as any potential funds he will offer him.
I think this is what data-first really means. This would open the door to true case management.
Today, there is no way for ProcessMaker to do this. Sure, we can use PM tables, but it's very techy and no easy way to define relationships other than understanding normalization and using primary keys and foreign keys.
When we do this through professional services, we quote custom development for creating "management interfaces" for this type of data management.
For example, one project (mdp), we quoted over 500 hours for a series of these "management interfaces".
There are already technologies and platforms that do this very well out in the market. Many of them are open source. One I have come across in the past is parse.com. It has been shut down, but it is owned by Facebook and has been open sourced, including it's SDKs which come in a variety of flavors ranging from javascript to php etc

Send an Email with an Attachment

In order to attach an input or output document to an email in ProcessMaker, a custom trigger is required with custom code.

It would be extremely helpful for an end user to not have to program this and be able to configure this from a user interface.

For reference, below is one such trigger that generates the output document and then sends it in an email attachment.


// User From
$userUid=@@USER_LOGGED;
$userUids = userInfo($userUid);
$emailFrom = $userUids['mail'];
//@@approverName = $userUids['firstname']." ".$userUids['lastname'];
//@@approvalDate = date("Y-m-d h:i:sa");

// User next assigned
$taskId = '68107740658582cfe067061041584808';
$aUser = PMFGetNextAssignedUser(@@APPLICATION, $taskId);
$app = @@APPLICATION;
$to = $aUser['USR_EMAIL'];
$from = 'no-reply@processmaker.com';
$subject = @@subject;
$aFields['user_name'] = $aUser['USR_FIRSTNAME']." ".$aUser['USR_LASTNAME'];
$aFields['body']= @@message;
// Generate Output document
$docId = '96355443458597fa6a2ff06048585959'; //output document unique ID
PMFGenerateOutputDocument($docId);
/************ Output Welcome Letter ***********/
$aAttachFiles = array();
$caseId = @@APPLICATION; //Unique ID for the current case
//change for the Output Document definition's unique ID:
$outDocDef = "96355443458597fa6a2ff06048585959";
$outDocQuery = "SELECT AD.APP_DOC_UID, AD.DOC_VERSION, C.CON_VALUE AS FILENAME 
FROM APP_DOCUMENT AD, CONTENT C 
WHERE AD.APP_UID='$caseId' AND AD.DOC_UID='$outDocDef' AND 
AD.APP_DOC_STATUS='ACTIVE' AND AD.DOC_VERSION = (
SELECT MAX(DOC_VERSION) FROM APP_DOCUMENT WHERE APP_UID='$caseId' AND 
DOC_UID='$outDocDef' AND APP_DOC_STATUS='ACTIVE')
AND AD.APP_DOC_UID = C.CON_ID AND C.CON_CATEGORY = 'APP_DOC_FILENAME'";
$outDoc = executeQuery($outDocQuery);
if (is_array($outDoc) and count(outDoc) > 0) {
$path = PATH_DOCUMENT . $caseId . PATH_SEP . 'outdocs'. PATH_SEP . 
$outDoc[1]['APP_DOC_UID'] . '_' . $outDoc[1]['DOC_VERSION'];
$filename = $outDoc[1]['FILENAME'];

$app_string=@@APPLICATION;
$a = substr($app_string, 0, 3);
$b = substr($app_string, 3, 3);
$c = substr($app_string, 6, 3);
$d = substr($app_string, 9);

$path = PATH_DOCUMENT."$a/$b/$c/$d/".'outdocs/'. $outDoc[1]['APP_DOC_UID'] . '_' . $outDoc[1]['DOC_VERSION'];

$aAttachFiles[$filename . '.pdf'] = $path . '.pdf';
}

// Send the email with the approval attached
PMFSendMessage($app, $from, $to, $cEmailFrom, '', $subject, 'notificationApp.html', $aFields, $aAttachFiles);