Gateway to Gateway connected
This commit is contained in:
@@ -1113,22 +1113,33 @@ MyWorkflow.prototype.savePosition= function(oShape)
|
|||||||
MyWorkflow.prototype.saveShape= function(oNewShape)
|
MyWorkflow.prototype.saveShape= function(oNewShape)
|
||||||
{
|
{
|
||||||
//Initializing variables
|
//Initializing variables
|
||||||
var shapeId = oNewShape.id;
|
var shapeId = oNewShape.id;
|
||||||
|
var shapetype = oNewShape.type;
|
||||||
var actiontype = oNewShape.actiontype;
|
var actiontype = oNewShape.actiontype;
|
||||||
var xpos = oNewShape.x;
|
var xpos = oNewShape.x;
|
||||||
var ypos = oNewShape.y;
|
var ypos = oNewShape.y;
|
||||||
var pos = '{"x":'+xpos+',"y":'+ypos+'}';
|
var pos = '{"x":'+xpos+',"y":'+ypos+'}';
|
||||||
|
var width = oNewShape.width;
|
||||||
var width = oNewShape.width;
|
var height = oNewShape.height;
|
||||||
var height = oNewShape.height;
|
|
||||||
var cordinates = '{"x":'+width+',"y":'+height+'}';
|
var cordinates = '{"x":'+width+',"y":'+height+'}';
|
||||||
|
|
||||||
if(oNewShape.type == 'bpmnTask'){
|
if(shapetype == 'bpmnTask'){
|
||||||
var newlabel = oNewShape.taskName;
|
var newlabel = oNewShape.taskName;
|
||||||
}
|
}
|
||||||
if(oNewShape.type == 'bpmnAnnotation'){
|
if(shapetype == 'bpmnAnnotation'){
|
||||||
newlabel = oNewShape.annotationName;
|
newlabel = oNewShape.annotationName;
|
||||||
}
|
}
|
||||||
|
//For Gateway to Event connection
|
||||||
|
connect = false;
|
||||||
|
if(typeof workflow.preSelectedObj != 'undefined' && workflow.preSelectedObj.type != 'undefined'){
|
||||||
|
if(workflow.preSelectedObj.type.match(/Gateway/))
|
||||||
|
connect = true;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
connect = false;
|
||||||
|
workflow.preSelectedObj = '';
|
||||||
|
workflow.preSelectedObj.type = '';
|
||||||
|
}
|
||||||
|
|
||||||
//var urlparams = "action=addTask&data={"uid":"4708462724ca1d281210739068208635","position":{"x":707,"y":247}}";
|
//var urlparams = "action=addTask&data={"uid":"4708462724ca1d281210739068208635","position":{"x":707,"y":247}}";
|
||||||
var urlparams = '';
|
var urlparams = '';
|
||||||
@@ -1161,21 +1172,13 @@ MyWorkflow.prototype.saveShape= function(oNewShape)
|
|||||||
break;
|
break;
|
||||||
case 'addEvent':
|
case 'addEvent':
|
||||||
var tas_uid='';
|
var tas_uid='';
|
||||||
//if(typeof oNewShape.workflow != 'undefined' && oNewShape.workflow != null)
|
urlparams = '?action='+actiontype+'&data={"uid":"'+ pro_uid +'","tas_uid":"'+tas_uid+'","evn_type":"'+shapetype+'","position":'+pos+',"evn_uid":"'+shapeId+'"}';
|
||||||
// tas_uid = oNewShape.workflow.taskUid[0].value;
|
|
||||||
var evn_type = oNewShape.type;
|
|
||||||
var evn_uid = oNewShape.id;
|
|
||||||
urlparams = '?action='+actiontype+'&data={"uid":"'+ pro_uid +'","tas_uid":"'+tas_uid+'","evn_type":"'+evn_type+'","position":'+pos+',"evn_uid":"'+evn_uid+'"}';
|
|
||||||
break;
|
break;
|
||||||
case 'updateEvent':
|
case 'updateEvent':
|
||||||
var evn_uid = oNewShape.id
|
urlparams = '?action='+actiontype+'&data={"evn_uid":"'+shapeId +'","evn_type":"'+shapetype+'"}';
|
||||||
var evn_type = oNewShape.type;
|
|
||||||
urlparams = '?action='+actiontype+'&data={"evn_uid":"'+evn_uid +'","evn_type":"'+evn_type+'"}';
|
|
||||||
break;
|
break;
|
||||||
case 'addGateway':
|
case 'addGateway':
|
||||||
var gat_uid = oNewShape.id
|
urlparams = '?action='+actiontype+'&data={"pro_uid":"'+ pro_uid +'","gat_uid":"'+ shapeId +'","gat_type":"'+ shapetype +'","position":'+ pos +'}';
|
||||||
var gat_type = oNewShape.type;
|
|
||||||
urlparams = '?action='+actiontype+'&data={"pro_uid":"'+ pro_uid +'","gat_uid":"'+gat_uid +'","gat_type":"'+gat_type+'","position":'+pos+'}';
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//var urlparams = '?action='+actiontype+'&data={"uid":"'+ pro_uid +'","position":'+pos+'}';
|
//var urlparams = '?action='+actiontype+'&data={"uid":"'+ pro_uid +'","position":'+pos+'}';
|
||||||
@@ -1217,9 +1220,9 @@ MyWorkflow.prototype.saveShape= function(oNewShape)
|
|||||||
else if(oNewShape.type.match(/Start/) && oNewShape.type.match(/Event/)){
|
else if(oNewShape.type.match(/Start/) && oNewShape.type.match(/Event/)){
|
||||||
workflow.saveEvents(oNewShape);
|
workflow.saveEvents(oNewShape);
|
||||||
}
|
}
|
||||||
else if(oNewShape.type.match(/Gateway/)){
|
else if(oNewShape.type.match(/Gateway/)){
|
||||||
workflow.saveGateways(oNewShape);
|
workflow.saveGateways(oNewShape);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
failure: function(){
|
failure: function(){
|
||||||
@@ -1495,9 +1498,10 @@ MyWorkflow.prototype.getStartEventConn = function(oShape,sPort,sPortType)
|
|||||||
* @Author Safan Maredia
|
* @Author Safan Maredia
|
||||||
*/
|
*/
|
||||||
MyWorkflow.prototype.saveGateways = function(oGateway){
|
MyWorkflow.prototype.saveGateways = function(oGateway){
|
||||||
var task_uid = new Array();
|
var task_uid = '';
|
||||||
var next_task_uid = new Array();
|
var next_task_uid = '';
|
||||||
var urlparams = '';
|
var next_task_type = '';
|
||||||
|
var urlparams = '';
|
||||||
var xpos = oGateway.x;
|
var xpos = oGateway.x;
|
||||||
var ypos = oGateway.y;
|
var ypos = oGateway.y;
|
||||||
var pos = '{"x":'+xpos+',"y":'+ypos+'}';
|
var pos = '{"x":'+xpos+',"y":'+ypos+'}';
|
||||||
@@ -1517,14 +1521,15 @@ MyWorkflow.prototype.saveGateways = function(oGateway){
|
|||||||
if(typeof conn[i] != 'undefined')
|
if(typeof conn[i] != 'undefined')
|
||||||
for(var j = 0; j < conn[i].data.length ; j++){
|
for(var j = 0; j < conn[i].data.length ; j++){
|
||||||
if(typeof conn[i].data[j] != 'undefined'){
|
if(typeof conn[i].data[j] != 'undefined'){
|
||||||
if(conn[i].data[j].sourcePort.parentNode.type != oGateway.type){
|
if(conn[i].data[j].sourcePort.parentNode.id != oGateway.id){
|
||||||
// task_uid[count1] = new Array();
|
// task_uid[count1] = new Array();
|
||||||
task_uid = conn[i].data[j].sourcePort.parentNode.id;
|
task_uid = conn[i].data[j].sourcePort.parentNode.id;
|
||||||
count1++;
|
count1++;
|
||||||
}
|
}
|
||||||
if(conn[i].data[j].targetPort.parentNode.type != oGateway.type){
|
if(conn[i].data[j].targetPort.parentNode.id != oGateway.id){
|
||||||
// task_uid[count2] = new Array();
|
// task_uid[count2] = new Array();
|
||||||
next_task_uid = conn[i].data[j].targetPort.parentNode.id;
|
next_task_uid = conn[i].data[j].targetPort.parentNode.id;
|
||||||
|
next_task_type = conn[i].data[j].targetPort.parentNode.type;
|
||||||
//count2++;
|
//count2++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1532,7 +1537,7 @@ MyWorkflow.prototype.saveGateways = function(oGateway){
|
|||||||
}
|
}
|
||||||
// var staskUid = Ext.util.JSON.encode(task_uid);
|
// var staskUid = Ext.util.JSON.encode(task_uid);
|
||||||
// var sNextTaskUid = Ext.util.JSON.encode(next_task_uid);
|
// var sNextTaskUid = Ext.util.JSON.encode(next_task_uid);
|
||||||
urlparams = '?action=addGateway&data={"pro_uid":"'+ pro_uid +'","tas_from":"'+task_uid+'","tas_to":"'+next_task_uid+'","gat_type":"'+oGateway.type+'","gat_uid":"'+oGateway.id+'","position":'+pos+'}';
|
urlparams = '?action=addGateway&data={"pro_uid":"'+ pro_uid +'","tas_from":"'+task_uid+'","tas_to":"'+next_task_uid+'","gat_type":"'+oGateway.type+'","gat_uid":"'+oGateway.id+'","gat_next_type":"'+next_task_type+'","position":'+pos+'}';
|
||||||
if(urlparams != ''){
|
if(urlparams != ''){
|
||||||
Ext.Ajax.request({
|
Ext.Ajax.request({
|
||||||
url: "processes_Ajax.php"+ urlparams,
|
url: "processes_Ajax.php"+ urlparams,
|
||||||
|
|||||||
@@ -735,19 +735,23 @@ bpmnTask.prototype.addShapes = function (oStore) {
|
|||||||
if (oStore.newShapeName == 'bpmnTask' && shape.match(/Event/)) {
|
if (oStore.newShapeName == 'bpmnTask' && shape.match(/Event/)) {
|
||||||
xOffset = workflow.currentSelection.getX() - 67; //Setting new offset value when currentselection is not Task i.e deriving task from events
|
xOffset = workflow.currentSelection.getX() - 67; //Setting new offset value when currentselection is not Task i.e deriving task from events
|
||||||
}
|
}
|
||||||
if (oStore.newShapeName == 'bpmnTask' && shape.match(/Gateway/)) {
|
else if (oStore.newShapeName == 'bpmnTask' && shape.match(/Gateway/)) {
|
||||||
xOffset = workflow.currentSelection.getX() - 62; //Setting new offset value when currentselection is not Task i.e deriving task from gateways
|
xOffset = workflow.currentSelection.getX() - 62; //Setting new offset value when currentselection is not Task i.e deriving task from gateways
|
||||||
}
|
}
|
||||||
if (oStore.newShapeName.match(/Event/)) {
|
else if (oStore.newShapeName.match(/Gateway/) && shape.match(/Gateway/)) {
|
||||||
|
xOffset = workflow.currentSelection.getX(); //Setting new offset value when currentselection is not Task i.e deriving task from gateways
|
||||||
|
}
|
||||||
|
else if (oStore.newShapeName.match(/Event/)) {
|
||||||
xOffset = workflow.currentSelection.getX() + 67; //Setting new offset value when newShape is not Task i.e aligning events
|
xOffset = workflow.currentSelection.getX() + 67; //Setting new offset value when newShape is not Task i.e aligning events
|
||||||
}
|
}
|
||||||
if (oStore.newShapeName.match(/Gateway/)) {
|
else if (oStore.newShapeName.match(/Gateway/)) {
|
||||||
xOffset = workflow.currentSelection.getX() + 62; //Setting new offset value when newShape is not Task i.e aligning gateways
|
xOffset = workflow.currentSelection.getX() + 62;
|
||||||
}
|
}
|
||||||
if (oStore.newShapeName.match(/Annotation/)) {
|
else if (oStore.newShapeName.match(/Annotation/)) {
|
||||||
xOffset = workflow.currentSelection.getX() + 250; //Setting new offset value when newShape is not Task i.e aligning gateways
|
xOffset = workflow.currentSelection.getX() + 250;
|
||||||
yOffset = workflow.currentSelection.getY() - 10.5; //Setting new offset value when newShape is not Task i.e aligning gateways
|
yOffset = workflow.currentSelection.getY() - 10.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
workflow.subProcessName = 'Sub Process';
|
workflow.subProcessName = 'Sub Process';
|
||||||
workflow.annotationName = 'Annotation';
|
workflow.annotationName = 'Annotation';
|
||||||
var newShape = eval("new " + oStore.newShapeName + "(workflow)");
|
var newShape = eval("new " + oStore.newShapeName + "(workflow)");
|
||||||
@@ -830,6 +834,7 @@ ButtonGateway.prototype = new Button;
|
|||||||
ButtonGateway.prototype.type = "/skins/ext/images/gray/shapes/gateway-small";
|
ButtonGateway.prototype.type = "/skins/ext/images/gray/shapes/gateway-small";
|
||||||
ButtonGateway.prototype.execute = function () {
|
ButtonGateway.prototype.execute = function () {
|
||||||
this.palette.newShapeName = 'bpmnGatewayExclusiveData';
|
this.palette.newShapeName = 'bpmnGatewayExclusiveData';
|
||||||
|
workflow.preSelectedObj = workflow.currentSelection;
|
||||||
bpmnTask.prototype.addShapes(this.palette);
|
bpmnTask.prototype.addShapes(this.palette);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -934,7 +939,7 @@ bpmnTaskDialog.prototype.createHTMLElement = function () {
|
|||||||
/*Double Click Event for opening the dialog Box*/
|
/*Double Click Event for opening the dialog Box*/
|
||||||
bpmnTask.prototype.onDoubleClick = function () {
|
bpmnTask.prototype.onDoubleClick = function () {
|
||||||
var _409d = new bpmnTaskDialog(this);
|
var _409d = new bpmnTaskDialog(this);
|
||||||
this.workflow.showDialog(_409d, this.workflow.currentSelection.x, this.workflow.currentSelection.y);
|
workflow.showDialog(_409d, this.workflow.currentSelection.x, this.workflow.currentSelection.y);
|
||||||
};
|
};
|
||||||
|
|
||||||
bpmnTask.prototype.trim = function (str) {
|
bpmnTask.prototype.trim = function (str) {
|
||||||
|
|||||||
@@ -799,7 +799,7 @@ Ext.onReady ( function() {
|
|||||||
workflow.boundaryEvent = false;
|
workflow.boundaryEvent = false;
|
||||||
}
|
}
|
||||||
workflow.task_width='';
|
workflow.task_width='';
|
||||||
workflow.annotationName='';
|
workflow.annotationName='Annotation';
|
||||||
NewShape = eval("new "+data.name+"(workflow)");
|
NewShape = eval("new "+data.name+"(workflow)");
|
||||||
NewShape.x = e.xy[0];
|
NewShape.x = e.xy[0];
|
||||||
NewShape.y = e.xy[1];
|
NewShape.y = e.xy[1];
|
||||||
|
|||||||
Reference in New Issue
Block a user