PM-1330 "No se guardan el orden establecido de condiciones de enrutamiento en los gateways" SOLVED
This commit is contained in:
2
workflow/engine/classes/model/BpmnFlow.php
Normal file → Executable file
2
workflow/engine/classes/model/BpmnFlow.php
Normal file → Executable file
@@ -72,7 +72,7 @@ class BpmnFlow extends BaseBpmnFlow
|
|||||||
if (! is_null($prjUid)) {
|
if (! is_null($prjUid)) {
|
||||||
$c->add(BpmnFlowPeer::PRJ_UID, $prjUid, Criteria::EQUAL);
|
$c->add(BpmnFlowPeer::PRJ_UID, $prjUid, Criteria::EQUAL);
|
||||||
}
|
}
|
||||||
|
$c->addAscendingOrderByColumn(BpmnFlowPeer::FLO_POSITION);
|
||||||
$rs = BpmnFlowPeer::doSelectRS($c);
|
$rs = BpmnFlowPeer::doSelectRS($c);
|
||||||
$rs->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
$rs->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||||
|
|
||||||
|
|||||||
2
workflow/engine/classes/model/map/BpmnFlowMapBuilder.php
Normal file → Executable file
2
workflow/engine/classes/model/map/BpmnFlowMapBuilder.php
Normal file → Executable file
@@ -101,6 +101,8 @@ class BpmnFlowMapBuilder
|
|||||||
|
|
||||||
$tMap->addColumn('FLO_STATE', 'FloState', 'string', CreoleTypes::LONGVARCHAR, false, null);
|
$tMap->addColumn('FLO_STATE', 'FloState', 'string', CreoleTypes::LONGVARCHAR, false, null);
|
||||||
|
|
||||||
|
$tMap->addColumn('FLO_POSITION', 'FloPosition', 'int', CreoleTypes::INTEGER, true, null);
|
||||||
|
|
||||||
} // doBuild()
|
} // doBuild()
|
||||||
|
|
||||||
} // BpmnFlowMapBuilder
|
} // BpmnFlowMapBuilder
|
||||||
|
|||||||
60
workflow/engine/classes/model/om/BaseBpmnFlow.php
Normal file → Executable file
60
workflow/engine/classes/model/om/BaseBpmnFlow.php
Normal file → Executable file
@@ -136,6 +136,12 @@ abstract class BaseBpmnFlow extends BaseObject implements Persistent
|
|||||||
protected $flo_state;
|
protected $flo_state;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* The value for the flo_position field.
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
protected $flo_position = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
* @var BpmnProject
|
* @var BpmnProject
|
||||||
*/
|
*/
|
||||||
protected $aBpmnProject;
|
protected $aBpmnProject;
|
||||||
@@ -358,6 +364,17 @@ abstract class BaseBpmnFlow extends BaseObject implements Persistent
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Get the [flo_position] column value.
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getFloPosition()
|
||||||
|
{
|
||||||
|
|
||||||
|
return $this->flo_position;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
* Set the value of [flo_uid] column.
|
* Set the value of [flo_uid] column.
|
||||||
*
|
*
|
||||||
* @param string $v new value
|
* @param string $v new value
|
||||||
@@ -761,6 +778,28 @@ abstract class BaseBpmnFlow extends BaseObject implements Persistent
|
|||||||
|
|
||||||
} // setFloState()
|
} // setFloState()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of [flo_position] column.
|
||||||
|
*
|
||||||
|
* @param int $v new value
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setFloPosition($v)
|
||||||
|
{
|
||||||
|
|
||||||
|
// Since the native PHP type for this column is integer,
|
||||||
|
// we will cast the input value to an int (if it is not).
|
||||||
|
if ($v !== null && !is_int($v) && is_numeric($v)) {
|
||||||
|
$v = (int) $v;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->flo_position !== $v || $v === 0) {
|
||||||
|
$this->flo_position = $v;
|
||||||
|
$this->modifiedColumns[] = BpmnFlowPeer::FLO_POSITION;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // setFloPosition()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hydrates (populates) the object variables with values from the database resultset.
|
* Hydrates (populates) the object variables with values from the database resultset.
|
||||||
*
|
*
|
||||||
@@ -814,12 +853,14 @@ abstract class BaseBpmnFlow extends BaseObject implements Persistent
|
|||||||
|
|
||||||
$this->flo_state = $rs->getString($startcol + 17);
|
$this->flo_state = $rs->getString($startcol + 17);
|
||||||
|
|
||||||
|
$this->flo_position = $rs->getInt($startcol + 18);
|
||||||
|
|
||||||
$this->resetModified();
|
$this->resetModified();
|
||||||
|
|
||||||
$this->setNew(false);
|
$this->setNew(false);
|
||||||
|
|
||||||
// FIXME - using NUM_COLUMNS may be clearer.
|
// FIXME - using NUM_COLUMNS may be clearer.
|
||||||
return $startcol + 18; // 18 = BpmnFlowPeer::NUM_COLUMNS - BpmnFlowPeer::NUM_LAZY_LOAD_COLUMNS).
|
return $startcol + 19; // 19 = BpmnFlowPeer::NUM_COLUMNS - BpmnFlowPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||||
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw new PropelException("Error populating BpmnFlow object", $e);
|
throw new PropelException("Error populating BpmnFlow object", $e);
|
||||||
@@ -1115,6 +1156,9 @@ abstract class BaseBpmnFlow extends BaseObject implements Persistent
|
|||||||
case 17:
|
case 17:
|
||||||
return $this->getFloState();
|
return $this->getFloState();
|
||||||
break;
|
break;
|
||||||
|
case 18:
|
||||||
|
return $this->getFloPosition();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
break;
|
break;
|
||||||
@@ -1153,6 +1197,7 @@ abstract class BaseBpmnFlow extends BaseObject implements Persistent
|
|||||||
$keys[15] => $this->getFloX2(),
|
$keys[15] => $this->getFloX2(),
|
||||||
$keys[16] => $this->getFloY2(),
|
$keys[16] => $this->getFloY2(),
|
||||||
$keys[17] => $this->getFloState(),
|
$keys[17] => $this->getFloState(),
|
||||||
|
$keys[18] => $this->getFloPosition(),
|
||||||
);
|
);
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@@ -1238,6 +1283,9 @@ abstract class BaseBpmnFlow extends BaseObject implements Persistent
|
|||||||
case 17:
|
case 17:
|
||||||
$this->setFloState($value);
|
$this->setFloState($value);
|
||||||
break;
|
break;
|
||||||
|
case 18:
|
||||||
|
$this->setFloPosition($value);
|
||||||
|
break;
|
||||||
} // switch()
|
} // switch()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1333,6 +1381,10 @@ abstract class BaseBpmnFlow extends BaseObject implements Persistent
|
|||||||
$this->setFloState($arr[$keys[17]]);
|
$this->setFloState($arr[$keys[17]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (array_key_exists($keys[18], $arr)) {
|
||||||
|
$this->setFloPosition($arr[$keys[18]]);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1416,6 +1468,10 @@ abstract class BaseBpmnFlow extends BaseObject implements Persistent
|
|||||||
$criteria->add(BpmnFlowPeer::FLO_STATE, $this->flo_state);
|
$criteria->add(BpmnFlowPeer::FLO_STATE, $this->flo_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->isColumnModified(BpmnFlowPeer::FLO_POSITION)) {
|
||||||
|
$criteria->add(BpmnFlowPeer::FLO_POSITION, $this->flo_position);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return $criteria;
|
return $criteria;
|
||||||
}
|
}
|
||||||
@@ -1504,6 +1560,8 @@ abstract class BaseBpmnFlow extends BaseObject implements Persistent
|
|||||||
|
|
||||||
$copyObj->setFloState($this->flo_state);
|
$copyObj->setFloState($this->flo_state);
|
||||||
|
|
||||||
|
$copyObj->setFloPosition($this->flo_position);
|
||||||
|
|
||||||
|
|
||||||
$copyObj->setNew(true);
|
$copyObj->setNew(true);
|
||||||
|
|
||||||
|
|||||||
23
workflow/engine/classes/model/om/BaseBpmnFlowPeer.php
Normal file → Executable file
23
workflow/engine/classes/model/om/BaseBpmnFlowPeer.php
Normal file → Executable file
@@ -25,7 +25,7 @@ abstract class BaseBpmnFlowPeer
|
|||||||
const CLASS_DEFAULT = 'classes.model.BpmnFlow';
|
const CLASS_DEFAULT = 'classes.model.BpmnFlow';
|
||||||
|
|
||||||
/** The total number of columns. */
|
/** The total number of columns. */
|
||||||
const NUM_COLUMNS = 18;
|
const NUM_COLUMNS = 19;
|
||||||
|
|
||||||
/** The number of lazy-loaded columns. */
|
/** The number of lazy-loaded columns. */
|
||||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||||
@@ -85,6 +85,9 @@ abstract class BaseBpmnFlowPeer
|
|||||||
/** the column name for the FLO_STATE field */
|
/** the column name for the FLO_STATE field */
|
||||||
const FLO_STATE = 'BPMN_FLOW.FLO_STATE';
|
const FLO_STATE = 'BPMN_FLOW.FLO_STATE';
|
||||||
|
|
||||||
|
/** the column name for the FLO_POSITION field */
|
||||||
|
const FLO_POSITION = 'BPMN_FLOW.FLO_POSITION';
|
||||||
|
|
||||||
/** The PHP to DB Name Mapping */
|
/** The PHP to DB Name Mapping */
|
||||||
private static $phpNameMap = null;
|
private static $phpNameMap = null;
|
||||||
|
|
||||||
@@ -96,10 +99,10 @@ abstract class BaseBpmnFlowPeer
|
|||||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||||
*/
|
*/
|
||||||
private static $fieldNames = array (
|
private static $fieldNames = array (
|
||||||
BasePeer::TYPE_PHPNAME => array ('FloUid', 'PrjUid', 'DiaUid', 'FloType', 'FloName', 'FloElementOrigin', 'FloElementOriginType', 'FloElementOriginPort', 'FloElementDest', 'FloElementDestType', 'FloElementDestPort', 'FloIsInmediate', 'FloCondition', 'FloX1', 'FloY1', 'FloX2', 'FloY2', 'FloState', ),
|
BasePeer::TYPE_PHPNAME => array ('FloUid', 'PrjUid', 'DiaUid', 'FloType', 'FloName', 'FloElementOrigin', 'FloElementOriginType', 'FloElementOriginPort', 'FloElementDest', 'FloElementDestType', 'FloElementDestPort', 'FloIsInmediate', 'FloCondition', 'FloX1', 'FloY1', 'FloX2', 'FloY2', 'FloState', 'FloPosition', ),
|
||||||
BasePeer::TYPE_COLNAME => array (BpmnFlowPeer::FLO_UID, BpmnFlowPeer::PRJ_UID, BpmnFlowPeer::DIA_UID, BpmnFlowPeer::FLO_TYPE, BpmnFlowPeer::FLO_NAME, BpmnFlowPeer::FLO_ELEMENT_ORIGIN, BpmnFlowPeer::FLO_ELEMENT_ORIGIN_TYPE, BpmnFlowPeer::FLO_ELEMENT_ORIGIN_PORT, BpmnFlowPeer::FLO_ELEMENT_DEST, BpmnFlowPeer::FLO_ELEMENT_DEST_TYPE, BpmnFlowPeer::FLO_ELEMENT_DEST_PORT, BpmnFlowPeer::FLO_IS_INMEDIATE, BpmnFlowPeer::FLO_CONDITION, BpmnFlowPeer::FLO_X1, BpmnFlowPeer::FLO_Y1, BpmnFlowPeer::FLO_X2, BpmnFlowPeer::FLO_Y2, BpmnFlowPeer::FLO_STATE, ),
|
BasePeer::TYPE_COLNAME => array (BpmnFlowPeer::FLO_UID, BpmnFlowPeer::PRJ_UID, BpmnFlowPeer::DIA_UID, BpmnFlowPeer::FLO_TYPE, BpmnFlowPeer::FLO_NAME, BpmnFlowPeer::FLO_ELEMENT_ORIGIN, BpmnFlowPeer::FLO_ELEMENT_ORIGIN_TYPE, BpmnFlowPeer::FLO_ELEMENT_ORIGIN_PORT, BpmnFlowPeer::FLO_ELEMENT_DEST, BpmnFlowPeer::FLO_ELEMENT_DEST_TYPE, BpmnFlowPeer::FLO_ELEMENT_DEST_PORT, BpmnFlowPeer::FLO_IS_INMEDIATE, BpmnFlowPeer::FLO_CONDITION, BpmnFlowPeer::FLO_X1, BpmnFlowPeer::FLO_Y1, BpmnFlowPeer::FLO_X2, BpmnFlowPeer::FLO_Y2, BpmnFlowPeer::FLO_STATE, BpmnFlowPeer::FLO_POSITION, ),
|
||||||
BasePeer::TYPE_FIELDNAME => array ('FLO_UID', 'PRJ_UID', 'DIA_UID', 'FLO_TYPE', 'FLO_NAME', 'FLO_ELEMENT_ORIGIN', 'FLO_ELEMENT_ORIGIN_TYPE', 'FLO_ELEMENT_ORIGIN_PORT', 'FLO_ELEMENT_DEST', 'FLO_ELEMENT_DEST_TYPE', 'FLO_ELEMENT_DEST_PORT', 'FLO_IS_INMEDIATE', 'FLO_CONDITION', 'FLO_X1', 'FLO_Y1', 'FLO_X2', 'FLO_Y2', 'FLO_STATE', ),
|
BasePeer::TYPE_FIELDNAME => array ('FLO_UID', 'PRJ_UID', 'DIA_UID', 'FLO_TYPE', 'FLO_NAME', 'FLO_ELEMENT_ORIGIN', 'FLO_ELEMENT_ORIGIN_TYPE', 'FLO_ELEMENT_ORIGIN_PORT', 'FLO_ELEMENT_DEST', 'FLO_ELEMENT_DEST_TYPE', 'FLO_ELEMENT_DEST_PORT', 'FLO_IS_INMEDIATE', 'FLO_CONDITION', 'FLO_X1', 'FLO_Y1', 'FLO_X2', 'FLO_Y2', 'FLO_STATE', 'FLO_POSITION', ),
|
||||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, )
|
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, )
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -109,10 +112,10 @@ abstract class BaseBpmnFlowPeer
|
|||||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||||
*/
|
*/
|
||||||
private static $fieldKeys = array (
|
private static $fieldKeys = array (
|
||||||
BasePeer::TYPE_PHPNAME => array ('FloUid' => 0, 'PrjUid' => 1, 'DiaUid' => 2, 'FloType' => 3, 'FloName' => 4, 'FloElementOrigin' => 5, 'FloElementOriginType' => 6, 'FloElementOriginPort' => 7, 'FloElementDest' => 8, 'FloElementDestType' => 9, 'FloElementDestPort' => 10, 'FloIsInmediate' => 11, 'FloCondition' => 12, 'FloX1' => 13, 'FloY1' => 14, 'FloX2' => 15, 'FloY2' => 16, 'FloState' => 17, ),
|
BasePeer::TYPE_PHPNAME => array ('FloUid' => 0, 'PrjUid' => 1, 'DiaUid' => 2, 'FloType' => 3, 'FloName' => 4, 'FloElementOrigin' => 5, 'FloElementOriginType' => 6, 'FloElementOriginPort' => 7, 'FloElementDest' => 8, 'FloElementDestType' => 9, 'FloElementDestPort' => 10, 'FloIsInmediate' => 11, 'FloCondition' => 12, 'FloX1' => 13, 'FloY1' => 14, 'FloX2' => 15, 'FloY2' => 16, 'FloState' => 17, 'FloPosition' => 18, ),
|
||||||
BasePeer::TYPE_COLNAME => array (BpmnFlowPeer::FLO_UID => 0, BpmnFlowPeer::PRJ_UID => 1, BpmnFlowPeer::DIA_UID => 2, BpmnFlowPeer::FLO_TYPE => 3, BpmnFlowPeer::FLO_NAME => 4, BpmnFlowPeer::FLO_ELEMENT_ORIGIN => 5, BpmnFlowPeer::FLO_ELEMENT_ORIGIN_TYPE => 6, BpmnFlowPeer::FLO_ELEMENT_ORIGIN_PORT => 7, BpmnFlowPeer::FLO_ELEMENT_DEST => 8, BpmnFlowPeer::FLO_ELEMENT_DEST_TYPE => 9, BpmnFlowPeer::FLO_ELEMENT_DEST_PORT => 10, BpmnFlowPeer::FLO_IS_INMEDIATE => 11, BpmnFlowPeer::FLO_CONDITION => 12, BpmnFlowPeer::FLO_X1 => 13, BpmnFlowPeer::FLO_Y1 => 14, BpmnFlowPeer::FLO_X2 => 15, BpmnFlowPeer::FLO_Y2 => 16, BpmnFlowPeer::FLO_STATE => 17, ),
|
BasePeer::TYPE_COLNAME => array (BpmnFlowPeer::FLO_UID => 0, BpmnFlowPeer::PRJ_UID => 1, BpmnFlowPeer::DIA_UID => 2, BpmnFlowPeer::FLO_TYPE => 3, BpmnFlowPeer::FLO_NAME => 4, BpmnFlowPeer::FLO_ELEMENT_ORIGIN => 5, BpmnFlowPeer::FLO_ELEMENT_ORIGIN_TYPE => 6, BpmnFlowPeer::FLO_ELEMENT_ORIGIN_PORT => 7, BpmnFlowPeer::FLO_ELEMENT_DEST => 8, BpmnFlowPeer::FLO_ELEMENT_DEST_TYPE => 9, BpmnFlowPeer::FLO_ELEMENT_DEST_PORT => 10, BpmnFlowPeer::FLO_IS_INMEDIATE => 11, BpmnFlowPeer::FLO_CONDITION => 12, BpmnFlowPeer::FLO_X1 => 13, BpmnFlowPeer::FLO_Y1 => 14, BpmnFlowPeer::FLO_X2 => 15, BpmnFlowPeer::FLO_Y2 => 16, BpmnFlowPeer::FLO_STATE => 17, BpmnFlowPeer::FLO_POSITION => 18, ),
|
||||||
BasePeer::TYPE_FIELDNAME => array ('FLO_UID' => 0, 'PRJ_UID' => 1, 'DIA_UID' => 2, 'FLO_TYPE' => 3, 'FLO_NAME' => 4, 'FLO_ELEMENT_ORIGIN' => 5, 'FLO_ELEMENT_ORIGIN_TYPE' => 6, 'FLO_ELEMENT_ORIGIN_PORT' => 7, 'FLO_ELEMENT_DEST' => 8, 'FLO_ELEMENT_DEST_TYPE' => 9, 'FLO_ELEMENT_DEST_PORT' => 10, 'FLO_IS_INMEDIATE' => 11, 'FLO_CONDITION' => 12, 'FLO_X1' => 13, 'FLO_Y1' => 14, 'FLO_X2' => 15, 'FLO_Y2' => 16, 'FLO_STATE' => 17, ),
|
BasePeer::TYPE_FIELDNAME => array ('FLO_UID' => 0, 'PRJ_UID' => 1, 'DIA_UID' => 2, 'FLO_TYPE' => 3, 'FLO_NAME' => 4, 'FLO_ELEMENT_ORIGIN' => 5, 'FLO_ELEMENT_ORIGIN_TYPE' => 6, 'FLO_ELEMENT_ORIGIN_PORT' => 7, 'FLO_ELEMENT_DEST' => 8, 'FLO_ELEMENT_DEST_TYPE' => 9, 'FLO_ELEMENT_DEST_PORT' => 10, 'FLO_IS_INMEDIATE' => 11, 'FLO_CONDITION' => 12, 'FLO_X1' => 13, 'FLO_Y1' => 14, 'FLO_X2' => 15, 'FLO_Y2' => 16, 'FLO_STATE' => 17, 'FLO_POSITION' => 18, ),
|
||||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, )
|
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, )
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -249,6 +252,8 @@ abstract class BaseBpmnFlowPeer
|
|||||||
|
|
||||||
$criteria->addSelectColumn(BpmnFlowPeer::FLO_STATE);
|
$criteria->addSelectColumn(BpmnFlowPeer::FLO_STATE);
|
||||||
|
|
||||||
|
$criteria->addSelectColumn(BpmnFlowPeer::FLO_POSITION);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const COUNT = 'COUNT(BPMN_FLOW.FLO_UID)';
|
const COUNT = 'COUNT(BPMN_FLOW.FLO_UID)';
|
||||||
|
|||||||
@@ -3583,6 +3583,7 @@
|
|||||||
<column name="FLO_X2" type="INTEGER" required="true" default="0"/>
|
<column name="FLO_X2" type="INTEGER" required="true" default="0"/>
|
||||||
<column name="FLO_Y2" type="INTEGER" required="true" default="0"/>
|
<column name="FLO_Y2" type="INTEGER" required="true" default="0"/>
|
||||||
<column name="FLO_STATE" type="LONGVARCHAR" required="false"/>
|
<column name="FLO_STATE" type="LONGVARCHAR" required="false"/>
|
||||||
|
<column name="FLO_POSITION" type="INTEGER" required="true" default="0"/>
|
||||||
<foreign-key name="fk_bpmn_flow_project" foreignTable="BPMN_PROJECT">
|
<foreign-key name="fk_bpmn_flow_project" foreignTable="BPMN_PROJECT">
|
||||||
<reference local="PRJ_UID" foreign="PRJ_UID"/>
|
<reference local="PRJ_UID" foreign="PRJ_UID"/>
|
||||||
</foreign-key>
|
</foreign-key>
|
||||||
|
|||||||
@@ -1907,6 +1907,7 @@ CREATE TABLE `BPMN_FLOW`
|
|||||||
`FLO_X2` INTEGER default 0 NOT NULL,
|
`FLO_X2` INTEGER default 0 NOT NULL,
|
||||||
`FLO_Y2` INTEGER default 0 NOT NULL,
|
`FLO_Y2` INTEGER default 0 NOT NULL,
|
||||||
`FLO_STATE` MEDIUMTEXT,
|
`FLO_STATE` MEDIUMTEXT,
|
||||||
|
`FLO_POSITION` INTEGER default 0 NOT NULL,
|
||||||
PRIMARY KEY (`FLO_UID`),
|
PRIMARY KEY (`FLO_UID`),
|
||||||
KEY `BPMN_FLOW_I_1`(`FLO_UID`),
|
KEY `BPMN_FLOW_I_1`(`FLO_UID`),
|
||||||
KEY `BPMN_FLOW_I_2`(`PRJ_UID`),
|
KEY `BPMN_FLOW_I_2`(`PRJ_UID`),
|
||||||
|
|||||||
45
workflow/engine/src/ProcessMaker/Project/Bpmn.php
Normal file → Executable file
45
workflow/engine/src/ProcessMaker/Project/Bpmn.php
Normal file → Executable file
@@ -684,6 +684,7 @@ class Bpmn extends Handler
|
|||||||
$flow->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
$flow->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||||
$flow->setPrjUid($this->getUid());
|
$flow->setPrjUid($this->getUid());
|
||||||
$flow->setDiaUid($this->getDiagram("object")->getDiaUid());
|
$flow->setDiaUid($this->getDiagram("object")->getDiaUid());
|
||||||
|
$flow->setFloPosition($this->getNextPosition($data["FLO_UID"], $data["FLO_TYPE"], $data["FLO_ELEMENT_ORIGIN"]));
|
||||||
$flow->save();
|
$flow->save();
|
||||||
self::log("Add Flow Success!");
|
self::log("Add Flow Success!");
|
||||||
|
|
||||||
@@ -746,6 +747,8 @@ class Bpmn extends Handler
|
|||||||
self::log("Remove Flow: $floUid");
|
self::log("Remove Flow: $floUid");
|
||||||
|
|
||||||
$flow = FlowPeer::retrieveByPK($floUid);
|
$flow = FlowPeer::retrieveByPK($floUid);
|
||||||
|
$this->reOrder($flow->getFloElementOrigin(), $flow->getFloPosition());
|
||||||
|
|
||||||
$flow->delete();
|
$flow->delete();
|
||||||
|
|
||||||
self::log("Remove Flow Success!");
|
self::log("Remove Flow Success!");
|
||||||
@@ -1242,5 +1245,47 @@ class Bpmn extends Handler
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getNextPosition ($sFloUid, $sFloType, $sFloElementOrigin)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$oCriteria = new Criteria('workflow');
|
||||||
|
$oCriteria->addSelectColumn( '(COUNT(*) + 1) AS FLOW_POS' );
|
||||||
|
$oCriteria->add(\BpmnFlowPeer::PRJ_UID, $this->getUid());
|
||||||
|
$oCriteria->add(\BpmnFlowPeer::DIA_UID, $this->getDiagram("object")->getDiaUid());
|
||||||
|
$oCriteria->add(\BpmnFlowPeer::FLO_UID, $sFloUid, \Criteria::NOT_EQUAL);
|
||||||
|
$oCriteria->add(\BpmnFlowPeer::FLO_TYPE, $sFloType);
|
||||||
|
$oCriteria->add(\BpmnFlowPeer::FLO_ELEMENT_ORIGIN, $sFloElementOrigin);
|
||||||
|
$oDataset = \BpmnFlowPeer::doSelectRS($oCriteria);
|
||||||
|
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
$oDataset->next();
|
||||||
|
$aRow = $oDataset->getRow();
|
||||||
|
return (int)($aRow["FLOW_POS"]);
|
||||||
|
|
||||||
|
} catch (Exception $oException) {
|
||||||
|
throw $oException;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function reOrder ($sFloOr, $iPosition)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$oCriteria = new Criteria( 'workflow' );
|
||||||
|
$oCriteria->add( \BpmnFlowPeer::FLO_ELEMENT_ORIGIN, $sFloOr );
|
||||||
|
$oCriteria->add( \BpmnFlowPeer::FLO_POSITION, $iPosition, '>' );
|
||||||
|
$oDataset = \BpmnFlowPeer::doSelectRS( $oCriteria );
|
||||||
|
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||||
|
$oDataset->next();
|
||||||
|
while ($aRow = $oDataset->getRow()) {
|
||||||
|
$oFlow = \BpmnFlowPeer::retrieveByPK( $aRow['FLO_UID'] );
|
||||||
|
$oFlow->setFloPosition( ($aRow['FLO_POSITION']) - 1 );
|
||||||
|
$oFlow->save();
|
||||||
|
$oDataset->next();
|
||||||
|
}
|
||||||
|
} catch (Exception $oException) {
|
||||||
|
throw $oException;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user