updated route connection on input port drop
This commit is contained in:
@@ -1936,13 +1936,23 @@ MyWorkflow.prototype.saveRoute = function(preObj,newObj)
|
||||
next_task_uid[0] = newObj.id;
|
||||
rou_type = 'SEQUENTIAL';
|
||||
}
|
||||
else if(preObj.type.match(/Task/) && newObj.type.match(/End/) && newObj.type.match(/Event/))
|
||||
else if(preObj.type.match(/Task/) && newObj.type.match(/End/) && newObj.type.match(/Event/) || newObj.reverse == 1)
|
||||
{
|
||||
this.deleteRoute(newObj.conn,1);
|
||||
if(newObj.reverse == 1) //Reverse Routing
|
||||
task_uid[0] = newObj.id;
|
||||
else
|
||||
task_uid[0] = preObj.id;
|
||||
next_task_uid[0] = '-1';
|
||||
rou_type = 'SEQUENTIAL';
|
||||
}
|
||||
/*else if(preObj.type.match(/Event/) && preObj.type.match(/End/) && newObj.type.match(/Task/))
|
||||
{
|
||||
this.deleteRoute(newObj.conn,1);
|
||||
task_uid[0] = newObj.id;
|
||||
next_task_uid[0] = '-1';
|
||||
rou_type = 'SEQUENTIAL';
|
||||
}*/
|
||||
else if(preObj.type.match(/Gateway/))
|
||||
{
|
||||
// var task_uid = new Array();
|
||||
|
||||
@@ -273,7 +273,7 @@ InputPort.prototype.onDrop = function (port) {
|
||||
return;
|
||||
}
|
||||
if (this.parentNode.id == port.parentNode.id) {} else {
|
||||
/*var newObj = new Array();
|
||||
/* var newObj = new Array();
|
||||
newObj = this.workflow.currentSelection;
|
||||
var preObj = port.parentNode;
|
||||
newObj.sPortType =port.properties.name;
|
||||
@@ -285,7 +285,8 @@ InputPort.prototype.onDrop = function (port) {
|
||||
return;
|
||||
}
|
||||
_3f02.setConnection(new DecoratedConnection());
|
||||
this.parentNode.workflow.getCommandStack().execute(_3f02);*/
|
||||
this.parentNode.workflow.getCommandStack().execute(_3f02);
|
||||
*/
|
||||
var _4070 = new CommandConnect(this.parentNode.workflow, port, this);
|
||||
if (_4070.source.type == _4070.target.type) {
|
||||
return;
|
||||
@@ -296,22 +297,54 @@ InputPort.prototype.onDrop = function (port) {
|
||||
//Saving Start Event
|
||||
var preObj = new Array();
|
||||
var bpmnType = this.workflow.currentSelection.type;
|
||||
if(bpmnType.match(/Event/) && bpmnType.match(/Start/) && port.parentNode.type.match(/Task/))
|
||||
|
||||
//Routing from end event to task
|
||||
if(bpmnType.match(/End/) && bpmnType.match(/Event/) && port.parentNode.type.match(/Task/))
|
||||
{
|
||||
var tas_uid = port.parentNode.id;
|
||||
this.workflow.saveEvents(this.workflow.currentSelection,tas_uid);
|
||||
}
|
||||
else if(bpmnType.match(/End/) && bpmnType.match(/Event/) && port.parentNode.type.match(/Task/))
|
||||
{
|
||||
preObj = this.workflow.currentSelection;
|
||||
var newObj = port.parentNode;
|
||||
preObj = this.workflow.currentSelection; //end event
|
||||
var newObj = port.parentNode; //task
|
||||
newObj.conn = _4070.connection;
|
||||
newObj.reverse = 1; //setting reverse parameter if user is routing from down to up
|
||||
this.workflow.saveRoute(preObj,newObj);
|
||||
}
|
||||
else if(port.parentNode.type.match(/Task/) && bpmnType.match(/Inter/) && bpmnType.match(/Event/))
|
||||
|
||||
//Routing from task to start event
|
||||
else if(bpmnType.match(/Task/) && port.parentNode.type.match(/Event/) && port.parentNode.type.match(/Start/))
|
||||
{
|
||||
var taskFrom = workflow.getStartEventConn(this,'sourcePort','InputPort');
|
||||
var taskTo = workflow.getStartEventConn(this,'targetPort','OutputPort');
|
||||
preObj = this.workflow.currentSelection; //task
|
||||
newObj = port.parentNode; //start event
|
||||
//newObj.reverse = 1; //setting reverse parameter if user is routing from down to up
|
||||
var tas_uid = preObj.id;
|
||||
this.workflow.saveEvents(newObj,tas_uid);
|
||||
}
|
||||
|
||||
//Routing from task to task
|
||||
else if(bpmnType.match(/Task/) && port.parentNode.type.match(/Task/))
|
||||
{
|
||||
|
||||
preObj = this.workflow.currentSelection;
|
||||
newObj = port.parentNode;
|
||||
newObj.conn = _4070.connection;
|
||||
newObj.sPortType =port.properties.name;
|
||||
preObj.sPortType =this.properties.name;
|
||||
this.workflow.saveRoute(newObj,preObj);
|
||||
}
|
||||
|
||||
//Routing from task to gateway
|
||||
else if(bpmnType.match(/Task/) && port.parentNode.type.match(/Gateway/))
|
||||
{
|
||||
var shape = new Array();
|
||||
shape.type = '';
|
||||
preObj = this.workflow.currentSelection;
|
||||
newObj = port.parentNode;
|
||||
this.workflow.saveRoute(newObj,shape);
|
||||
}
|
||||
|
||||
//Routing from task to Intermediate event
|
||||
else if(port.parentNode.type.match(/Inter/) && port.parentNode.type.match(/Event/) && bpmnType.match(/Task/))
|
||||
{
|
||||
var taskFrom = workflow.getStartEventConn(this,'targetPort','OutputPort');
|
||||
var taskTo = workflow.getStartEventConn(this,'sourcePort','InputPort');
|
||||
|
||||
if(typeof taskFrom[0] != 'undefined' || typeof taskTo[0] != 'undefined')
|
||||
{
|
||||
@@ -321,26 +354,10 @@ InputPort.prototype.onDrop = function (port) {
|
||||
|
||||
//save Event First
|
||||
tas_uid = port.parentNode.id;
|
||||
this.workflow.saveEvents(workflow.currentSelection,preObj);
|
||||
this.workflow.saveEvents(preObj,workflow.currentSelection);
|
||||
}
|
||||
}
|
||||
else if(bpmnType.match(/Task/) && port.parentNode.type.match(/Task/))
|
||||
{
|
||||
|
||||
preObj = this.workflow.currentSelection;
|
||||
newObj = port.parentNode;
|
||||
newObj.conn = _4070.connection;
|
||||
newObj.sPortType =port.properties.name;
|
||||
preObj.sPortType =this.properties.name;
|
||||
this.workflow.saveRoute(preObj,newObj);
|
||||
}
|
||||
else if(bpmnType.match(/Gateway/) && port.parentNode.type.match(/Task/))
|
||||
{
|
||||
var shape = new Array();
|
||||
shape.type = '';
|
||||
preObj = this.workflow.currentSelection;
|
||||
this.workflow.saveRoute(preObj,shape);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -419,7 +436,6 @@ OutputPort.prototype.onDrop = function (port) {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
LineEndResizeHandle.prototype.onDrop=function(_3f3e){
|
||||
var line=this.workflow.currentSelection;
|
||||
line.isMoving=false;
|
||||
|
||||
Reference in New Issue
Block a user