I replace the code with a function isBpmnProcess
This commit is contained in:
@@ -240,13 +240,12 @@ class Derivation
|
|||||||
|
|
||||||
//1. There is no rule
|
//1. There is no rule
|
||||||
if (count($arrayNextTask) == 0) {
|
if (count($arrayNextTask) == 0) {
|
||||||
$c = new Criteria("workflow");
|
$oProcess = new Process();
|
||||||
$c->add(BpmnProcessPeer::PRJ_UID, $_SESSION['PROCESS']);
|
$oProcessFieds = $oProcess->Load( $_SESSION['PROCESS'] );
|
||||||
$res = BpmnProcessPeer::doSelect($c);
|
if(isset($oProcessFieds['PRO_BPMN']) && $oProcessFieds['PRO_BPMN'] == 1){
|
||||||
if( sizeof($res) == 0 ){
|
|
||||||
throw new Exception(G::LoadTranslation("ID_NO_DERIVATION_RULE"));
|
|
||||||
}else{
|
|
||||||
throw new Exception(G::LoadTranslation("ID_NO_DERIVATION_BPMN_RULE"));
|
throw new Exception(G::LoadTranslation("ID_NO_DERIVATION_BPMN_RULE"));
|
||||||
|
}else{
|
||||||
|
throw new Exception(G::LoadTranslation("ID_NO_DERIVATION_RULE"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -326,6 +326,8 @@ class Process extends BaseProcess
|
|||||||
}
|
}
|
||||||
|
|
||||||
$aFields['PRO_DYNAFORMS'] = @unserialize( $aFields['PRO_DYNAFORMS'] );
|
$aFields['PRO_DYNAFORMS'] = @unserialize( $aFields['PRO_DYNAFORMS'] );
|
||||||
|
//Check if is BPMN process
|
||||||
|
$aFields['PRO_BPMN'] = $this->isBpmnProcess($ProUid);
|
||||||
|
|
||||||
return $aFields;
|
return $aFields;
|
||||||
} else {
|
} else {
|
||||||
@@ -1009,5 +1011,16 @@ class Process extends BaseProcess
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1020,13 +1020,10 @@ try {
|
|||||||
//Add content content step - End
|
//Add content content step - End
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
//Check if the process is BPMN
|
//Check if the process is BPMN
|
||||||
$c = new Criteria("workflow");
|
if(isset($oProcessFieds['PRO_BPMN']) && $oProcessFieds['PRO_BPMN'] == 1){
|
||||||
$c->add(BpmnProcessPeer::PRJ_UID, $_SESSION['PROCESS']);
|
|
||||||
$res = BpmnProcessPeer::doSelect($c);
|
|
||||||
if( sizeof($res) == 0 ){
|
|
||||||
G::SendTemporalMessage( G::LoadTranslation( 'ID_PROCESS_DEF_PROBLEM' ), 'error', 'string', 3, 100 );
|
|
||||||
}else{
|
|
||||||
G::SendTemporalMessage( G::LoadTranslation( 'ID_BPMN_PROCESS_DEF_PROBLEM' ), 'error', 'string', 3, 100 );
|
G::SendTemporalMessage( G::LoadTranslation( 'ID_BPMN_PROCESS_DEF_PROBLEM' ), 'error', 'string', 3, 100 );
|
||||||
|
}else{
|
||||||
|
G::SendTemporalMessage( G::LoadTranslation( 'ID_PROCESS_DEF_PROBLEM' ), 'error', 'string', 3, 100 );
|
||||||
}
|
}
|
||||||
|
|
||||||
$aMessage = array ();
|
$aMessage = array ();
|
||||||
|
|||||||
Reference in New Issue
Block a user