Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Conditional Editor

...

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

...

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.


Code Block
languagephp
themeMidnight
// 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);