Files
luos/workflow/engine/methods/install/autoinstallProcesses.php

31 lines
793 B
PHP
Raw Normal View History

2010-12-02 23:34:41 +00:00
<?php
2017-08-15 08:06:44 -04:00
2017-08-15 09:02:35 -04:00
use ProcessMaker\Core\Installer;
2017-08-15 08:06:44 -04:00
$inst = new Installer();
$oProcess = new Processes();
//Get Available autoinstall process
$availableProcess = $inst->getDirectoryFiles( PATH_OUTTRUNK . "autoinstall", "pm" );
$path = PATH_OUTTRUNK . "autoinstall" . PATH_SEP;
$message = "";
foreach ($availableProcess as $processfile) {
$oData = $oProcess->getProcessData( $path . $processfile );
$Fields['PRO_FILENAME'] = $processfile;
2010-12-02 23:34:41 +00:00
$Fields['IMPORT_OPTION'] = 2;
$sProUid = $oData->process['PRO_UID'];
if ($oProcess->processExists( $sProUid )) {
$message .= "$processfile - Not imported (process exist)<br>";
2010-12-02 23:34:41 +00:00
} else {
$oProcess->createProcessFromData( $oData, $path . $processfile );
$message .= "$processfile - OK<br>";
}
}
2010-12-02 23:34:41 +00:00
echo $message;
2010-12-02 23:34:41 +00:00