Adding Project API Class, and anothers classes to handle bpmn layer model
This commit is contained in:
332
workflow/engine/src/ProcessMaker/Adapter/Bpmn/Model.php
Normal file
332
workflow/engine/src/ProcessMaker/Adapter/Bpmn/Model.php
Normal file
File diff suppressed because it is too large
Load Diff
28
workflow/engine/src/ProcessMaker/Adapter/Bpmn/Transform.php
Normal file
28
workflow/engine/src/ProcessMaker/Adapter/Bpmn/Transform.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
namespace ProcessMaker\Adapter\Bpmn;
|
||||
|
||||
use \BpmnProject as Project;
|
||||
use \BpmnProcess as Process;
|
||||
use \BpmnDiagram as Diagram;
|
||||
use \BpmnLaneset as Laneset;
|
||||
use \BpmnLane as Lane;
|
||||
use \BpmnActivity as Activity;
|
||||
use \BpmnBound as Bound;
|
||||
use \BpmnEvent as Event;
|
||||
use \BpmnGateway as Gateway;
|
||||
use \BpmnFlow as Flow;
|
||||
use \BpmnArtifact as Artifact;
|
||||
|
||||
use \ProcessMaker\Util\Hash;
|
||||
use \BasePeer;
|
||||
|
||||
/**
|
||||
* Class Transform
|
||||
*
|
||||
* @package ProcessMaker\Adapter\Bpmn
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
class Transform
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,7 +1,15 @@
|
||||
<?php
|
||||
namespace ProcessMaker\Services;
|
||||
|
||||
class Api
|
||||
/**
|
||||
* Abstract Class Api
|
||||
*
|
||||
* Api class be be extended by Restler Classes
|
||||
*
|
||||
* @package ProcessMaker\Services
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
abstract class Api
|
||||
{
|
||||
private static $workspace;
|
||||
private static $userId;
|
||||
|
||||
68
workflow/engine/src/ProcessMaker/Util/Hash.php
Normal file
68
workflow/engine/src/ProcessMaker/Util/Hash.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
namespace ProcessMaker\Util;
|
||||
|
||||
class Hash
|
||||
{
|
||||
/**
|
||||
* Generate random number
|
||||
*
|
||||
* @author Fernando Ontiveros Lira <fernando@colosa.com>
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public static function generateUID()
|
||||
{
|
||||
do {
|
||||
$sUID = str_replace('.', '0', uniqid(rand(0, 999999999), true));
|
||||
} while (strlen( $sUID ) != 32);
|
||||
|
||||
return $sUID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a numeric or alphanumeric code
|
||||
*
|
||||
* @author Julio Cesar Laura Avendaño <juliocesar@colosa.com>
|
||||
* @access public
|
||||
* @param int $iDigits
|
||||
* @param string $sType
|
||||
* @return string
|
||||
*/
|
||||
public function generateCode($iDigits = 4, $sType = 'NUMERIC')
|
||||
{
|
||||
if (($iDigits < 4) || ($iDigits > 50)) {
|
||||
$iDigits = 4;
|
||||
}
|
||||
if (($sType != 'NUMERIC') && ($sType != 'ALPHA') && ($sType != 'ALPHANUMERIC')) {
|
||||
$sType = 'NUMERIC';
|
||||
}
|
||||
|
||||
$aValidCharacters = array(
|
||||
'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H',
|
||||
'I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'
|
||||
);
|
||||
|
||||
switch ($sType) {
|
||||
case 'NUMERIC':
|
||||
$iMin = 0;
|
||||
$iMax = 9;
|
||||
break;
|
||||
case 'ALPHA':
|
||||
$iMin = 10;
|
||||
$iMax = 35;
|
||||
break;
|
||||
case 'ALPHANUMERIC':
|
||||
$iMin = 0;
|
||||
$iMax = 35;
|
||||
break;
|
||||
}
|
||||
|
||||
$sCode = '';
|
||||
for ($i = 0; $i < $iDigits; $i ++) {
|
||||
$sCode .= $aValidCharacters[rand($iMin, $iMax)];
|
||||
}
|
||||
|
||||
return $sCode;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\Util;
|
||||
|
||||
/**
|
||||
* Singleton Class Logger
|
||||
*
|
||||
* This Utility is usefull to log local messages
|
||||
* @package ProcessMaker\Util
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
class Logger
|
||||
{
|
||||
private static $instance;
|
||||
|
||||
Reference in New Issue
Block a user