Merge branch 'master' of bitbucket.org:colosa/processmaker into PM-939

This commit is contained in:
Victor Saisa Lopez
2015-02-18 08:28:55 -04:00
8 changed files with 55 additions and 18 deletions

View File

@@ -142,7 +142,6 @@ class Derivation
$arrayNextTask = array();
$arrayNextTaskDefault = array();
$i = 0;
//SELECT *
//FROM APP_DELEGATION AS A
@@ -211,18 +210,17 @@ class Derivation
}
if ($flagContinue) {
$arrayNextTask[++$i] = $this->prepareInformationTask($arrayRouteData);
$arrayNextTask[] = $this->prepareInformationTask($arrayRouteData);
}
}
if (count($arrayNextTask) == 0 && count($arrayNextTaskDefault) > 0) {
$arrayNextTask[++$i] = $this->prepareInformationTask($arrayNextTaskDefault);
$arrayNextTask[] = $this->prepareInformationTask($arrayNextTaskDefault);
}
//Check Task GATEWAYTOGATEWAY
$arrayNextTaskBk = $arrayNextTask;
$arrayNextTask = array();
$i = 0;
foreach ($arrayNextTaskBk as $value) {
$arrayNextTaskData = $value;
@@ -231,16 +229,22 @@ class Derivation
$arrayAux = $this->prepareInformation($arrayData, $arrayNextTaskData["NEXT_TASK"]["TAS_UID"]);
foreach ($arrayAux as $value2) {
$arrayNextTask[++$i] = $value2;
$arrayNextTask[] = $value2;
}
} else {
$arrayNextTask[++$i] = $arrayNextTaskData;
$arrayNextTask[] = $arrayNextTaskData;
}
}
//1. There is no rule
if (count($arrayNextTask) == 0) {
throw new Exception(G::LoadTranslation("ID_NO_DERIVATION_RULE"));
$oProcess = new Process();
$oProcessFieds = $oProcess->Load( $_SESSION['PROCESS'] );
if(isset($oProcessFieds['PRO_BPMN']) && $oProcessFieds['PRO_BPMN'] == 1){
throw new Exception(G::LoadTranslation("ID_NO_DERIVATION_BPMN_RULE"));
}else{
throw new Exception(G::LoadTranslation("ID_NO_DERIVATION_RULE"));
}
}
//Return

View File

@@ -326,6 +326,8 @@ class Process extends BaseProcess
}
$aFields['PRO_DYNAFORMS'] = @unserialize( $aFields['PRO_DYNAFORMS'] );
//Check if is BPMN process
$aFields['PRO_BPMN'] = $this->isBpmnProcess($ProUid);
return $aFields;
} else {
@@ -1009,5 +1011,21 @@ class Process extends BaseProcess
return 0;
}
}
/**
* Check is the Process is BPMN.
*
* @param string $ProUid the uid of the Prolication
* @return int 1 if is BPMN process or 0 if a Normal process
*/
public function isBpmnProcess($proUid){
$c = new Criteria("workflow");
$c->add(BpmnProcessPeer::PRJ_UID, $proUid);
$res = BpmnProcessPeer::doSelect($c);
if( sizeof($res) == 0 ){
return 0;
}else{
return 1;
}
}
}

View File

@@ -81,7 +81,7 @@ class ListParticipatedLastMapBuilder
$tMap->addColumn('APP_TAS_TITLE', 'AppTasTitle', 'string', CreoleTypes::VARCHAR, true, 255);
$tMap->addColumn('APP_STATUS', 'AppStatus', 'string', CreoleTypes::VARCHAR, true, 20);
$tMap->addColumn('APP_STATUS', 'AppStatus', 'string', CreoleTypes::VARCHAR, false, 20);
$tMap->addColumn('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);

View File

@@ -141,7 +141,7 @@ abstract class BaseBpmnFlow extends BaseObject implements Persistent
*/
protected $flo_position = 0;
/**
/**
* @var BpmnProject
*/
protected $aBpmnProject;
@@ -365,7 +365,7 @@ abstract class BaseBpmnFlow extends BaseObject implements Persistent
/**
* Get the [flo_position] column value.
*
*
* @return int
*/
public function getFloPosition()
@@ -374,7 +374,7 @@ abstract class BaseBpmnFlow extends BaseObject implements Persistent
return $this->flo_position;
}
/*
/**
* Set the value of [flo_uid] column.
*
* @param string $v new value
@@ -780,7 +780,7 @@ abstract class BaseBpmnFlow extends BaseObject implements Persistent
/**
* Set the value of [flo_position] column.
*
*
* @param int $v new value
* @return void
*/
@@ -794,9 +794,9 @@ abstract class BaseBpmnFlow extends BaseObject implements Persistent
}
if ($this->flo_position !== $v || $v === 0) {
$this->flo_position = $v;
$this->modifiedColumns[] = BpmnFlowPeer::FLO_POSITION;
}
$this->flo_position = $v;
$this->modifiedColumns[] = BpmnFlowPeer::FLO_POSITION;
}
} // setFloPosition()