More Bpmn/Workflow handling layer refactoring and improve unit tests
This commit is contained in:
@@ -27,20 +27,11 @@ use \BpmnArtifactPeer as ArtifactPeer;
|
||||
|
||||
use \BasePeer;
|
||||
|
||||
use ProcessMaker\Project\ProjectHandler;
|
||||
use ProcessMaker\Util\Hash;
|
||||
use ProcessMaker\Exception;
|
||||
|
||||
class BpmnProject //extends ProjectHandler
|
||||
class Bpmn extends Handler
|
||||
{
|
||||
protected static $diagramElements = array(
|
||||
'activities' => 'act_uid',
|
||||
'events' => 'evn_uid',
|
||||
'flows' => 'flo_uid',
|
||||
'artifacts' => 'art_uid',
|
||||
'laneset' => 'lns_uid',
|
||||
'lanes' => 'lan_uid'
|
||||
);
|
||||
|
||||
/**
|
||||
* @var \BpmnProject
|
||||
*/
|
||||
@@ -68,13 +59,13 @@ class BpmnProject //extends ProjectHandler
|
||||
|
||||
public static function load($prjUid)
|
||||
{
|
||||
$me = new self();
|
||||
$project = ProjectPeer::retrieveByPK($prjUid);
|
||||
|
||||
if (! is_object($project)) {
|
||||
return null;
|
||||
throw new Exception\ProjectNotFound($me, $prjUid);
|
||||
}
|
||||
|
||||
$me = new BpmnProject();
|
||||
$me->project = $project;
|
||||
$me->prjUid = $me->project->getPrjUid();
|
||||
|
||||
@@ -82,7 +73,7 @@ class BpmnProject //extends ProjectHandler
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|null $data optional array attributes to create and initialize a BpmnProject
|
||||
* @param array| $data array attributes to create and initialize a BpmnProject
|
||||
*/
|
||||
public function create($data)
|
||||
{
|
||||
@@ -3,11 +3,17 @@ namespace ProcessMaker\Project;
|
||||
|
||||
use ProcessMaker\Util\Logger;
|
||||
|
||||
abstract class ProjectHandler //implements ProjectHandlerInterface
|
||||
abstract class Handler
|
||||
{
|
||||
public abstract function save();
|
||||
public abstract function update();
|
||||
public abstract function delete();
|
||||
public static function load($uid)
|
||||
{ // This method must be implemented on children classes, this is not declared abstract since PHP 5.3.x
|
||||
// don't allow any more static abstract methods.
|
||||
return null;
|
||||
}
|
||||
|
||||
public abstract function create($data);
|
||||
//public abstract function update();
|
||||
public abstract function remove();
|
||||
|
||||
/**
|
||||
* Log in ProcessMaker Standard Output if debug mode is enabled.
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
namespace ProcessMaker\Project;
|
||||
|
||||
interface ProjectHandlerInterface
|
||||
{
|
||||
public function save();
|
||||
public function update();
|
||||
public function delete();
|
||||
public static function load();
|
||||
}
|
||||
530
workflow/engine/src/ProcessMaker/Project/Workflow.php
Normal file
530
workflow/engine/src/ProcessMaker/Project/Workflow.php
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user