added gateway details while importing and exporting process.
Added zoomfactor in zoom function...
This commit is contained in:
@@ -2489,10 +2489,11 @@ class processMap {
|
|||||||
$oGateway->remove($sGatewayUID);
|
$oGateway->remove($sGatewayUID);
|
||||||
}
|
}
|
||||||
//Getting Gateway UID after saving gateway
|
//Getting Gateway UID after saving gateway
|
||||||
if($sType != 'SEQUENTIAL' && $sGatewayUID == '' && $sDelete == '1')
|
//if($sType != 'SEQUENTIAL' && $sGatewayUID == '' && $sDelete == '1')
|
||||||
|
if($sType != 'SEQUENTIAL')
|
||||||
{
|
{
|
||||||
$oProcessMap = new processMap();
|
$oProcessMap = new processMap();
|
||||||
$sGatewayUID = $oProcessMap->saveNewGateway($sProcessUID, $sTaskUID);
|
$sGatewayUID = $oProcessMap->saveNewGateway($sProcessUID, $sTaskUID, $sNextTask);
|
||||||
}
|
}
|
||||||
|
|
||||||
$aFields ['GAT_UID'] = (isset($sGatewayUID))?$sGatewayUID:'';
|
$aFields ['GAT_UID'] = (isset($sGatewayUID))?$sGatewayUID:'';
|
||||||
@@ -2508,14 +2509,16 @@ class processMap {
|
|||||||
*
|
*
|
||||||
* @param string $sProcessUID Default value empty
|
* @param string $sProcessUID Default value empty
|
||||||
* @param string $sTaskUID Default value empty
|
* @param string $sTaskUID Default value empty
|
||||||
|
* @param string $sNextTask Default value empty
|
||||||
* @return string $sGatewayUID
|
* @return string $sGatewayUID
|
||||||
*/
|
*/
|
||||||
function saveNewGateway($sProcessUID = '', $sTaskUID = '') {
|
function saveNewGateway($sProcessUID = '', $sTaskUID = '', $sNextTask = '') {
|
||||||
try {
|
try {
|
||||||
$oTask = new Task();
|
$oTask = new Task();
|
||||||
$aTaskDetails = $oTask->load($sTaskUID);
|
$aTaskDetails = $oTask->load($sTaskUID);
|
||||||
$aFields ['PRO_UID'] = $sProcessUID;
|
$aFields ['PRO_UID'] = $sProcessUID;
|
||||||
$aFields ['TAS_UID'] = $sTaskUID;
|
$aFields ['TAS_UID'] = $sTaskUID;
|
||||||
|
$aFields ['GAT_NEXT_TASK'] = $sNextTask;
|
||||||
$aFields ['GAT_X'] = $aTaskDetails['TAS_POSX'] + $aTaskDetails['TAS_WIDTH']/2;
|
$aFields ['GAT_X'] = $aTaskDetails['TAS_POSX'] + $aTaskDetails['TAS_WIDTH']/2;
|
||||||
$aFields ['GAT_Y'] = $aTaskDetails['TAS_POSY'] + $aTaskDetails['TAS_HEIGHT'] + 10;
|
$aFields ['GAT_Y'] = $aTaskDetails['TAS_POSY'] + $aTaskDetails['TAS_HEIGHT'] + 10;
|
||||||
|
|
||||||
@@ -4646,6 +4649,7 @@ class processMap {
|
|||||||
function getExtAvailableBBCriteria($sProcessUID = '', $sTaskUID = '')
|
function getExtAvailableBBCriteria($sProcessUID = '', $sTaskUID = '')
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
$_SESSION['TASK'] = $sTaskUID;
|
||||||
$oTasks = new Tasks ( );
|
$oTasks = new Tasks ( );
|
||||||
$_SESSION['TASK'] = $sTaskUID;
|
$_SESSION['TASK'] = $sTaskUID;
|
||||||
$aSteps = $oTasks->getStepsOfTask ( $sTaskUID );
|
$aSteps = $oTasks->getStepsOfTask ( $sTaskUID );
|
||||||
|
|||||||
@@ -1002,6 +1002,26 @@ class Processes {
|
|||||||
return $this->getAllLanes( $sProUid );
|
return $this->getAllLanes( $sProUid );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Gateway Rows from a process and returns those in an array.
|
||||||
|
* @param $sProUid string for the process Uid
|
||||||
|
* @return $oTask array
|
||||||
|
*/
|
||||||
|
function getGatewayRows ($sProUid ){
|
||||||
|
$oTask = new Tasks( );
|
||||||
|
return $oTask->getAllGateways( $sProUid );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create Gateway Rows from a $aGateways array data and returns those in an array.
|
||||||
|
* @param $aGateways array
|
||||||
|
* @return $oGateway array
|
||||||
|
*/
|
||||||
|
function createGatewayRows ($aGateways ){
|
||||||
|
$oTask = new Tasks( );
|
||||||
|
return $oTask->createGatewayRows( $aGateways );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create Lane Rows from a $aLanes array data and returns those in an array.
|
* Create Lane Rows from a $aLanes array data and returns those in an array.
|
||||||
* @param $aLanes array.
|
* @param $aLanes array.
|
||||||
@@ -2128,6 +2148,7 @@ class Processes {
|
|||||||
$oData->tasks = $this->getTaskRows( $sProUid );
|
$oData->tasks = $this->getTaskRows( $sProUid );
|
||||||
$oData->routes = $this->getRouteRows( $sProUid );
|
$oData->routes = $this->getRouteRows( $sProUid );
|
||||||
$oData->lanes = $this->getLaneRows( $sProUid );
|
$oData->lanes = $this->getLaneRows( $sProUid );
|
||||||
|
$oData->gateways = $this->getGatewayRows( $sProUid );
|
||||||
$oData->inputs = $this->getInputRows( $sProUid );
|
$oData->inputs = $this->getInputRows( $sProUid );
|
||||||
$oData->outputs = $this->getOutputRows( $sProUid );
|
$oData->outputs = $this->getOutputRows( $sProUid );
|
||||||
$oData->dynaforms = $this->getDynaformRows ( $sProUid );
|
$oData->dynaforms = $this->getDynaformRows ( $sProUid );
|
||||||
@@ -2991,6 +3012,7 @@ class Processes {
|
|||||||
$this->createTaskRows($oData->tasks);
|
$this->createTaskRows($oData->tasks);
|
||||||
$this->createRouteRows($oData->routes);
|
$this->createRouteRows($oData->routes);
|
||||||
$this->createLaneRows($oData->lanes);
|
$this->createLaneRows($oData->lanes);
|
||||||
|
$this->createGatewayRows($oData->gateways);
|
||||||
$this->createDynaformRows($oData->dynaforms);
|
$this->createDynaformRows($oData->dynaforms);
|
||||||
$this->createInputRows($oData->inputs);
|
$this->createInputRows($oData->inputs);
|
||||||
$this->createOutputRows($oData->outputs);
|
$this->createOutputRows($oData->outputs);
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ require_once 'classes/model/StepTrigger.php';
|
|||||||
require_once 'classes/model/Task.php';
|
require_once 'classes/model/Task.php';
|
||||||
require_once 'classes/model/TaskUser.php';
|
require_once 'classes/model/TaskUser.php';
|
||||||
require_once 'classes/model/Users.php';
|
require_once 'classes/model/Users.php';
|
||||||
|
require_once 'classes/model/Gateway.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tasks - Tasks class
|
* Tasks - Tasks class
|
||||||
@@ -321,6 +322,48 @@ class Tasks
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all gateways for any Process
|
||||||
|
* @param string $sProUid
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getAllGateways($sProUid)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$aGateways = array();
|
||||||
|
$oCriteria = new Criteria('workflow');
|
||||||
|
$oCriteria->add(GatewayPeer::PRO_UID, $sProUid);
|
||||||
|
$oDataset = GatewayPeer::doSelectRS($oCriteria);
|
||||||
|
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
$oDataset->next();
|
||||||
|
while ($aRow = $oDataset->getRow()) {
|
||||||
|
$oGateway = new Gateway();
|
||||||
|
$aGateways[] = $oGateway->Load($aRow['GAT_UID']);
|
||||||
|
$oDataset->next();
|
||||||
|
}
|
||||||
|
return $aGateways;
|
||||||
|
}
|
||||||
|
catch (Exception $oError) {
|
||||||
|
throw($oError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* creates row tasks from an Task Array
|
||||||
|
* @param string $aTasks
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function createGatewayRows( $aGateway )
|
||||||
|
{
|
||||||
|
foreach ( $aGateway as $key => $row ) {
|
||||||
|
$oGateway = new Gateway();
|
||||||
|
if($oGateway->gatewayExists ($row['GAT_UID']))
|
||||||
|
$oGateway->remove($row['GAT_UID']);
|
||||||
|
$res = $oGateway->createRow($row);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete all routes from a task
|
* Delete all routes from a task
|
||||||
* @param string $sProcessUID
|
* @param string $sProcessUID
|
||||||
|
|||||||
@@ -113,5 +113,68 @@ class Gateway extends BaseGateway {
|
|||||||
throw($oError);
|
throw($oError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* verify if Gateway row specified in [GatUid] exists.
|
||||||
|
*
|
||||||
|
* @param string $sProUid the uid of the Prolication
|
||||||
|
*/
|
||||||
|
|
||||||
|
function gatewayExists ( $GatUid ) {
|
||||||
|
$con = Propel::getConnection(GatewayPeer::DATABASE_NAME);
|
||||||
|
try {
|
||||||
|
$oPro = GatewayPeer::retrieveByPk( $GatUid );
|
||||||
|
if ( is_object($oPro) && get_class ($oPro) == 'Gateway' ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception $oError) {
|
||||||
|
throw($oError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create a new Gateway
|
||||||
|
*
|
||||||
|
* @param array $aData with new values
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function createRow($aData)
|
||||||
|
{
|
||||||
|
$con = Propel::getConnection(GatewayPeer::DATABASE_NAME);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$con->begin();
|
||||||
|
|
||||||
|
$this->fromArray($aData,BasePeer::TYPE_FIELDNAME);
|
||||||
|
if($this->validate())
|
||||||
|
{
|
||||||
|
$this->setGatUid((isset($aData['GAT_UID']) ? $aData['GAT_UID']: ''));
|
||||||
|
$this->setProUid((isset($aData['PRO_UID']) ? $aData['PRO_UID']: ''));
|
||||||
|
$this->setTasUid((isset($aData['TAS_UID']) ? $aData['TAS_UID']: ''));
|
||||||
|
$this->setGatNextTask((isset($aData['GAT_NEXT_TASK']) ? $aData['GAT_NEXT_TASK']: ''));
|
||||||
|
$this->setGatX((isset($aData['GAT_X']) ? $aData['GAT_X']: ''));
|
||||||
|
$this->setGatY((isset($aData['GAT_Y']) ? $aData['GAT_Y']: ''));
|
||||||
|
$this->save();
|
||||||
|
$con->commit();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$con->rollback();
|
||||||
|
$e=new Exception("Failed Validation in class ".get_class($this).".");
|
||||||
|
$e->aValidationFailures=$this->getValidationFailures();
|
||||||
|
throw($e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(Exception $e)
|
||||||
|
{
|
||||||
|
$con->rollback();
|
||||||
|
throw($e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // Gateway
|
} // Gateway
|
||||||
|
|||||||
@@ -2126,6 +2126,7 @@ MyWorkflow.prototype.getDeleteCriteria = function()
|
|||||||
*/
|
*/
|
||||||
MyWorkflow.prototype.zoom = function(sType)
|
MyWorkflow.prototype.zoom = function(sType)
|
||||||
{
|
{
|
||||||
|
//workflow.zoomFactor = 1;
|
||||||
var figures = workflow.getDocument().getFigures();
|
var figures = workflow.getDocument().getFigures();
|
||||||
|
|
||||||
var lines=workflow.getLines();
|
var lines=workflow.getLines();
|
||||||
@@ -2160,6 +2161,24 @@ MyWorkflow.prototype.zoom = function(sType)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(typeof workflow.zoomFactor != 'undefined' && sType == 'in')
|
||||||
|
{
|
||||||
|
var zoomFactor = workflow.zoomFactor + 0.2;
|
||||||
|
workflow.zoomFactor = zoomFactor;
|
||||||
|
}
|
||||||
|
else if(typeof workflow.zoomFactor != 'undefined' && sType == 'out')
|
||||||
|
{
|
||||||
|
zoomFactor = workflow.zoomFactor - 0.2;
|
||||||
|
workflow.zoomFactor = zoomFactor;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
zoomFactor = 0.2;
|
||||||
|
workflow.zoomFactor = zoomFactor;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for(f = 0;f<figures.getSize();f++){
|
for(f = 0;f<figures.getSize();f++){
|
||||||
var fig = figures.get(f);
|
var fig = figures.get(f);
|
||||||
var width = fig.getWidth();
|
var width = fig.getWidth();
|
||||||
@@ -2168,31 +2187,38 @@ MyWorkflow.prototype.zoom = function(sType)
|
|||||||
var yPos = fig.getY();
|
var yPos = fig.getY();
|
||||||
if(sType == 'in')
|
if(sType == 'in')
|
||||||
{
|
{
|
||||||
if(fig.type.match(/Event/) || fig.type.match(/Gateway/))
|
|
||||||
{
|
|
||||||
width += 5;
|
//if(fig.type.match(/Event/) || fig.type.match(/Gateway/))
|
||||||
height += 5;
|
//{
|
||||||
|
width = width*zoomFactor + width;
|
||||||
|
height = height*zoomFactor + height;
|
||||||
workflow.zoomWidth = width;
|
workflow.zoomWidth = width;
|
||||||
workflow.zoomHeight = height;
|
workflow.zoomHeight = height;
|
||||||
}
|
//}
|
||||||
else if(fig.type.match(/Annotation/))
|
/*else if(fig.type.match(/Annotation/))
|
||||||
{
|
{
|
||||||
width += 20;
|
width *= zoomFactor;
|
||||||
height += 20;
|
height *= zoomFactor;
|
||||||
workflow.zoomAnnotationWidth = width;
|
workflow.zoomAnnotationWidth = width;
|
||||||
workflow.zoomAnnotationHeight = height;
|
workflow.zoomAnnotationHeight = height;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
width += 20;
|
width *= zoomFactor;
|
||||||
height += 20;
|
height *= zoomFactor;
|
||||||
workflow.zoomTaskWidth = width;
|
workflow.zoomTaskWidth = width;
|
||||||
workflow.zoomTaskHeight = height;
|
workflow.zoomTaskHeight = height;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(fig.type.match(/Event/) || fig.type.match(/Gateway/))
|
width = width*zoomFactor - width;
|
||||||
|
height = height*zoomFactor - height;
|
||||||
|
workflow.zoomWidth = width;
|
||||||
|
workflow.zoomHeight = height;
|
||||||
|
|
||||||
|
/*if(fig.type.match(/Event/) || fig.type.match(/Gateway/))
|
||||||
{
|
{
|
||||||
width -= 5;
|
width -= 5;
|
||||||
height -= 5;
|
height -= 5;
|
||||||
@@ -2212,7 +2238,7 @@ MyWorkflow.prototype.zoom = function(sType)
|
|||||||
height -= 20;
|
height -= 20;
|
||||||
workflow.zoomTaskWidth = width;
|
workflow.zoomTaskWidth = width;
|
||||||
workflow.zoomTaskHeight = height;
|
workflow.zoomTaskHeight = height;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2227,6 +2253,7 @@ MyWorkflow.prototype.zoom = function(sType)
|
|||||||
//fig.setPosition(xPos,yPos - 10);
|
//fig.setPosition(xPos,yPos - 10);
|
||||||
|
|
||||||
fig.setDimension(width,height);
|
fig.setDimension(width,height);
|
||||||
|
fig.setPosition(xPos,yPos + zoomFactor*yPos);
|
||||||
if(fig.type == 'bpmnTask')
|
if(fig.type == 'bpmnTask')
|
||||||
{
|
{
|
||||||
fig.bpmnText.clear();
|
fig.bpmnText.clear();
|
||||||
|
|||||||
@@ -378,7 +378,7 @@ Ext.onReady ( function() {
|
|||||||
name: "bpmnGatewayExclusiveData"
|
name: "bpmnGatewayExclusiveData"
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
var dragsource=new Ext.dd.DragSource("x-shapes-dataobject", {
|
/*var dragsource=new Ext.dd.DragSource("x-shapes-dataobject", {
|
||||||
ddGroup:'TreeDD',
|
ddGroup:'TreeDD',
|
||||||
dragData:{
|
dragData:{
|
||||||
name: "bpmnDataobject"
|
name: "bpmnDataobject"
|
||||||
@@ -389,7 +389,7 @@ Ext.onReady ( function() {
|
|||||||
dragData:{
|
dragData:{
|
||||||
name: "bpmnPool"
|
name: "bpmnPool"
|
||||||
}
|
}
|
||||||
});
|
});*/
|
||||||
var dragsource=new Ext.dd.DragSource("x-shapes-annotation", {
|
var dragsource=new Ext.dd.DragSource("x-shapes-annotation", {
|
||||||
ddGroup:'TreeDD',
|
ddGroup:'TreeDD',
|
||||||
dragData:{
|
dragData:{
|
||||||
|
|||||||
Reference in New Issue
Block a user