@@ -75,6 +75,8 @@ class ElementTaskRelationMapBuilder
|
||||
|
||||
$tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('ELEMENT_UID_DEST', 'ElementUidDest', 'string', CreoleTypes::VARCHAR, false, 32);
|
||||
|
||||
} // doBuild()
|
||||
|
||||
} // ElementTaskRelationMapBuilder
|
||||
|
||||
@@ -57,6 +57,12 @@ abstract class BaseElementTaskRelation extends BaseObject implements Persistent
|
||||
*/
|
||||
protected $tas_uid;
|
||||
|
||||
/**
|
||||
* The value for the element_uid_dest field.
|
||||
* @var string
|
||||
*/
|
||||
protected $element_uid_dest;
|
||||
|
||||
/**
|
||||
* Flag to prevent endless save loop, if this object is referenced
|
||||
* by another object which falls in this transaction.
|
||||
@@ -126,6 +132,17 @@ abstract class BaseElementTaskRelation extends BaseObject implements Persistent
|
||||
return $this->tas_uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [element_uid_dest] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getElementUidDest()
|
||||
{
|
||||
|
||||
return $this->element_uid_dest;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of [etr_uid] column.
|
||||
*
|
||||
@@ -236,6 +253,28 @@ abstract class BaseElementTaskRelation extends BaseObject implements Persistent
|
||||
|
||||
} // setTasUid()
|
||||
|
||||
/**
|
||||
* Set the value of [element_uid_dest] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setElementUidDest($v)
|
||||
{
|
||||
|
||||
// Since the native PHP type for this column is string,
|
||||
// we will cast the input to a string (if it is not).
|
||||
if ($v !== null && !is_string($v)) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->element_uid_dest !== $v) {
|
||||
$this->element_uid_dest = $v;
|
||||
$this->modifiedColumns[] = ElementTaskRelationPeer::ELEMENT_UID_DEST;
|
||||
}
|
||||
|
||||
} // setElementUidDest()
|
||||
|
||||
/**
|
||||
* Hydrates (populates) the object variables with values from the database resultset.
|
||||
*
|
||||
@@ -263,6 +302,8 @@ abstract class BaseElementTaskRelation extends BaseObject implements Persistent
|
||||
|
||||
$this->tas_uid = $rs->getString($startcol + 4);
|
||||
|
||||
$this->element_uid_dest = $rs->getString($startcol + 5);
|
||||
|
||||
$this->resetModified();
|
||||
|
||||
$this->setNew(false);
|
||||
@@ -487,6 +528,9 @@ abstract class BaseElementTaskRelation extends BaseObject implements Persistent
|
||||
case 4:
|
||||
return $this->getTasUid();
|
||||
break;
|
||||
case 5:
|
||||
return $this->getElementUidDest();
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
break;
|
||||
@@ -512,6 +556,7 @@ abstract class BaseElementTaskRelation extends BaseObject implements Persistent
|
||||
$keys[2] => $this->getElementUid(),
|
||||
$keys[3] => $this->getElementType(),
|
||||
$keys[4] => $this->getTasUid(),
|
||||
$keys[5] => $this->getElementUidDest(),
|
||||
);
|
||||
return $result;
|
||||
}
|
||||
@@ -558,6 +603,9 @@ abstract class BaseElementTaskRelation extends BaseObject implements Persistent
|
||||
case 4:
|
||||
$this->setTasUid($value);
|
||||
break;
|
||||
case 5:
|
||||
$this->setElementUidDest($value);
|
||||
break;
|
||||
} // switch()
|
||||
}
|
||||
|
||||
@@ -601,6 +649,10 @@ abstract class BaseElementTaskRelation extends BaseObject implements Persistent
|
||||
$this->setTasUid($arr[$keys[4]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[5], $arr)) {
|
||||
$this->setElementUidDest($arr[$keys[5]]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -632,6 +684,10 @@ abstract class BaseElementTaskRelation extends BaseObject implements Persistent
|
||||
$criteria->add(ElementTaskRelationPeer::TAS_UID, $this->tas_uid);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(ElementTaskRelationPeer::ELEMENT_UID_DEST)) {
|
||||
$criteria->add(ElementTaskRelationPeer::ELEMENT_UID_DEST, $this->element_uid_dest);
|
||||
}
|
||||
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
@@ -694,6 +750,8 @@ abstract class BaseElementTaskRelation extends BaseObject implements Persistent
|
||||
|
||||
$copyObj->setTasUid($this->tas_uid);
|
||||
|
||||
$copyObj->setElementUidDest($this->element_uid_dest);
|
||||
|
||||
|
||||
$copyObj->setNew(true);
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ abstract class BaseElementTaskRelationPeer
|
||||
const CLASS_DEFAULT = 'classes.model.ElementTaskRelation';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 5;
|
||||
const NUM_COLUMNS = 6;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
@@ -46,6 +46,9 @@ abstract class BaseElementTaskRelationPeer
|
||||
/** the column name for the TAS_UID field */
|
||||
const TAS_UID = 'ELEMENT_TASK_RELATION.TAS_UID';
|
||||
|
||||
/** the column name for the ELEMENT_UID_DEST field */
|
||||
const ELEMENT_UID_DEST = 'ELEMENT_TASK_RELATION.ELEMENT_UID_DEST';
|
||||
|
||||
/** The PHP to DB Name Mapping */
|
||||
private static $phpNameMap = null;
|
||||
|
||||
@@ -57,10 +60,10 @@ abstract class BaseElementTaskRelationPeer
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('EtrUid', 'PrjUid', 'ElementUid', 'ElementType', 'TasUid', ),
|
||||
BasePeer::TYPE_COLNAME => array (ElementTaskRelationPeer::ETR_UID, ElementTaskRelationPeer::PRJ_UID, ElementTaskRelationPeer::ELEMENT_UID, ElementTaskRelationPeer::ELEMENT_TYPE, ElementTaskRelationPeer::TAS_UID, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('ETR_UID', 'PRJ_UID', 'ELEMENT_UID', 'ELEMENT_TYPE', 'TAS_UID', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
|
||||
BasePeer::TYPE_PHPNAME => array ('EtrUid', 'PrjUid', 'ElementUid', 'ElementType', 'TasUid', 'ElementUidDest', ),
|
||||
BasePeer::TYPE_COLNAME => array (ElementTaskRelationPeer::ETR_UID, ElementTaskRelationPeer::PRJ_UID, ElementTaskRelationPeer::ELEMENT_UID, ElementTaskRelationPeer::ELEMENT_TYPE, ElementTaskRelationPeer::TAS_UID, ElementTaskRelationPeer::ELEMENT_UID_DEST, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('ETR_UID', 'PRJ_UID', 'ELEMENT_UID', 'ELEMENT_TYPE', 'TAS_UID', 'ELEMENT_UID_DEST', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -70,10 +73,10 @@ abstract class BaseElementTaskRelationPeer
|
||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('EtrUid' => 0, 'PrjUid' => 1, 'ElementUid' => 2, 'ElementType' => 3, 'TasUid' => 4, ),
|
||||
BasePeer::TYPE_COLNAME => array (ElementTaskRelationPeer::ETR_UID => 0, ElementTaskRelationPeer::PRJ_UID => 1, ElementTaskRelationPeer::ELEMENT_UID => 2, ElementTaskRelationPeer::ELEMENT_TYPE => 3, ElementTaskRelationPeer::TAS_UID => 4, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('ETR_UID' => 0, 'PRJ_UID' => 1, 'ELEMENT_UID' => 2, 'ELEMENT_TYPE' => 3, 'TAS_UID' => 4, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
|
||||
BasePeer::TYPE_PHPNAME => array ('EtrUid' => 0, 'PrjUid' => 1, 'ElementUid' => 2, 'ElementType' => 3, 'TasUid' => 4, 'ElementUidDest' => 5, ),
|
||||
BasePeer::TYPE_COLNAME => array (ElementTaskRelationPeer::ETR_UID => 0, ElementTaskRelationPeer::PRJ_UID => 1, ElementTaskRelationPeer::ELEMENT_UID => 2, ElementTaskRelationPeer::ELEMENT_TYPE => 3, ElementTaskRelationPeer::TAS_UID => 4, ElementTaskRelationPeer::ELEMENT_UID_DEST => 5, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('ETR_UID' => 0, 'PRJ_UID' => 1, 'ELEMENT_UID' => 2, 'ELEMENT_TYPE' => 3, 'TAS_UID' => 4, 'ELEMENT_UID_DEST' => 5, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -184,6 +187,8 @@ abstract class BaseElementTaskRelationPeer
|
||||
|
||||
$criteria->addSelectColumn(ElementTaskRelationPeer::TAS_UID);
|
||||
|
||||
$criteria->addSelectColumn(ElementTaskRelationPeer::ELEMENT_UID_DEST);
|
||||
|
||||
}
|
||||
|
||||
const COUNT = 'COUNT(ELEMENT_TASK_RELATION.ETR_UID)';
|
||||
|
||||
@@ -4547,6 +4547,7 @@
|
||||
<column name="ELEMENT_UID" type="VARCHAR" size="32" required="true" />
|
||||
<column name="ELEMENT_TYPE" type="VARCHAR" size="50" required="true" default=""/>
|
||||
<column name="TAS_UID" type="VARCHAR" size="32" required="true" />
|
||||
<column name="ELEMENT_UID_DEST" type="VARCHAR" size="32" required="false" default=""/>
|
||||
</table>
|
||||
<table name="ABE_CONFIGURATION">
|
||||
<vendor type="mysql">
|
||||
|
||||
@@ -2635,6 +2635,7 @@ CREATE TABLE `ELEMENT_TASK_RELATION`
|
||||
`ELEMENT_UID` VARCHAR(32) NOT NULL,
|
||||
`ELEMENT_TYPE` VARCHAR(50) default '' NOT NULL,
|
||||
`TAS_UID` VARCHAR(32) NOT NULL,
|
||||
`ELEMENT_UID_DEST` VARCHAR(32) default '' NOT NULL,
|
||||
PRIMARY KEY (`ETR_UID`)
|
||||
)ENGINE=InnoDB DEFAULT CHARSET='utf8';
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@@ -9,7 +9,8 @@ class ElementTaskRelation
|
||||
"PRJ_UID" => array("type" => "string", "required" => false, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "projectUid"),
|
||||
"ELEMENT_UID" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "elementUid"),
|
||||
"ELEMENT_TYPE" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "elementType"),
|
||||
"TAS_UID" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "taskUid")
|
||||
"TAS_UID" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "taskUid"),
|
||||
"ELEMENT_UID_DEST" => array("type" => "string", "required" => false, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "elementUidDest")
|
||||
);
|
||||
|
||||
private $formatFieldNameInUppercase = true;
|
||||
@@ -359,5 +360,30 @@ class ElementTaskRelation
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify if exists the Element-Task-Relation Gateway to Gateway
|
||||
*
|
||||
* @param string $elementUid uid of Element-Task-Relation
|
||||
* @param string $elementUidDest uid of Element-Task-Relation Destiny
|
||||
*
|
||||
* return bool Return true if exists the Element-Task-Relation Gateway to Gateway, false otherwise
|
||||
*/
|
||||
public function existsGatewayToGateway($elementUid,$elementUidDest)
|
||||
{
|
||||
try {
|
||||
$criteria = new \Criteria("workflow");
|
||||
$criteria->addSelectColumn(\ElementTaskRelationPeer::ETR_UID);
|
||||
$criteria->add(\ElementTaskRelationPeer::ELEMENT_UID, $elementUid, \Criteria::EQUAL);
|
||||
$criteria->add(\ElementTaskRelationPeer::ELEMENT_UID_DEST, $elementUidDest, \Criteria::EQUAL);
|
||||
$rsCriteria = \UsersPeer::doSelectRS( $criteria );
|
||||
$rsCriteria->setFetchmode( \ResultSet::FETCHMODE_ASSOC );
|
||||
$rsCriteria->next();
|
||||
|
||||
return ( $rsCriteria->getRow() )? true : false;
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -717,10 +717,25 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
}
|
||||
*/
|
||||
|
||||
public function createTaskByElement($elementUid, $elementType, $key)
|
||||
public function createTaskByElement($elementUid, $elementType, $key, $elementUidDest="")
|
||||
{
|
||||
try {
|
||||
if (isset($this->arrayElementTaskRelation[$elementUid])) {
|
||||
$flagElementTaskRelation = false;
|
||||
if($elementUidDest != ""){
|
||||
if( isset($this->arrayElementTaskRelation[$elementUid][$elementUidDest]) ){
|
||||
$flagElementTaskRelation = true;
|
||||
}else{
|
||||
$flagElementTaskRelation = false;
|
||||
}
|
||||
}else{
|
||||
if (isset($this->arrayElementTaskRelation[$elementUid])) {
|
||||
$taskUid = $this->arrayElementTaskRelation[$elementUid];
|
||||
$flagElementTaskRelation = true;
|
||||
}else{
|
||||
$flagElementTaskRelation = false;
|
||||
}
|
||||
}
|
||||
if ($flagElementTaskRelation) {
|
||||
$taskUid = $this->arrayElementTaskRelation[$elementUid];
|
||||
} else {
|
||||
$taskPosX = 0;
|
||||
@@ -776,17 +791,37 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
//Element-Task-Relation - Create
|
||||
$elementTaskRelation = new \ProcessMaker\BusinessModel\ElementTaskRelation();
|
||||
|
||||
$arrayResult = $elementTaskRelation->create(
|
||||
$this->wp->getUid(),
|
||||
array(
|
||||
"ELEMENT_UID" => $elementUid,
|
||||
"ELEMENT_TYPE" => $elementType,
|
||||
"TAS_UID" => $taskUid
|
||||
)
|
||||
);
|
||||
if($elementUidDest == ""){
|
||||
$arrayResult = $elementTaskRelation->create(
|
||||
$this->wp->getUid(),
|
||||
array(
|
||||
"ELEMENT_UID" => $elementUid,
|
||||
"ELEMENT_TYPE" => $elementType,
|
||||
"TAS_UID" => $taskUid
|
||||
)
|
||||
);
|
||||
}else{
|
||||
$createGaToGa = $elementTaskRelation->existsGatewayToGateway($elementUid, $elementUidDest);
|
||||
if(!$createGaToGa){
|
||||
$arrayResult = $elementTaskRelation->create(
|
||||
$this->wp->getUid(),
|
||||
array(
|
||||
"ELEMENT_UID" => $elementUid,
|
||||
"ELEMENT_TYPE" => $elementType,
|
||||
"TAS_UID" => $taskUid,
|
||||
"ELEMENT_UID_DEST" => $elementUidDest
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//Array - Add element
|
||||
$this->arrayElementTaskRelation[$elementUid] = $taskUid;
|
||||
if($elementUidDest != ""){
|
||||
$aElement[$elementUid][$elementUidDest] = $elementUidDest;
|
||||
$this->arrayElementTaskRelation = $aElement;
|
||||
}else {
|
||||
//Array - Add element
|
||||
$this->arrayElementTaskRelation[$elementUid] = $taskUid;
|
||||
}
|
||||
}
|
||||
|
||||
//Return
|
||||
@@ -875,7 +910,8 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
$taskUid = $this->createTaskByElement(
|
||||
$gatewayUid,
|
||||
"bpmnGateway",
|
||||
"gateway-to-gateway"
|
||||
"gateway-to-gateway",
|
||||
$arrayFlowData["FLO_ELEMENT_DEST"]
|
||||
);
|
||||
|
||||
$result = $this->wp->addRoute($activityUid, $taskUid, $routeType, $routeCondition, $routeDefault);
|
||||
|
||||
Reference in New Issue
Block a user