saving Annotation with route from flowmenu

This commit is contained in:
girish
2011-02-23 10:46:57 +00:00
parent 17d3910481
commit 325a31227b
6 changed files with 233 additions and 219 deletions

View File

@@ -1585,12 +1585,12 @@ class processMap {
* @return string * @return string
*/ */
function addText($sProcessUID = '', $sLabel = '', $iX = 0, $iY = 0) { function addText($sProcessUID = '', $sLabel = '', $iX = 0, $iY = 0 , $sNext_uid = '') {
try { try {
$oProcess = new Process ( ); $oProcess = new Process ( );
$aFields = $oProcess->load($sProcessUID); $aFields = $oProcess->load($sProcessUID);
$oSL = new SwimlanesElements ( ); $oSL = new SwimlanesElements ( );
$oNewText->uid = $oSL->create(array('PRO_UID' => $sProcessUID, 'SWI_TYPE' => 'TEXT', 'SWI_TEXT' => $sLabel, 'SWI_X' => $iX, 'SWI_Y' => $iY)); $oNewText->uid = $oSL->create(array('PRO_UID' => $sProcessUID, 'SWI_TYPE' => 'TEXT', 'SWI_TEXT' => $sLabel, 'SWI_X' => $iX, 'SWI_Y' => $iY,'SWI_NEXT_UID' => $sNext_uid));
$oJSON = new Services_JSON ( ); $oJSON = new Services_JSON ( );
return $oJSON->encode($oNewText); return $oJSON->encode($oNewText);
} catch (Exception $oError) { } catch (Exception $oError) {

File diff suppressed because it is too large Load Diff

View File

@@ -871,23 +871,21 @@ MyWorkflow.prototype.handleContextMenu=function(oShape)
oShape.workflow.AddTaskContextMenu(oShape); oShape.workflow.AddTaskContextMenu(oShape);
} }
else if(oShape.type.match(/Start/)) { else if(oShape.type.match(/Start/)) {
oShape.workflow.taskUid = oShape.workflow.getStartEventConn(oShape,'targetPort','OutputPort'); oShape.workflow.taskUid = workflow.getStartEventConn(oShape,'targetPort','OutputPort');
pmosExtObj.loadDynaforms(oShape); pmosExtObj.loadDynaforms(oShape);
//if(oShape.type.match(/Message/))
//pmosExtObj.loadWebEntry(oShape);
oShape.workflow.AddEventStartContextMenu(oShape); oShape.workflow.AddEventStartContextMenu(oShape);
} }
else if(oShape.type.match(/Inter/)) { else if(oShape.type.match(/Inter/)) {
oShape.workflow.taskUidFrom = oShape.workflow.getStartEventConn(oShape,'sourcePort','InputPort'); oShape.workflow.taskUidFrom = workflow.getStartEventConn(oShape,'sourcePort','InputPort');
//oShape.workflow.taskid = oShape.workflow.taskUid[0]; //oShape.workflow.taskid = oShape.workflow.taskUid[0];
oShape.workflow.taskUidTo = oShape.workflow.getStartEventConn(oShape,'targetPort','OutputPort'); oShape.workflow.taskUidTo = workflow.getStartEventConn(oShape,'targetPort','OutputPort');
oShape.workflow.taskid = oShape.workflow.taskUidFrom[0]; oShape.workflow.taskid = oShape.workflow.taskUidFrom[0];
pmosExtObj.loadTask(oShape); pmosExtObj.loadTask(oShape);
pmosExtObj.getTriggerList(oShape); pmosExtObj.getTriggerList(oShape);
oShape.workflow.AddEventInterContextMenu(oShape); oShape.workflow.AddEventInterContextMenu(oShape);
} }
else if(oShape.type.match(/End/)) { else if(oShape.type.match(/End/)) {
oShape.workflow.taskUid = oShape.workflow.getStartEventConn(oShape,'sourcePort','InputPort'); oShape.workflow.taskUid = workflow.getStartEventConn(oShape,'sourcePort','InputPort');
oShape.workflow.AddEventEndContextMenu(oShape); oShape.workflow.AddEventEndContextMenu(oShape);
} }
else if(oShape.type.match(/Gateway/)) { else if(oShape.type.match(/Gateway/)) {
@@ -1078,7 +1076,11 @@ MyWorkflow.prototype.saveShape= function(oNewShape)
urlparams = '?action='+actiontype+'&data={"uid":"'+ pro_uid +'","position":'+pos+'}'; urlparams = '?action='+actiontype+'&data={"uid":"'+ pro_uid +'","position":'+pos+'}';
break; break;
case 'addText': case 'addText':
urlparams = '?action='+actiontype+'&data={"uid":"'+ pro_uid +'","label":"'+newlabel+'","position":'+pos+'}'; var next_uid = '';
var taskUidFrom = workflow.getStartEventConn(oNewShape,'sourcePort','OutputPort');
if(taskUidFrom.length > 0)
next_uid = taskUidFrom[0].value;
urlparams = '?action='+actiontype+'&data={"uid":"'+ pro_uid +'","label":"'+newlabel+'","task_uid":"'+ next_uid +'","position":'+pos+'}';
break; break;
case 'updateText': case 'updateText':
urlparams = '?action='+actiontype+'&data={"uid":"'+ shapeId +'","label":"'+newlabel+'"}'; urlparams = '?action='+actiontype+'&data={"uid":"'+ shapeId +'","label":"'+newlabel+'"}';
@@ -1379,8 +1381,10 @@ MyWorkflow.prototype.editEventProperties = function(oShape)
*/ */
MyWorkflow.prototype.getStartEventConn = function(oShape,sPort,sPortType) MyWorkflow.prototype.getStartEventConn = function(oShape,sPort,sPortType)
{ {
var aStartTask= new Array();
//Get all the ports of the shapes //Get all the ports of the shapes
var ports = oShape.workflow.currentSelection.getPorts(); if(workflow.currentSelection != null && typeof workflow.currentSelection != 'undefined') {
var ports = workflow.currentSelection.getPorts();
var len =ports.data.length; var len =ports.data.length;
//Get all the connection of the shape //Get all the connection of the shape
@@ -1392,7 +1396,7 @@ MyWorkflow.prototype.getStartEventConn = function(oShape,sPort,sPortType)
} }
//Initializing Arrays and variables //Initializing Arrays and variables
var countConn = 0; var countConn = 0;
var aStartTask= new Array();
var type; var type;
//Get ALL the connections for the specified PORT //Get ALL the connections for the specified PORT
for(i = 0; i< conn.length ; i++) for(i = 0; i< conn.length ; i++)
@@ -1413,7 +1417,8 @@ MyWorkflow.prototype.getStartEventConn = function(oShape,sPort,sPortType)
} }
} }
} }
return aStartTask; }
return aStartTask;
} }
/** /**
@@ -1684,8 +1689,8 @@ MyWorkflow.prototype.saveRoute = function(preObj,newObj)
Ext.Ajax.request({ Ext.Ajax.request({
url: "patterns_Ajax.php", url: "patterns_Ajax.php",
success: function(response) { success: function(response) {
if(response.responseText != 0){ if(response.responseText != 0) {
if(typeof newObj.conn != 'undefined'){ if(typeof newObj.conn != 'undefined') {
//var resp = response.responseText.split("|"); //resp[0] => gateway UID OR event_UID , resp[1] => route UID //var resp = response.responseText.split("|"); //resp[0] => gateway UID OR event_UID , resp[1] => route UID
var resp = response.responseText; //resp[0] => gateway UID OR event_UID , resp[1] => route UID var resp = response.responseText; //resp[0] => gateway UID OR event_UID , resp[1] => route UID
newObj.conn.html.id = resp; newObj.conn.html.id = resp;

View File

@@ -810,7 +810,6 @@ bpmnTask.prototype.addShapes = function (oStore) {
else if (newShape.type.match(/Annotation/)) { else if (newShape.type.match(/Annotation/)) {
conn.setTarget(newShape.getPort("input1")); conn.setTarget(newShape.getPort("input1"));
conn.setSource(workflow.currentSelection.getPort("output2")); conn.setSource(workflow.currentSelection.getPort("output2"));
//conn.targetDecorator.setStroke(Stroke.DOTTED);
workflow.addFigure(conn); workflow.addFigure(conn);
newShape.actiontype = 'addText'; newShape.actiontype = 'addText';
newShape.conn = conn; newShape.conn = conn;

View File

@@ -927,8 +927,16 @@ Ext.onReady ( function() {
} }
//Making Connections //Making Connections
var connObj = new DecoratedConnection(); var connObj = new DecoratedConnection();
connObj.setSource(sourceObj.output1);
connObj.setTarget(targetObj.input2); if(targetObj.type == 'bpmnAnnotation') {
connObj.setSource(sourceObj.output2);
connObj.setTarget(targetObj.input1);
}
else {
connObj.setSource(sourceObj.output1);
connObj.setTarget(targetObj.input2);
}
connObj.id = shapes.routes[i][0]; connObj.id = shapes.routes[i][0];
this.workflow.addFigure(connObj); this.workflow.addFigure(connObj);
} }

View File

@@ -580,7 +580,7 @@ pmosExt.prototype.popCaseSchedular= function(_5678){
fieldsToToggle = [fields[7]]; fieldsToToggle = [fields[7]];
oPmosExt.toggleFields(fieldsToToggle,false); oPmosExt.toggleFields(fieldsToToggle,false);
} }
this.setValue(record.data[this.valueField || this.displayField]); this.setValue(record.data[this.valueField || this.displayField]);
this.collapse(); this.collapse();
} }
@@ -692,13 +692,14 @@ pmosExt.prototype.popCaseSchedular= function(_5678){
var aSchWeek = new Array(); var aSchWeek = new Array();
aSchWeek = schedularData.SCH_WEEK_DAYS.substr(0,schedularData.SCH_WEEK_DAYS.length-1).split("|"); aSchWeek = schedularData.SCH_WEEK_DAYS.substr(0,schedularData.SCH_WEEK_DAYS.length-1).split("|");
for(var i=0;i<aSchWeek.length;i++) for(var i=0;i <aSchWeek.length; i++)
{ {
var index1 = aSchWeek[i]; var index1 = aSchWeek[i];
// timeFieldset.items.items[7].items.items[index1].checked = true;
} }
timeFieldset.items.items[6].setValue(0,1,2,3);
var index = propertiesFieldset.items.items[2].value; var index = propertiesFieldset.items.items[2].value;
timeFieldset.expand(); timeFieldset.expand();
var sch_month = credentialFieldset.items.items[9].getValue(); var sch_month = credentialFieldset.items.items[9].getValue();
var aSchMonth = new Array(); var aSchMonth = new Array();
@@ -765,7 +766,7 @@ pmosExt.prototype.popCaseSchedular= function(_5678){
credentialFieldset.items.items[8].setValue(sch_week_day); credentialFieldset.items.items[8].setValue(sch_week_day);
var sch_months = timeFieldset.items.items[8].getValue(); var sch_months = timeFieldset.items.items[8].getValue();
var sch_month = new Array(); var sch_month = new Array();
for(i=0;i< sch_months.length;i++) for(var i=0;i< sch_months.length;i++)
{ {
sch_month[i] = sch_months[i].name; sch_month[i] = sch_months[i].name;
} }