Merge branch 'master' of bitbucket.org:colosa/processmaker
This commit is contained in:
@@ -32,7 +32,6 @@ if (in_array('--no-ansi', $argv)) {
|
||||
|
||||
$vendorDir = dirname(__FILE__) . DS . 'vendor';
|
||||
|
||||
|
||||
if (! is_dir($vendorDir )) {
|
||||
echo "Vendor directory is missing!" . PHP_EOL;
|
||||
exit();
|
||||
@@ -43,16 +42,38 @@ $projects = array(
|
||||
'colosa/pmUI'
|
||||
);
|
||||
|
||||
out("build-vendor.php", 'purple');
|
||||
|
||||
out("generating files for ", 'purple', false);
|
||||
out( $debug ? 'debug' : 'production', 'success', false);
|
||||
out(" mode", 'purple');
|
||||
|
||||
foreach ($projects as $project) {
|
||||
echo PHP_EOL;
|
||||
out("=> Building project: ", 'info', false);
|
||||
echo $project.' '.PHP_EOL;
|
||||
chdir($vendorDir.DS.$project);
|
||||
if ($debug)
|
||||
echo `rake pmBuildDebug`;
|
||||
else
|
||||
echo `rake pmBuild`;
|
||||
out("Completed!", 'success');
|
||||
if ($debug) {
|
||||
exec ('rake pmBuildDebug', $output, $exitCode );
|
||||
} else {
|
||||
exec ('rake pmBuild', $output, $exitCode );
|
||||
}
|
||||
|
||||
if ($exitCode) {
|
||||
out("$project executed with errors!", 'error');
|
||||
foreach ($output as $line) {
|
||||
print "$line\n";
|
||||
}
|
||||
echo PHP_EOL;
|
||||
die;
|
||||
} else {
|
||||
foreach ($output as $line) {
|
||||
print "$line\n";
|
||||
}
|
||||
out("$project completed", 'success');
|
||||
echo PHP_EOL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo PHP_EOL;
|
||||
@@ -70,8 +91,9 @@ function out($text, $color = null, $newLine = true)
|
||||
{
|
||||
$styles = array(
|
||||
'success' => "\033[0;35;32m%s\033[0m",
|
||||
'error' => "\033[0;35;31m%s\033[0m",
|
||||
'info' => "\033[1;33;34m%s\033[0m"
|
||||
'error' => "\033[0;35;31m%s\033[0m",
|
||||
'purple' => "\033[0;35;35m%s\033[0m",
|
||||
'info' => "\033[1;33;34m%s\033[0m"
|
||||
);
|
||||
|
||||
$format = '%s';
|
||||
@@ -85,4 +107,4 @@ function out($text, $color = null, $newLine = true)
|
||||
}
|
||||
|
||||
printf($format, $text);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ $r = 0;
|
||||
foreach ($dependentFields as $d) {
|
||||
$sendContent[$r] = new stdclass();
|
||||
$sendContent[$r]->name = $d;
|
||||
$sendContent[$r]->content = null;
|
||||
$sendContent[$r]->content = new stdclass();
|
||||
foreach ($G_FORM->fields[$d] as $attribute => $value) {
|
||||
switch ($attribute) {
|
||||
case 'type':
|
||||
@@ -108,7 +108,7 @@ function toJSArray ($array)
|
||||
{
|
||||
$result = array ();
|
||||
foreach ($array as $k => $v) {
|
||||
$o = null;
|
||||
$o = new stdclass();
|
||||
$o->key = $k;
|
||||
$o->value = $v;
|
||||
$result[] = $o;
|
||||
|
||||
@@ -150,26 +150,26 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
|
||||
public function removeGateway($gatUid)
|
||||
{
|
||||
$gatewayData = $this->getGateway($gatUid);
|
||||
$flowsDest = \BpmnFlow::findAllBy(\BpmnFlowPeer::FLO_ELEMENT_DEST, $gatUid);
|
||||
// $gatewayData = $this->getGateway($gatUid);
|
||||
// $flowsDest = \BpmnFlow::findAllBy(\BpmnFlowPeer::FLO_ELEMENT_DEST, $gatUid);
|
||||
|
||||
foreach ($flowsDest as $flowDest) {
|
||||
switch ($flowDest->getFloElementOriginType()) {
|
||||
case "bpmnActivity":
|
||||
$actUid = $flowDest->getFloElementOrigin();
|
||||
$flowsOrigin = \BpmnFlow::findAllBy(\BpmnFlowPeer::FLO_ELEMENT_ORIGIN, $gatUid);
|
||||
|
||||
foreach ($flowsOrigin as $flowOrigin) {
|
||||
switch ($flowOrigin->getFloElementDestType()) {
|
||||
case "bpmnActivity":
|
||||
$toActUid = $flowOrigin->getFloElementDest();
|
||||
$this->wp->removeRouteFromTo($actUid, $toActUid);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
// foreach ($flowsDest as $flowDest) {
|
||||
// switch ($flowDest->getFloElementOriginType()) {
|
||||
// case "bpmnActivity":
|
||||
// $actUid = $flowDest->getFloElementOrigin();
|
||||
// $flowsOrigin = \BpmnFlow::findAllBy(\BpmnFlowPeer::FLO_ELEMENT_ORIGIN, $gatUid);
|
||||
//
|
||||
// foreach ($flowsOrigin as $flowOrigin) {
|
||||
// switch ($flowOrigin->getFloElementDestType()) {
|
||||
// case "bpmnActivity":
|
||||
// $toActUid = $flowOrigin->getFloElementDest();
|
||||
// $this->wp->removeRouteFromTo($actUid, $toActUid);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
parent::removeGateway($gatUid);
|
||||
}
|
||||
@@ -298,6 +298,10 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
\BpmnFlowPeer::FLO_ELEMENT_ORIGIN_TYPE => "bpmnGateway"
|
||||
));
|
||||
|
||||
if ($gatewayFlows > 0) {
|
||||
$this->wp->resetTaskRoutes($activity["ACT_UID"]);
|
||||
}
|
||||
|
||||
foreach ($gatewayFlows as $gatewayFlow) {
|
||||
$gatewayFlow = $gatewayFlow->toArray();
|
||||
|
||||
|
||||
@@ -195,8 +195,8 @@ class Workflow extends Handler
|
||||
{
|
||||
try {
|
||||
self::log("Remove Task: $tasUid");
|
||||
$task = new Task();
|
||||
$task->remove($tasUid);
|
||||
$task = new Tasks();
|
||||
$task->deleteTask($tasUid);
|
||||
self::log("Remove Task Success!");
|
||||
} catch (\Exception $e) {
|
||||
self::log("Exception: ", $e->getMessage(), "Trace: ", $e->getTraceAsString());
|
||||
@@ -275,18 +275,18 @@ class Workflow extends Handler
|
||||
}
|
||||
|
||||
if ($type != 'SEQUENTIAL' && $type != 'SEC-JOIN' && $type != 'DISCRIMINATOR') {
|
||||
if ($this->getNumberOfRoutes($this->proUid, $fromTasUid, $toTasUid, $type) > 0) {
|
||||
throw new \LogicException("Unexpected behaviour");
|
||||
}
|
||||
//if ($this->getNumberOfRoutes($this->proUid, $fromTasUid, $toTasUid, $type) > 0) {
|
||||
//throw new \LogicException("Unexpected behaviour");
|
||||
//}
|
||||
}
|
||||
|
||||
//if ($delete || $type == 'SEQUENTIAL' || $type == 'SEC-JOIN' || $type == 'DISCRIMINATOR') {
|
||||
$oTasks = new Tasks();
|
||||
$oTasks->deleteAllRoutesOfTask($this->proUid, $fromTasUid);
|
||||
//$oTasks = new Tasks();
|
||||
//$oTasks->deleteAllRoutesOfTask($this->proUid, $fromTasUid);
|
||||
//}
|
||||
|
||||
$result = $this->saveNewPattern($this->proUid, $fromTasUid, $toTasUid, $type, $delete);
|
||||
self::log("Add Route Success! -> ", $result);
|
||||
self::log("Add Route Success! - ROU_UID: ", $result);
|
||||
|
||||
return $result;
|
||||
} catch (\Exception $e) {
|
||||
@@ -295,6 +295,12 @@ class Workflow extends Handler
|
||||
}
|
||||
}
|
||||
|
||||
public function resetTaskRoutes($actUid)
|
||||
{
|
||||
$oTasks = new Tasks();
|
||||
$oTasks->deleteAllRoutesOfTask($this->proUid, $actUid);
|
||||
}
|
||||
|
||||
public function updateRoute($rouUid, $routeData)
|
||||
{
|
||||
$routeData['ROU_UID'] = $rouUid;
|
||||
|
||||
@@ -21,7 +21,7 @@ class BpmnWorkflowTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
//return false;
|
||||
return false;
|
||||
//cleaning DB
|
||||
foreach (self::$uids as $prjUid) {
|
||||
$bwap = Project\Adapter\BpmnWorkflow::load($prjUid);
|
||||
@@ -346,37 +346,46 @@ class BpmnWorkflowTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
function testActivityToInclusiveGatewayToActivityFlowsMultiple($bwap)
|
||||
{
|
||||
/*$actUid1 = $bwap->addActivity(array(
|
||||
$actUid1 = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #1",
|
||||
"BOU_X" => 198,
|
||||
"BOU_Y" => 56
|
||||
"BOU_X" => 311,
|
||||
"BOU_Y" => 26
|
||||
));
|
||||
$actUid2 = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #2",
|
||||
"BOU_X" => 198,
|
||||
"BOU_Y" => 250
|
||||
"BOU_X" => 99,
|
||||
"BOU_Y" => 200
|
||||
));
|
||||
$actUid3 = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #3",
|
||||
"BOU_X" => 310,
|
||||
"BOU_Y" => 200
|
||||
));
|
||||
$actUid4 = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #4",
|
||||
"BOU_X" => 542,
|
||||
"BOU_Y" => 200
|
||||
));
|
||||
$gatUid = $bwap->addGateway(array(
|
||||
"GAT_NAME" => "Gateway #1",
|
||||
"GAT_TYPE" => "INCLUSIVE",
|
||||
"GAT_DIRECTION" => "DIVERGING",
|
||||
"BOU_X" => 256,
|
||||
"BOU_Y" => 163
|
||||
"BOU_X" => 369,
|
||||
"BOU_Y" => 123
|
||||
));
|
||||
|
||||
$flowUid1 = $bwap->addFlow(array(
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $actUid1,
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnActivity',
|
||||
'FLO_ELEMENT_DEST' => $gatUid,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnGateway',
|
||||
'FLO_X1' => 273,
|
||||
'FLO_Y1' => 273,
|
||||
'FLO_X2' => 163,
|
||||
'FLO_Y2' => 163,
|
||||
'FLO_X1' => 386,
|
||||
'FLO_Y1' => 174,
|
||||
'FLO_X2' => 206,
|
||||
'FLO_Y2' => 206,
|
||||
));
|
||||
|
||||
$flowUid1 = $bwap->addFlow(array(
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $gatUid,
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnGateway',
|
||||
@@ -387,8 +396,109 @@ class BpmnWorkflowTest extends \PHPUnit_Framework_TestCase
|
||||
'FLO_X2' => 249,
|
||||
'FLO_Y2' => 249,
|
||||
));
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $gatUid,
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnGateway',
|
||||
'FLO_ELEMENT_DEST' => $actUid3,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnActivity',
|
||||
'FLO_X1' => 386,
|
||||
'FLO_Y1' => 174,
|
||||
'FLO_X2' => 206,
|
||||
'FLO_Y2' => 206,
|
||||
));
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $gatUid,
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnGateway',
|
||||
'FLO_ELEMENT_DEST' => $actUid4,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnActivity',
|
||||
'FLO_X1' => 386,
|
||||
'FLO_Y1' => 617,
|
||||
'FLO_X2' => 207,
|
||||
'FLO_Y2' => 207,
|
||||
));
|
||||
|
||||
$bwap->mapBpmnFlowsToWorkflowRoutes();*/
|
||||
$bwap->mapBpmnFlowsToWorkflowRoutes();
|
||||
|
||||
$this->assertCount(4, $bwap->getActivities());
|
||||
$this->assertCount(1, $bwap->getGateways());
|
||||
$this->assertCount(4, $bwap->getFlows());
|
||||
|
||||
$wp = Project\Workflow::load($bwap->getUid());
|
||||
|
||||
$this->assertCount(3, $wp->getRoutes());
|
||||
|
||||
return array($actUid2, $actUid3, $actUid4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @depends testActivityToInclusiveGatewayToActivityFlowsMultiple
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
* @param array $activitiesUid
|
||||
*/
|
||||
function testActivityToInclusiveGatewayToActivityFlowsMultipleJoin($bwap, $activitiesUid)
|
||||
{
|
||||
$gatUid = $bwap->addGateway(array(
|
||||
"GAT_NAME" => "Gateway #2",
|
||||
"GAT_TYPE" => "INCLUSIVE",
|
||||
"GAT_DIRECTION" => "CONVERGING",
|
||||
"BOU_X" => 369,
|
||||
"BOU_Y" => 338
|
||||
));
|
||||
$actUid5 = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #5",
|
||||
"BOU_X" => 312,
|
||||
"BOU_Y" => 464
|
||||
));
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $activitiesUid[0],
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnActivity',
|
||||
'FLO_ELEMENT_DEST' => $gatUid,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnGateway',
|
||||
'FLO_X1' => 174,
|
||||
'FLO_Y1' => 365,
|
||||
'FLO_X2' => 355,
|
||||
'FLO_Y2' => 355,
|
||||
));
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $activitiesUid[1],
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnActivity',
|
||||
'FLO_ELEMENT_DEST' => $gatUid,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnGateway',
|
||||
'FLO_X1' => 385,
|
||||
'FLO_Y1' => 382,
|
||||
'FLO_X2' => 338,
|
||||
'FLO_Y2' => 338,
|
||||
));
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $activitiesUid[2],
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnActivity',
|
||||
'FLO_ELEMENT_DEST' => $gatUid,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnGateway',
|
||||
'FLO_X1' => 617,
|
||||
'FLO_Y1' => 398,
|
||||
'FLO_X2' => 355,
|
||||
'FLO_Y2' => 355,
|
||||
));
|
||||
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $gatUid,
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnGateway',
|
||||
'FLO_ELEMENT_DEST' => $actUid5,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnActivity',
|
||||
'FLO_X1' => 382,
|
||||
'FLO_Y1' => 387,
|
||||
'FLO_X2' => 463,
|
||||
'FLO_Y2' => 463,
|
||||
));
|
||||
|
||||
$bwap->mapBpmnFlowsToWorkflowRoutes();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -69,12 +69,14 @@
|
||||
<script type="text/javascript" src="/js/codemirror/lib/codemirror.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/js/codemirror/lib/codemirror.css"/>
|
||||
<script type="text/javascript" src="/js/codemirror/mode/javascript/javascript.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="/js/codemirror/addon/edit/matchbrackets.js"></script>
|
||||
<script type="text/javascript" src="/js/codemirror/mode/htmlmixed/htmlmixed.js"></script>
|
||||
<script type="text/javascript" src="/js/codemirror/mode/xml/xml.js"></script>
|
||||
<script type="text/javascript" src="/js/codemirror/mode/css/css.js"></script>
|
||||
<script type="text/javascript" src="/js/codemirror/mode/clike/clike.js"></script>
|
||||
<script type="text/javascript" src="/js/codemirror/mode/php/php.js"></script>
|
||||
<!--
|
||||
<link rel="stylesheet" type="text/css" href="/js/codemirror/doc/docs.css"/>
|
||||
|
||||
!-->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user