140 lines
59 KiB
JavaScript
140 lines
59 KiB
JavaScript
|
|
var PMConnectionDropBehavior=function(a){PMUI.behavior.ConnectionDropBehavior.call(this,a)};PMConnectionDropBehavior.prototype=new PMUI.behavior.ConnectionDropBehavior;PMConnectionDropBehavior.prototype.type="PMConnectionDropBehavior";
|
||
|
|
PMConnectionDropBehavior.prototype.basicRules={PMEvent:{PMEvent:{connection:"regular",type:"SEQUENCE"},PMActivity:{connection:"regular",type:"SEQUENCE"}},PMActivity:{PMActivity:{connection:"regular",type:"SEQUENCE"},PMArtifact:{connection:"dotted",destDecorator:"con_none",type:"ASSOCIATION"},PMIntermediateEvent:{connection:"regular",type:"SEQUENCE"},PMEndEvent:{connection:"regular",type:"SEQUENCE"},PMGateway:{connection:"regular",type:"SEQUENCE"}},PMStartEvent:{PMActivity:{connection:"regular",type:"SEQUENCE"},
|
||
|
|
PMIntermediateEvent:{connection:"regular",type:"SEQUENCE"},PMEndEvent:{connection:"regular",type:"SEQUENCE"},PMGateway:{connection:"regular",type:"SEQUENCE"}},PMIntermediateEvent:{PMActivity:{connection:"regular",type:"SEQUENCE"},PMIntermediateEvent:{connection:"regular",type:"SEQUENCE"},PMEndEvent:{connection:"regular",type:"SEQUENCE"},PMGateway:{connection:"regular",type:"SEQUENCE"}},PMBoundaryEvent:{PMActivity:{connection:"regular",type:"SEQUENCE"},PMIntermediateEvent:{connection:"regular",type:"SEQUENCE"},
|
||
|
|
PMEndEvent:{connection:"regular",type:"SEQUENCE"},PMGateway:{connection:"regular",type:"SEQUENCE"}},PMGateway:{PMActivity:{connection:"regular",type:"SEQUENCE"},PMIntermediateEvent:{connection:"regular",type:"SEQUENCE"},PMEndEvent:{connection:"regular",type:"SEQUENCE"},PMGateway:{connection:"regular",type:"SEQUENCE"}},PMArtifact:{PMActivity:{connection:"dotted",destDecorator:"con_none",type:"ASSOCIATION"}}};
|
||
|
|
PMConnectionDropBehavior.prototype.initRules={PMCanvas:{PMCanvas:{name:"PMCanvas to PMCanvas",rules:PMConnectionDropBehavior.prototype.basicRules}},PMActivity:{PMCanvas:{name:"PMActivity to PMCanvas",rules:PMConnectionDropBehavior.prototype.basicRules}}};
|
||
|
|
PMConnectionDropBehavior.prototype.dropStartHook=function(a,b,c){a.srcDecorator=null;a.destDecorator=null;b=c.draggable.attr("id");b=a.canvas.customShapes.find("id",b);var d;if(b)if(d=this.validate(b,a))a.setConnectionType({type:d.type,segmentStyle:d.connection,srcDecorator:d.srcDecorator,destDecorator:d.destDecorator});else if("undefined"!==typeof b){if(!(c.helper&&"drag-helper"===c.helper.attr("id")))return!1;a.setConnectionType("none")}return!0};
|
||
|
|
PMConnectionDropBehavior.prototype.validate=function(a,b){var c,d,e,g,h;e={PMEvent:{START:"PMStartEvent",END:"PMEndEvent",INTERMEDIATE:"PMIntermediateEvent",BOUNDARY:"PMBoundaryEvent"},bpmnArtifact:{TEXTANNOTATION:"bpmnAnnotation"}};if(a&&b){if(a.getID()===b.getID())return!1;if(this.initRules[a.getParent().getType()]&&this.initRules[a.getParent().getType()][b.getParent().getType()])if(g=this.initRules[a.getParent().getType()][b.getParent().getType()].rules,h=this.initRules[a.getParent().getType()][b.getParent().getType()].name,
|
||
|
|
c=a.getType(),d=b.getType(),"PMEvent"===c&&e[c]&&e[c][a.getEventType()]&&(c=e[c][a.getEventType()]),"PMEvent"===d&&e[d]&&e[d][b.getEventType()]&&(d=e[d][b.getEventType()]),e=g[c]&&g[c][d]?g[c][d]:!1,g)switch(h){case "bpmnPool to bpmnPool":a.getParent().getID()!==b.getParent().getID()&&(e=!1);break;case "bpmnLane to bpmnLane":a.getFirstPool(a.parent).getID()!==b.getFirstPool(b.parent).getID()&&(e=this.extraRules[c]&&this.extraRules[c][d]?this.extraRules[c][d]:!1);break;case "bpmnActivity to bpmnLane":e=
|
||
|
|
this.basicRules[c]&&this.basicRules[c][d]?this.basicRules[c][d]:!1}else e=!1;else c=a.getType(),d=b.getType(),"PMEvent"===c&&e[c]&&e[c][a.getEventType()]&&(c=e[c][a.getEventType()]),"PMEvent"===d&&e[d]&&e[d][b.getEventType()]&&(d=e[d][b.getEventType()]),e=this.advancedRules[c]&&this.advancedRules[c][d]?this.advancedRules[c][d]:!1;return e}};
|
||
|
|
PMConnectionDropBehavior.prototype.onDrop=function(a){return function(b,c){var d=a.getCanvas(),e=c.draggable.attr("id"),g,h,f,k,n;g=d.currentConnection;a.entered=!1;if(!a.drop.dropStartHook(a,b,c))return!1;if("none"===a.getConnectionType())return!0;g&&(f=g.srcPort,g=g.destPort,f=f.id===e?f:g.id===e?g:null);if(c.helper&&"drag-helper"===c.helper.attr("id")){e=a.canvas.connectionSegment.startPoint;h=a.canvas.connectionSegment.pointsTo;if(h.parent&&h.parent.id===a.id)return!0;h.setPosition(h.oldX,h.oldY);
|
||
|
|
e.x=e.portX;e.y=e.portY;f=new PMUI.draw.Port({width:10,height:10});g=new PMUI.draw.Port({width:10,height:10});k=c.offset.left-a.canvas.getX()-a.getAbsoluteX()+a.canvas.getLeftScroll();n=c.offset.top-a.canvas.getY()-a.getAbsoluteY()+a.canvas.getTopScroll();h.addPort(f,e.x,e.y);a.addPort(g,k,n,!1,f);e=new PMFlow({srcPort:f,destPort:g,canvas:a.canvas,segmentStyle:a.connectionType.segmentStyle,flo_type:a.connectionType.type});e.setSrcDecorator(new PMUI.draw.ConnectionDecorator({width:11,height:11,canvas:d,
|
||
|
|
decoratorPrefix:"undefined"!==typeof a.connectionType.srcDecorator&&null!==a.connectionType.srcDecorator?a.connectionType.srcDecorator:"PM-decorator",decoratorType:"source",parent:e}));e.setDestDecorator(new PMUI.draw.ConnectionDecorator({width:11,height:11,canvas:d,decoratorPrefix:"undefined"!==typeof a.connectionType.destDecorator&&null!==a.connectionType.destDecorator?a.connectionType.destDecorator:"PM-decorator",decoratorType:"target",parent:e}));e.canvas.commandStack.add(new PMUI.command.CommandConnect(e));
|
||
|
|
e.connect();e.setSegmentMoveHandlers();d.addConnection(e);e.setTargetShape(g.parent);e.setOriginShape(f.parent);e.savePoints();e.checkAndCreateIntersectionsWithAll();f.attachListeners(f);g.attachListeners(g);d.triggerCreateEvent(e,[])}else if(f&&(e=f.getConnection(),prop=e.srcPort.getID()===f.getID()?PMConnectionDropBehavior.prototype.validate(a,e.destPort.getParent()):PMConnectionDropBehavior.prototype.validate(e.srcPort.getParent(),a)))f.setOldParent(f.getParent()),f.setOldX(f.getX()),f.setOldY(f.getY()),
|
||
|
|
g=c.position.left,h=c.position.top,f.setPosition(g,h),a.dragging=!1,a.getID()!==f.parent.getID()?(f.parent.removePort(f),g=c.offset.left-d.getX()-a.absoluteX+a.canvas.getLeftScroll(),h=c.offset.top-d.getY()-a.absoluteY+a.canvas.getTopScroll(),a.addPort(f,g,h,!0),d.regularShapes.insert(f)):a.definePortPosition(f,f.getPoint(!0)),g={before:{condition:e.flo_condition,type:e.flo_type,segmentStyle:e.segmentStyle,srcDecorator:e.srcDecorator.getDecoratorPrefix(),destDecorator:e.destDecorator.getDecoratorPrefix()},
|
||
|
|
after:{type:prop.type,segmentStyle:prop.connection,srcDecorator:prop.srcDecorator,destDecorator:prop.destDecorator}},e.connect(),d.triggerPortChangeEvent(f),e=new PMCommandReconnect(f,g),d.commandStack.add(e);return!1}};var ToolbarPanel=function(a){ToolbarPanel.prototype.init.call(this,a)};ToolbarPanel.prototype=new PMUI.core.Panel;ToolbarPanel.prototype.type="ToolbarPanel";
|
||
|
|
ToolbarPanel.prototype.init=function(a){var b={buttons:[]};jQuery.extend(!0,b,a);PMUI.core.Panel.call(this,a);this.buttons=[];this.setButtons(b.buttons)};ToolbarPanel.prototype.setButtons=function(a){var b=this;jQuery.each(a,function(a,d){b.buttons.push(d)});return this};
|
||
|
|
ToolbarPanel.prototype.createHTMLButton=function(a){var b,c=PMUI.createHTMLElement("li"),d=PMUI.createHTMLElement("span");text=PMUI.createHTMLElement("span");c.title=a.tooltip;c.className="pm-toolbarpanel-btn";c.id=a.selector;for(b=0;b<a.className.length;b++)jQuery(d).addClass(a.className[b]);a.text?text.appendChild(document.createTextNode(a.text)):text.setAttribute("style","display:none;");text.className="pm-toolbarpanel-btn-span";c.appendChild(d);c.appendChild(text);return c};
|
||
|
|
ToolbarPanel.prototype.createHTML=function(){var a=this;PMUI.core.Panel.prototype.createHTML.call(this);jQuery.each(this.buttons,function(b,c){var d=a.createHTMLButton(c);c.html=d;a.html.appendChild(d)});jQuery(this.body).remove();return this.html};
|
||
|
|
ToolbarPanel.prototype.activate=function(){jQuery.each(this.buttons,function(a,b){jQuery(".pm-toolbarpanel-btn-img").tooltip({position:{my:"left+5 center",at:"right center"},tooltipClass:"pm-toolbarpanel-tooltip"});jQuery(b.html).draggable({opacity:0.7,helper:"clone",cursor:"hand"})});return this};ToolbarPanel.prototype.getSelectors=function(){var a=[];jQuery.each(this.buttons,function(b,c){a.push("#"+c.selector)});return a};
|
||
|
|
var PMCanvas=function(a){PMUI.draw.Canvas.call(this,a);this.enabledMenu=this.tree=this.process=null;PMCanvas.prototype.init.call(this,a)};PMCanvas.prototype=new PMUI.draw.Canvas;PMCanvas.prototype.type="PMCanvas";PMCanvas.prototype.init=function(a){var b={process:null,enabledMenu:!1,tree:{children:[{id:"root",text:""}]}};jQuery.extend(!0,b,a);this.setProcess(b.process).setTree(b.tree).setEnabledMenu(b.enabledMenu)};PMCanvas.prototype.setEnabledMenu=function(a){this.enabledMenu=a;return this};
|
||
|
|
PMCanvas.prototype.setProcess=function(a){a instanceof PMProcess&&(this.process=a);return this};PMCanvas.prototype.setTree=function(a){this.tree=a instanceof PMUI.panel.TreePanel?a:new PMUI.panel.TreePanel(a);return this};
|
||
|
|
PMCanvas.prototype.onCreateElementHandler=function(a){var b,c;console.log("Created",a);this.process&&(this.process.addElement(a),"Connection"!==a.type&&(b=this.tree.getItems()[0].id,c=a.relatedObject.labels.asArray()[0].message,c=""===c?a.type:c,newTreeItem=this.tree.addChildren(b,[{text:c}]),b=getMenuFactory("tree"),newTreeItem.setEnabledMenu(!0),newTreeItem.showMenu(b),newTreeItem.addRelationship({shape:a}),a.relatedObject.addRelationship({treeItem:newTreeItem})))};
|
||
|
|
PMCanvas.prototype.triggerCreateEvent=function(a,b){var c=getMenuFactory(a.extendedType);a.showMenu(c);this.updatedElement={id:a&&a.id||null,type:a&&a.type||null,relatedObject:a,relatedElements:b};$(this.html).trigger("createelement");return this};
|
||
|
|
PMCanvas.prototype.onChangeElementHandler=function(a){var b,c;console.log("Updated",a);if(this.process&&0<a.length){c=a[0];switch(c.type){case "Label":b=c.parent.relationship.treeItem.id,c=""===a[0].fields[0].newVal?c.parent.type:a[0].fields[0].newVal,this.tree.changeTextChild(b,c)}this.process.updateElement(a)}};
|
||
|
|
PMCanvas.prototype.onRemoveElementHandler=function(a){var b;console.log("Removed",a);if(this.process){this.process.removeElement(a);try{for(b=0;b<a.length;b++)"Connection"!==a[b].type&&"object"===typeof a[b].relationship.treeItem&&(treeItem=a[b].relationship.treeItem,this.tree.removeItem(treeItem))}catch(c){throw Error(__translations.errorRemoveElementHandler);}}};PMCanvas.prototype.onSelectElementHandler=function(a){console.log("Selected",a);if(1===a.length)switch(a[0].type){case "PMActivity":case "PMEvent":case "PMGateway":a[0].relatedObject.relationship.treeItem.setItemSelected()}return this};
|
||
|
|
var PMProcess=function(a){this.id=this.localProxy=this.remoteProxy=null;this.dirty=!1;this.name=null;this.waitingResponse=!1;this.saveInterval=5E4;this.canvas=null;this.dirtyElements=[{activities:{},events:{},gateways:{},flows:{},artifacts:{}},{activities:{},events:{},gateways:{},flows:{},artifacts:{}}];PMProcess.prototype.init.call(this,a)};PMProcess.prototype.type="PMProcess";PMProcess.prototype.family="PMProcess";
|
||
|
|
PMProcess.prototype.init=function(a){var b={canvas:null,remoteProxy:null,localProxy:null};jQuery.extend(!0,b,a);this.setId(b.id).setName(b.name).setCanvas(b.canvas).setRemoteProxy(b.remoteProxy).setLocalProxy(b.localProxy);this.remoteProxy=new PMUI.proxy.RestProxy({url:"/sysworkflow/en/neoclassic/fakeApi/save"})};PMProcess.prototype.setId=function(a){this.id=a;return this};PMProcess.prototype.setName=function(a){this.name=a;return this};
|
||
|
|
PMProcess.prototype.setSaveInterval=function(a){this.saveInterval=a;return this};PMProcess.prototype.setCanvas=function(a){this.canvas=a;return this};PMProcess.prototype.setRemoteProxy=function(a){this.remoteProxy=a;return this};PMProcess.prototype.setLocalProxy=function(a){this.localProxy=a;return this};PMProcess.prototype.isDirty=function(){return this.dirty};PMProcess.prototype.isWaitingResponse=function(){return this.waitingResponse};
|
||
|
|
PMProcess.prototype.setWaitingResponse=function(a){this.waitingResponse=a;return this};PMProcess.prototype.formatProperty=function(a,b){var c={PMActivity:"act",PMGateway:"gat",PMEvent:"evn",PMArtifact:"art"},d={x:"bou_x",y:"bou_y",width:"bou_width",height:"bou_height"};return"PMFlow"===a||"Connection"===a?"flo_"+b:d[b]?d[b]:c[a]+"_"+b};
|
||
|
|
PMProcess.prototype.getUpdateList=function(a){var b;b=this.isWaitingResponse()?1:0;return this.dirtyElements[b][{PMActivity:"activities",PMGateway:"gateways",PMEvent:"events",PMFlow:"flows",PMArtifact:"artifacts",Connection:"flows"}[a]]};PMProcess.prototype.getDirtyObject=function(){var a;a=this.dirtyElements[0];a.pro_uid=this.id;return a};
|
||
|
|
PMProcess.prototype.addElement=function(a){var b,c,d,e;if(0<a.relatedElements.length)for(d=0;d<a.relatedElements.length;d+=1){e=a.relatedElements[d];c=this.getUpdateList(e.type);if(void 0===c)return;b=e.getDataObject();b._action="CREATE";c[e.id]=b}else switch(a.type){case "Connection":b=this.formatProperty(a.type,"uid");c=this.getUpdateList(a.type);a.relatedObject[b]=a.id;b="undefined"===typeof a.relatedObject.getDataObject?a.relatedObject:a.relatedObject.getDataObject();b._action="CREATE";c[a.id]=
|
||
|
|
b;break;default:b=this.formatProperty(a.type,"uid"),c=this.getUpdateList(a.type),a.relatedObject[b]=a.id,b=a.relatedObject.getDataObject(),b._action="CREATE",c[a.id]=b}this.dirty=!0;this.updateToolbar()};
|
||
|
|
PMProcess.prototype.updateElement=function(a){var b,c,d,e;for(c=0;c<a.length;c+=1){b=a[c];e=this.getUpdateList(b.type);if(void 0===e)return;d=this.formatObject(b);e[b.id]?(jQuery.extend(!0,e[b.id],d),"Connection"===b.type&&(e[b.id].flo_state=d.flo_state)):(d._action="UPDATE",e[b.id]=d)}this.dirty=!0;this.updateToolbar()};
|
||
|
|
PMProcess.prototype.removeElement=function(a){var b,c,d,e,g,h={};for(d=0;d<a.length;d+=1){c=a[d];g=this.getUpdateList(c.type);if(void 0===g)return;e=this.formatProperty(c.type,"uid");g[c.id]?"CREATE"===g[c.id]._action?delete g[c.id]:g[c.id]._action="REMOVE":(b={_action:"REMOVE"},b[e]=c.id,jQuery.extend(!0,c,b),g[c.id]=c)}this.dirty=!0;if(!this.isWaitingResponse()&&(a=(a=(a=(a=(a=this.dirtyElements[0].activities===h)&&this.dirtyElements[0].gateways===h)&&this.dirtyElements[0].events===h)&&this.dirtyElements[0].artifacts===
|
||
|
|
h)&&this.dirtyElements[0].flows===h))this.dirty=!1;this.updateToolbar()};PMProcess.prototype.formatObject=function(a){var b,c,d={},e;d[this.formatProperty(a.type,"uid")]=a.id;if(a.adam)for(b=0;b<a.fields.length;b+=1)c=a.fields[b],d[c.field]=c.newVal;else for(b=0;b<a.fields.length;b+=1)c=a.fields[b],e=this.formatProperty(a.type,c.field),"element_uid"===e&&(c.newVal=c.newVal.id),d[e]=c.newVal;return d};PMProcess.prototype.updateToolbar=function(){};
|
||
|
|
PMProcess.prototype.updateDirtyProcess=function(){this.dirty=!1;this.dirtyElements[0]=this.dirtyElements[1];this.dirtyElements[1]={activities:{},events:{},gateways:{},flows:{},artifacts:{}};this.updateToolbar()};
|
||
|
|
PMProcess.prototype.save=function(){var a=this;this.isDirty()&&(this.setWaitingResponse(!0),this.remoteProxy&&(this.remoteProxy.setData(this.getDirtyObject()),this.remoteProxy.success=function(b,c){console.log("OK",c);a.updateDirtyProcess();a.setWaitingResponse(!1);alert("App saved...")},this.remoteProxy.failure=function(b,c){console.log("Failure",c);a.setWaitingResponse(!1)},this.remoteProxy.send()))};
|
||
|
|
var PMShape=function(a){PMUI.draw.CustomShape.call(this,a);this.relationship=this.extendedType=this.extended=null;this.label=this.labels.get(0);PMShape.prototype.init.call(this,a)};PMShape.prototype=new PMUI.draw.CustomShape;PMShape.prototype.type="PMShape";PMShape.prototype.init=function(a){var b={extended:{},relationship:{},enabledMenu:!1};jQuery.extend(!0,b,a);this.setExtended(b.extended).setExtendedType(b.extendedType).setRelationship(b.relationship)};
|
||
|
|
PMShape.prototype.setName=function(a){this.label&&this.label.setMessage(a);return this};PMShape.prototype.getName=function(){var a="";this.label&&(a=this.label.getMessage());return a};PMShape.prototype.getContextMenu=function(){return{}};PMShape.prototype.setExtendedType=function(a){this.extendedType=a;return this};PMShape.prototype.getDataObject=function(){return{}};PMShape.prototype.setRelationship=function(a){this.relationship=a;return this};
|
||
|
|
PMShape.prototype.addRelationship=function(a){"object"===typeof a&&jQuery.extend(!0,this.relationship,a);return this};PMShape.prototype.setExtended=function(a){this.extended="object"===typeof a?a:{};return this};PMShape.prototype.getExtendedObject=function(){return this.extended};
|
||
|
|
PMShape.prototype.setDropBehavior=function(a){this.drop=(new PMUI.behavior.BehaviorFactory({products:{pmconnection:PMConnectionDropBehavior,connectioncontainer:PMUI.behavior.ConnectionContainerDropBehavior,connection:PMUI.behavior.ConnectionDropBehavior,container:PMUI.behavior.ContainerDropBehavior,nodrop:PMUI.behavior.NoDropBehavior},defaultProduct:"nodrop"})).make(a);return this};
|
||
|
|
var PMActivity=function(a){PMShape.call(this,a);this.act_master_diagram=this.act_default_flow=this.act_referer=this.act_is_global=this.act_method=this.act_protocol=this.act_cancel_remaining_instances=this.act_ordering=this.act_completion_condition=this.act_is_collapsed=this.act_is_adhoc=this.act_loop_behavior=this.act_loop_cardinality=this.act_loop_condition=this.act_loop_maximum=this.act_test_before=this.act_loop_type=this.act_script=this.act_script_type=this.act_instantiate=this.act_implementation=
|
||
|
|
this.act_task_type=this.act_completion_quantity=this.act_start_quantity=this.act_is_for_compensation=this.act_type=this.act_name=this.act_uid=null;this.boundaryPlaces=new PMUI.util.ArrayList;this.boundaryArray=new PMUI.util.ArrayList;this.markersArray=new PMUI.util.ArrayList;PMActivity.prototype.init.call(this,a)};PMActivity.prototype=new PMShape;PMActivity.prototype.type="PMActivity";PMActivity.prototype.activityContainerBehavior=null;PMActivity.prototype.activityResizeBehavior=null;
|
||
|
|
PMActivity.prototype.init=function(a){var b={act_type:"TASK",act_name:"Task",act_loop_type:"NONE",act_is_for_compensation:!1,act_task_type:"EMPTY",act_is_collapsed:!1,act_is_global:!1,act_loop_cardinality:0,act_loop_maximum:0,act_start_quantity:1,act_is_adhoc:!1,act_cancel_remaining_instances:!0,act_instantiate:!1,act_completion_quantity:0,act_implementation:"",act_script:"",act_script_type:"",act_default_flow:0,minHeight:50,minWidth:100,maxHeight:500,maxWidth:600};jQuery.extend(!0,b,a);this.setActivityUid(b.act_uid).setActName(b.act_name).setActivityType(b.act_type).setLoopType(b.act_loop_type).setIsForCompensation(b.act_is_for_compensation).setTaskType(b.act_task_type).setIsCollapsed(b.act_is_collapsed).setIsGlobal(b.act_is_global).setLoopCardinality(b.act_loop_cardinality).setLoopMaximun(b.act_loop_maximum).setStartQuantity(b.act_start_quantity).setIsAdhoc(b.act_is_adhoc).setCancelRemainingInstances(b.act_cancel_remaining_instances).setInstantiate(b.act_instantiate).setImplementation(b.act_implementation).setCompletionQuantity(b.act_completion_quantity).setScript(b.act_script).setScriptType(b.act_script_type).setDefaultFlow(b.act_default_flow).setMinHeight(b.minHeight).setMinWidth(b.minWidth).setMaxHeight(b.maxHeight).setMaxWidth(b.maxWidth);
|
||
|
|
b.markers&&this.addMarkers(b.markers,this)};PMActivity.prototype.getActivityType=function(){return this.act_type};PMActivity.prototype.getIsForCompensation=function(){return this.act_is_for_compensation};PMActivity.prototype.getCancelRemainingInstances=function(){return this.act_cancel_remaining_instances};PMActivity.prototype.getCompletionQuantity=function(){return this.act_completion_quantity};PMActivity.prototype.getIsGlobal=function(){return this.act_is_global};
|
||
|
|
PMActivity.prototype.getStartQuantity=function(){return this.act_start_quantity};PMActivity.prototype.getInstantiate=function(){return this.act_instantiate};PMActivity.prototype.getImplementation=function(){return this.act_implementation};PMActivity.prototype.getScript=function(){return this.act_script};PMActivity.prototype.getScriptType=function(){return this.act_script_type};PMActivity.prototype.getMinHeight=function(){return this.minHeight};PMActivity.prototype.getMinWidth=function(){return this.minWidth};
|
||
|
|
PMActivity.prototype.getMaxHeight=function(){return this.maxHeight};PMActivity.prototype.getMaxWidth=function(){return this.maxWidth};PMActivity.prototype.setActivityUid=function(a){this.act_uid=a;return this};PMActivity.prototype.setActivityType=function(a){this.act_type=a;return this};PMActivity.prototype.setImplementation=function(a){this.act_implementation=a;return this};PMActivity.prototype.setLoopType=function(a){this.act_loop_type=a;return this};
|
||
|
|
PMActivity.prototype.setIsCollapsed=function(a){_.isBoolean(a)&&(this.act_is_collapsed=a);return this};PMActivity.prototype.setIsForCompensation=function(a){_.isBoolean(a)&&(this.act_is_for_compensation=a);return this};PMActivity.prototype.setTaskType=function(a){this.act_task_type=a;return this};PMActivity.prototype.setIsGlobal=function(a){_.isBoolean(a)&&(this.act_is_global=a);return this};PMActivity.prototype.setLoopCardinality=function(a){this.act_loop_cardinality=a;return this};
|
||
|
|
PMActivity.prototype.setLoopMaximun=function(a){this.act_loop_maximum=a;return this};PMActivity.prototype.setStartQuantity=function(a){this.act_start_quantity=a;return this};PMActivity.prototype.setIsAdhoc=function(a){_.isBoolean(a)&&(this.act_is_adhoc=a);return this};PMActivity.prototype.setCancelRemainingInstances=function(a){_.isBoolean(a)&&(this.act_cancel_remaining_instances=a);return this};PMActivity.prototype.setInstantiate=function(a){_.isBoolean(a)&&(this.act_instantiate=a);return this};
|
||
|
|
PMActivity.prototype.setCompletionQuantity=function(a){this.act_completion_quantity=a;return this};PMActivity.prototype.setScript=function(a){this.act_script=a;return this};PMActivity.prototype.setScriptType=function(a){this.act_script_type=a;return this};PMActivity.prototype.setDefaultFlow=function(a){this.html&&(PMShape.prototype.setDefaultFlow.call(this,a),this.canvas.triggerCommandAdam(this,["act_default_flow"],[this.act_default_flow],[a]));this.act_default_flow=a;return this};
|
||
|
|
PMActivity.prototype.setMinHeight=function(a){this.minHeight=a;return this};PMActivity.prototype.setMinWidth=function(a){this.minWidth=a;return this};PMActivity.prototype.setMaxHeight=function(a){this.maxHeight=a;return this};PMActivity.prototype.setMaxWidth=function(a){this.maxWidth=a;return this};PMActivity.prototype.setActType=function(a){this.act_type=a;return this};PMActivity.prototype.setActName=function(a){this.act_name=a;return this};
|
||
|
|
PMActivity.prototype.getDataObject=function(){return{act_uid:this.id,act_name:this.act_name,act_type:this.act_type,act_task_type:this.act_task_type,act_is_for_compensation:this.act_is_for_compensation,act_start_quantity:this.act_start_quantity,act_completion_quantity:this.act_completion_quantity,act_implementation:this.act_implementation,act_instantiate:this.act_instantiate,act_script_type:this.act_script_type,act_script:this.act_script,act_loop_type:this.act_loop_type,act_test_before:this.act_test_before,
|
||
|
|
act_loop_maximum:this.act_loop_maximum,act_loop_condition:this.act_loop_condition,act_loop_cardinality:this.act_loop_cardinality,act_loop_behavior:this.act_loop_behavior,act_is_adhoc:this.act_is_adhoc,act_is_collapsed:this.act_is_collapsed,act_completion_condition:this.act_completion_condition,act_ordering:this.act_ordering,act_cancel_remaining_instances:this.act_cancel_remaining_instances,act_protocol:this.act_protocol,act_method:this.act_method,act_is_global:this.act_is_global,act_referer:this.act_referer,
|
||
|
|
act_default_flow:this.act_default_flow,act_master_diagram:this.act_master_diagram,bou_x:this.x,bou_y:this.y,bou_width:this.width,bou_height:this.height,bou_container:"bpmnDiagram",bou_element_id:this.canvas.id,_extended:this.getExtendedObject()}};PMActivity.prototype.getMarkers=function(){return this.markersArray};
|
||
|
|
PMActivity.prototype.containerBehaviorFactory=function(a){"activity"===a?(this.activityContainerBehavior||(this.activityContainerBehavior=new PMActivityContainerBehavior),a=this.activityContainerBehavior):a=PMShape.prototype.containerBehaviorFactory.call(this,a);return a};
|
||
|
|
PMActivity.prototype.resizeBehaviorFactory=function(a){"activityResize"===a?(this.activityResizeBehavior||(this.activityResizeBehavior=new PMActivityResizeBehavior),a=this.activityResizeBehavior):a=PMShape.prototype.resizeBehaviorFactory.call(this,a);return a};
|
||
|
|
PMActivity.prototype.makeBoundaryPlaces=function(){var a,b,c,d=0,e=this.boundaryArray.getFirst(),g=0,h=0,f=0,k=0;b=e.parent.getHeight()-e.getHeight()/2;for(a=e.parent.getWidth()-(g+1)*(e.getWidth()+3);0<a+e.getWidth()/2;)c={},c.x=a,c.y=b,c.available=!0,c.number=d,c.location="BOTTOM",e.parent.boundaryPlaces.insert(c),d+=1,g+=1,a=e.parent.getWidth()-(g+1)*(e.getWidth()+3);b=e.parent.getHeight()-(h+1)*(e.getHeight()+3);for(a=-e.getHeight()/2;0<b+e.getHeight()/2;)c={},c.x=a,c.y=b,c.available=!0,c.number=
|
||
|
|
d,c.location="LEFT",e.parent.boundaryPlaces.insert(c),d+=1,h+=1,b=e.parent.getHeight()-(h+1)*(e.getHeight()+3);b=-e.getWidth()/2;for(a=f*(e.getWidth()+3);a+e.getWidth()/2<e.parent.getWidth();)c={},c.x=a,c.y=b,c.available=!0,c.number=d,c.location="TOP",e.parent.boundaryPlaces.insert(c),d+=1,f+=1,a=f*(e.getWidth()+3);b=k*(e.getHeight()+3);for(a=e.parent.getWidth()-e.getWidth()/2;b+e.getHeight()/2<e.parent.getHeight();)c={},c.x=a,c.y=b,c.available=!0,c.number=d,c.location="RIGHT",e.parent.boundaryPlaces.insert(c),
|
||
|
|
d+=1,k+=1,b=k*(e.getHeight()+3);return this};PMActivity.prototype.setBoundary=function(a,b){var c=this.boundaryPlaces.get(b);c.available=!1;a.setPosition(c.x,c.y);return this};PMActivity.prototype.getAvailableBoundaryPlace=function(){var a=0,b,c=!0,d;for(d=0;d<this.boundaryPlaces.getSize();d+=1)b=this.boundaryPlaces.get(d),b.available&&c&&(a=b.number,c=!1);c&&(a=!1);return a};
|
||
|
|
PMActivity.prototype.updateBoundaryPlaces=function(){var a,b,c=0;b=new jCore.ArrayList;for(a=0;a<this.boundaryPlaces.getSize();a+=1)b.insert(this.boundaryPlaces.get(a));this.boundaryPlaces.clear();this.makeBoundaryPlaces();for(a=0;a<this.boundaryPlaces.getSize();a+=1)c<b.getSize()&&(this.boundaryPlaces.get(a).available=b.get(c).available,c+=1);return this};
|
||
|
|
PMActivity.prototype.getNumberOfBoundaries=function(){var a,b,c=0;for(b=0;b<this.getChildren().getSize();b+=1)a=this.getChildren().get(b),"PMEvent"===a.getType()&&"BOUNDARY"===a.evn_type&&(c+=1);return c};
|
||
|
|
PMActivity.prototype.updateBoundaryPositions=function(a){var b,c,d,e;if(0<this.getNumberOfBoundaries()){this.updateBoundaryPlaces();for(d=0;d<this.getChildren().getSize();d+=1)if(b=this.getChildren().get(d),"PMEvent"===b.getType()&&"BOUNDARY"===b.evn_type){b.setPosition(this.boundaryPlaces.get(b.numberRelativeToActivity).x,this.boundaryPlaces.get(b.numberRelativeToActivity).y);for(e=0;e<b.ports.getSize();e+=1)c=b.ports.get(e),c.setPosition(c.x,c.y),c.connection.disconnect().connect(),a&&(c.connection.setSegmentMoveHandlers(),
|
||
|
|
c.connection.checkAndCreateIntersectionsWithAll())}}};PMActivity.prototype.addMarkers=function(a,b){var c,d;if(_.isArray(a))for(c=0;c<a.length;c+=1)d=a[c],d.parent=b,d.canvas=b.canvas;return this};PMActivity.prototype.getActivityType=function(){return this.act_type};PMActivity.prototype.getContextMenu=function(){};PMActivity.prototype.updateDefaultFlow=function(a){this.act_default_flow=a;return this};PMActivity.prototype.updateTaskType=function(a){return this};
|
||
|
|
PMActivity.prototype.updateScriptType=function(a){return this};
|
||
|
|
var PMEvent=function(a){PMShape.call(this,a);this.evn_marker=this.evn_type=this.evn_uid=null;this.evn_is_interrupting=!0;this.evn_attached_to=null;this.evn_cancel_activity=!1;this.evn_activity_ref=null;this.evn_wait_for_completion=!1;this.evn_behavior=this.evn_time_duration=this.evn_time_cycle=this.evn_time_date=this.evn_operation_implementation_ref=this.evn_operation_name=this.evn_message=this.evn_condition=this.evn_escalation_code=this.evn_escalation_name=this.evn_error_code=this.evn_error_name=
|
||
|
|
null;this.numberRelativeToActivity=0;PMEvent.prototype.init.call(this,a)};PMEvent.prototype=new PMShape;PMEvent.prototype.type="PMEvent";
|
||
|
|
PMEvent.prototype.init=function(a){var b={evn_uid:"",evn_is_interrupting:!0,evn_message:"",evn_marker:"EMPTY",evn_type:"start",evn_behavior:"catch"};jQuery.extend(!0,b,a);this.setEventUid(b.evn_uid).setEventType(b.evn_type).setEventMarker(b.evn_marker).setEventMessage(b.evn_message).setBehavior(b.evn_behavior).setCondition(b.evn_condition).setAttachedTo(b.evn_attached_to).setIsInterrupting(b.evn_is_interrupting);b.evn_name&&this.setName(b.evn_name)};
|
||
|
|
PMEvent.prototype.getDataObject=function(){var a,b,c=this.getName();"BOUNDARY"===this.evn_type?(a="bpmnActivity",b=this.evn_attached_to):(a="bpmnDiagram",b=this.canvas.id);return{evn_uid:this.id,evn_name:c,evn_type:this.evn_type,evn_marker:this.evn_marker,evn_is_interrupting:this.evn_is_interrupting,evn_attached_to:this.evn_attached_to,evn_cancel_activity:this.evn_cancel_activity,evn_activity_ref:this.evn_activity_ref,evn_wait_for_completion:this.evn_wait_for_completion,evn_error_name:this.evn_error_name,
|
||
|
|
evn_error_code:this.evn_error_code,evn_escalation_name:this.evn_escalation_name,evn_escalation_code:this.evn_escalation_code,evn_condition:this.evn_condition,evn_message:this.evn_message,evn_operation_name:this.evn_operation_name,evn_operation_implementation_ref:this.evn_operation_implementation_ref,evn_time_date:this.evn_time_date,evn_time_cycle:this.evn_time_cycle,evn_time_duration:this.evn_time_duration,evn_behavior:this.evn_behavior,bou_x:this.x,bou_y:this.y,bou_width:this.width,bou_height:this.height,
|
||
|
|
bou_container:a,bou_element_id:b,_extended:this.getExtendedObject()}};PMEvent.prototype.setEventUid=function(a){this.evn_uid=a;return this};PMEvent.prototype.setEventType=function(a){var b={start:"START",end:"END",intermediate:"INTERMEDIATE",boundary:"BOUNDARY"};b[a]&&(this.evn_type=b[a]);return this};PMEvent.prototype.setEventMarker=function(a){this.evn_marker=a;return this};PMEvent.prototype.setIsInterrupting=function(a){_.isBoolean(a)&&(this.evn_is_interrupting=a);return this};
|
||
|
|
PMEvent.prototype.setBehavior=function(a){var b={"catch":"CATCH","throw":"THROW"};b[a]&&(this.evn_behavior=b[a]);return this};PMEvent.prototype.setAttachedTo=function(a,b){"undefined"!==typeof b?_.isBoolean(b)&&(this.evn_cancel_activity=b):this.evn_cancel_activity=this.evn_cancel_activity||!1;this.evn_attached_to=a;return this};
|
||
|
|
PMEvent.prototype.destroy=function(){"PMEvent"===this.getType()&&"BOUNDARY"===this.getEventType()&&(this.parent.boundaryPlaces&&null!==this.numberRelativeToActivity)&&(this.parent.boundaryPlaces.get(this.numberRelativeToActivity).available=!0,this.parent.boundaryArray.remove(this));return this};PMEvent.prototype.setEventMessage=function(a){this.evn_message=a;return this};PMEvent.prototype.setCondition=function(a){this.evn_condition=a;return this};
|
||
|
|
PMEvent.prototype.setCompensationActivity=function(a,b){"undefined"!==typeof b?_.isBoolean(b)&&(this.evn_wait_for_completion=b):this.evn_wait_for_completion=this.evn_wait_for_completion||!1;this.evn_activity_ref=a;return this};PMEvent.prototype.setEventError=function(a,b){this.evn_error_name=a;this.evn_error_code=b;return this};PMEvent.prototype.setEventEscalation=function(a,b){this.evn_escalation_name=a;this.evn_escalation_code=b;return this};
|
||
|
|
PMEvent.prototype.setEventOperation=function(a,b){this.evn_operation_name=a;this.evn_operation_implementation_ref=b;return this};PMEvent.prototype.setEventTimer=function(a,b,c){this.evn_time_date=a;this.evn_time_cycle=b;this.evn_time_duration=c;return this};PMEvent.prototype.setDefaultFlow=function(a){PMShape.prototype.setDefaultFlow.call(this,a);this.evn_default_flow=a;return this};
|
||
|
|
PMEvent.prototype.attachToActivity=function(){var a=this.parent.getAvailableBoundaryPlace();!1!==a?(this.parent.setBoundary(this,a),this.setNumber(a)):(this.destroy(),this.saveAndDestroy());return this};PMEvent.prototype.setNumber=function(a){this.numberRelativeToActivity=a;return this};PMEvent.prototype.getEventType=function(){return this.evn_type};PMEvent.prototype.getEventMarker=function(){return this.evn_marker};PMEvent.prototype.getEventMessage=function(){return this.evn_message};
|
||
|
|
PMEvent.prototype.stringify=function(){var a=PMShape.prototype.stringify.call(this),b={evn_marker:this.getEventMarker(),evn_message:this.getEventMessage(),evn_condition:this.evn_condition,evn_attached_to:this.evn_attached_to,evn_is_interrupting:this.evn_is_interrupting,evn_behavior:this.evn_behavior};jQuery.extend(!0,a,b);return a};
|
||
|
|
PMActivity=function(a){PMShape.call(this,a);this.act_master_diagram=this.act_default_flow=this.act_referer=this.act_is_global=this.act_method=this.act_protocol=this.act_cancel_remaining_instances=this.act_ordering=this.act_completion_condition=this.act_is_collapsed=this.act_is_adhoc=this.act_loop_behavior=this.act_loop_cardinality=this.act_loop_condition=this.act_loop_maximum=this.act_test_before=this.act_loop_type=this.act_script=this.act_script_type=this.act_instantiate=this.act_implementation=
|
||
|
|
this.act_task_type=this.act_completion_quantity=this.act_start_quantity=this.act_is_for_compensation=this.act_type=this.act_name=this.act_uid=null;this.boundaryPlaces=new PMUI.util.ArrayList;this.boundaryArray=new PMUI.util.ArrayList;this.markersArray=new PMUI.util.ArrayList;PMActivity.prototype.init.call(this,a)};PMActivity.prototype=new PMShape;PMActivity.prototype.type="PMActivity";PMActivity.prototype.activityContainerBehavior=null;PMActivity.prototype.activityResizeBehavior=null;
|
||
|
|
PMActivity.prototype.init=function(a){var b={act_type:"TASK",act_name:"Task",act_loop_type:"NONE",act_is_for_compensation:!1,act_task_type:"EMPTY",act_is_collapsed:!1,act_is_global:!1,act_loop_cardinality:0,act_loop_maximum:0,act_start_quantity:1,act_is_adhoc:!1,act_cancel_remaining_instances:!0,act_instantiate:!1,act_completion_quantity:0,act_implementation:"",act_script:"",act_script_type:"",act_default_flow:0,minHeight:50,minWidth:100,maxHeight:500,maxWidth:600};jQuery.extend(!0,b,a);this.setActivityUid(b.act_uid).setActName(b.act_name).setActivityType(b.act_type).setLoopType(b.act_loop_type).setIsForCompensation(b.act_is_for_compensation).setTaskType(b.act_task_type).setIsCollapsed(b.act_is_collapsed).setIsGlobal(b.act_is_global).setLoopCardinality(b.act_loop_cardinality).setLoopMaximun(b.act_loop_maximum).setStartQuantity(b.act_start_quantity).setIsAdhoc(b.act_is_adhoc).setCancelRemainingInstances(b.act_cancel_remaining_instances).setInstantiate(b.act_instantiate).setImplementation(b.act_implementation).setCompletionQuantity(b.act_completion_quantity).setScript(b.act_script).setScriptType(b.act_script_type).setDefaultFlow(b.act_default_flow).setMinHeight(b.minHeight).setMinWidth(b.minWidth).setMaxHeight(b.maxHeight).setMaxWidth(b.maxWidth);
|
||
|
|
b.markers&&this.addMarkers(b.markers,this)};PMActivity.prototype.getActivityType=function(){return this.act_type};PMActivity.prototype.getIsForCompensation=function(){return this.act_is_for_compensation};PMActivity.prototype.getCancelRemainingInstances=function(){return this.act_cancel_remaining_instances};PMActivity.prototype.getCompletionQuantity=function(){return this.act_completion_quantity};PMActivity.prototype.getIsGlobal=function(){return this.act_is_global};
|
||
|
|
PMActivity.prototype.getStartQuantity=function(){return this.act_start_quantity};PMActivity.prototype.getInstantiate=function(){return this.act_instantiate};PMActivity.prototype.getImplementation=function(){return this.act_implementation};PMActivity.prototype.getScript=function(){return this.act_script};PMActivity.prototype.getScriptType=function(){return this.act_script_type};PMActivity.prototype.getMinHeight=function(){return this.minHeight};PMActivity.prototype.getMinWidth=function(){return this.minWidth};
|
||
|
|
PMActivity.prototype.getMaxHeight=function(){return this.maxHeight};PMActivity.prototype.getMaxWidth=function(){return this.maxWidth};PMActivity.prototype.setActivityUid=function(a){this.act_uid=a;return this};PMActivity.prototype.setActivityType=function(a){this.act_type=a;return this};PMActivity.prototype.setImplementation=function(a){this.act_implementation=a;return this};PMActivity.prototype.setLoopType=function(a){this.act_loop_type=a;return this};
|
||
|
|
PMActivity.prototype.setIsCollapsed=function(a){_.isBoolean(a)&&(this.act_is_collapsed=a);return this};PMActivity.prototype.setIsForCompensation=function(a){_.isBoolean(a)&&(this.act_is_for_compensation=a);return this};PMActivity.prototype.setTaskType=function(a){this.act_task_type=a;return this};PMActivity.prototype.setIsGlobal=function(a){_.isBoolean(a)&&(this.act_is_global=a);return this};PMActivity.prototype.setLoopCardinality=function(a){this.act_loop_cardinality=a;return this};
|
||
|
|
PMActivity.prototype.setLoopMaximun=function(a){this.act_loop_maximum=a;return this};PMActivity.prototype.setStartQuantity=function(a){this.act_start_quantity=a;return this};PMActivity.prototype.setIsAdhoc=function(a){_.isBoolean(a)&&(this.act_is_adhoc=a);return this};PMActivity.prototype.setCancelRemainingInstances=function(a){_.isBoolean(a)&&(this.act_cancel_remaining_instances=a);return this};PMActivity.prototype.setInstantiate=function(a){_.isBoolean(a)&&(this.act_instantiate=a);return this};
|
||
|
|
PMActivity.prototype.setCompletionQuantity=function(a){this.act_completion_quantity=a;return this};PMActivity.prototype.setScript=function(a){this.act_script=a;return this};PMActivity.prototype.setScriptType=function(a){this.act_script_type=a;return this};PMActivity.prototype.setDefaultFlow=function(a){this.html&&(PMShape.prototype.setDefaultFlow.call(this,a),this.canvas.triggerCommandAdam(this,["act_default_flow"],[this.act_default_flow],[a]));this.act_default_flow=a;return this};
|
||
|
|
PMActivity.prototype.setMinHeight=function(a){this.minHeight=a;return this};PMActivity.prototype.setMinWidth=function(a){this.minWidth=a;return this};PMActivity.prototype.setMaxHeight=function(a){this.maxHeight=a;return this};PMActivity.prototype.setMaxWidth=function(a){this.maxWidth=a;return this};PMActivity.prototype.setActType=function(a){this.act_type=a;return this};PMActivity.prototype.setActName=function(a){this.act_name=a;return this};
|
||
|
|
PMActivity.prototype.getDataObject=function(){return{act_uid:this.id,act_name:this.act_name,act_type:this.act_type,act_task_type:this.act_task_type,act_is_for_compensation:this.act_is_for_compensation,act_start_quantity:this.act_start_quantity,act_completion_quantity:this.act_completion_quantity,act_implementation:this.act_implementation,act_instantiate:this.act_instantiate,act_script_type:this.act_script_type,act_script:this.act_script,act_loop_type:this.act_loop_type,act_test_before:this.act_test_before,
|
||
|
|
act_loop_maximum:this.act_loop_maximum,act_loop_condition:this.act_loop_condition,act_loop_cardinality:this.act_loop_cardinality,act_loop_behavior:this.act_loop_behavior,act_is_adhoc:this.act_is_adhoc,act_is_collapsed:this.act_is_collapsed,act_completion_condition:this.act_completion_condition,act_ordering:this.act_ordering,act_cancel_remaining_instances:this.act_cancel_remaining_instances,act_protocol:this.act_protocol,act_method:this.act_method,act_is_global:this.act_is_global,act_referer:this.act_referer,
|
||
|
|
act_default_flow:this.act_default_flow,act_master_diagram:this.act_master_diagram,bou_x:this.x,bou_y:this.y,bou_width:this.width,bou_height:this.height,bou_container:"bpmnDiagram",bou_element_id:this.canvas.id,_extended:this.getExtendedObject()}};PMActivity.prototype.getMarkers=function(){return this.markersArray};
|
||
|
|
PMActivity.prototype.containerBehaviorFactory=function(a){"activity"===a?(this.activityContainerBehavior||(this.activityContainerBehavior=new PMActivityContainerBehavior),a=this.activityContainerBehavior):a=PMShape.prototype.containerBehaviorFactory.call(this,a);return a};
|
||
|
|
PMActivity.prototype.resizeBehaviorFactory=function(a){"activityResize"===a?(this.activityResizeBehavior||(this.activityResizeBehavior=new PMActivityResizeBehavior),a=this.activityResizeBehavior):a=PMShape.prototype.resizeBehaviorFactory.call(this,a);return a};
|
||
|
|
PMActivity.prototype.makeBoundaryPlaces=function(){var a,b,c,d=0,e=this.boundaryArray.getFirst(),g=0,h=0,f=0,k=0;b=e.parent.getHeight()-e.getHeight()/2;for(a=e.parent.getWidth()-(g+1)*(e.getWidth()+3);0<a+e.getWidth()/2;)c={},c.x=a,c.y=b,c.available=!0,c.number=d,c.location="BOTTOM",e.parent.boundaryPlaces.insert(c),d+=1,g+=1,a=e.parent.getWidth()-(g+1)*(e.getWidth()+3);b=e.parent.getHeight()-(h+1)*(e.getHeight()+3);for(a=-e.getHeight()/2;0<b+e.getHeight()/2;)c={},c.x=a,c.y=b,c.available=!0,c.number=
|
||
|
|
d,c.location="LEFT",e.parent.boundaryPlaces.insert(c),d+=1,h+=1,b=e.parent.getHeight()-(h+1)*(e.getHeight()+3);b=-e.getWidth()/2;for(a=f*(e.getWidth()+3);a+e.getWidth()/2<e.parent.getWidth();)c={},c.x=a,c.y=b,c.available=!0,c.number=d,c.location="TOP",e.parent.boundaryPlaces.insert(c),d+=1,f+=1,a=f*(e.getWidth()+3);b=k*(e.getHeight()+3);for(a=e.parent.getWidth()-e.getWidth()/2;b+e.getHeight()/2<e.parent.getHeight();)c={},c.x=a,c.y=b,c.available=!0,c.number=d,c.location="RIGHT",e.parent.boundaryPlaces.insert(c),
|
||
|
|
d+=1,k+=1,b=k*(e.getHeight()+3);return this};PMActivity.prototype.setBoundary=function(a,b){var c=this.boundaryPlaces.get(b);c.available=!1;a.setPosition(c.x,c.y);return this};PMActivity.prototype.getAvailableBoundaryPlace=function(){var a=0,b,c=!0,d;for(d=0;d<this.boundaryPlaces.getSize();d+=1)b=this.boundaryPlaces.get(d),b.available&&c&&(a=b.number,c=!1);c&&(a=!1);return a};
|
||
|
|
PMActivity.prototype.updateBoundaryPlaces=function(){var a,b,c=0;b=new jCore.ArrayList;for(a=0;a<this.boundaryPlaces.getSize();a+=1)b.insert(this.boundaryPlaces.get(a));this.boundaryPlaces.clear();this.makeBoundaryPlaces();for(a=0;a<this.boundaryPlaces.getSize();a+=1)c<b.getSize()&&(this.boundaryPlaces.get(a).available=b.get(c).available,c+=1);return this};
|
||
|
|
PMActivity.prototype.getNumberOfBoundaries=function(){var a,b,c=0;for(b=0;b<this.getChildren().getSize();b+=1)a=this.getChildren().get(b),"PMEvent"===a.getType()&&"BOUNDARY"===a.evn_type&&(c+=1);return c};
|
||
|
|
PMActivity.prototype.updateBoundaryPositions=function(a){var b,c,d,e;if(0<this.getNumberOfBoundaries()){this.updateBoundaryPlaces();for(d=0;d<this.getChildren().getSize();d+=1)if(b=this.getChildren().get(d),"PMEvent"===b.getType()&&"BOUNDARY"===b.evn_type){b.setPosition(this.boundaryPlaces.get(b.numberRelativeToActivity).x,this.boundaryPlaces.get(b.numberRelativeToActivity).y);for(e=0;e<b.ports.getSize();e+=1)c=b.ports.get(e),c.setPosition(c.x,c.y),c.connection.disconnect().connect(),a&&(c.connection.setSegmentMoveHandlers(),
|
||
|
|
c.connection.checkAndCreateIntersectionsWithAll())}}};PMActivity.prototype.addMarkers=function(a,b){var c,d;if(_.isArray(a))for(c=0;c<a.length;c+=1)d=a[c],d.parent=b,d.canvas=b.canvas;return this};PMActivity.prototype.getActivityType=function(){return this.act_type};PMActivity.prototype.getContextMenu=function(){};PMActivity.prototype.updateDefaultFlow=function(a){this.act_default_flow=a;return this};PMActivity.prototype.updateTaskType=function(a){return this};
|
||
|
|
PMActivity.prototype.updateScriptType=function(a){return this};var PMGateway=function(a){PMShape.call(this,a);this.gat_default_flow=this.gat_waiting_for_start=this.gat_activation_count=this.gat_event_gateway_type=this.gat_instantiate=this.gat_direction=this.gat_type=this.gat_uid=null;PMGateway.prototype.init.call(this,a)};PMGateway.prototype=new PMShape;PMGateway.prototype.type="PMGateway";
|
||
|
|
PMGateway.prototype.getDataObject=function(){var a=this.getName();return{gat_uid:this.gat_uid,gat_name:a,gat_type:this.gat_type,gat_direction:this.gat_direction,gat_instantiate:this.gat_instantiate,gat_event_gateway_type:this.gat_event_gateway_type,gat_activation_count:this.gat_activation_count,gat_waiting_for_start:this.gat_waiting_for_start,gat_default_flow:this.gat_default_flow,bou_x:this.x,bou_y:this.y,bou_width:this.width,bou_height:this.height,bou_container:"bpmnDiagram",bou_element_id:this.canvas.id,
|
||
|
|
_extended:this.getExtendedObject()}};
|
||
|
|
PMGateway.prototype.init=function(a){var b={gat_direction:"UNSPECIFIED",gat_instantiate:!1,gat_event_gateway_type:"NONE",gat_activation_count:0,gat_waiting_for_start:!0,gat_type:"EXCLUSIVE",gat_default_flow:0};jQuery.extend(!0,b,a);this.setGatewayUid(b.gat_uid).setGatewayType(b.gat_type).setDirection(b.gat_direction).setInstantiate(b.gat_instantiate).setEventGatewayType(b.gat_event_gateway_type).setActivationCount(b.gat_activation_count).setWaitingForStart(b.gat_waiting_for_start).setDefaultFlow(b.gat_default_flow);b.gat_name&&
|
||
|
|
this.setName(b.gat_name)};PMGateway.prototype.setGatewayUid=function(a){this.gat_uid=a;return this};PMGateway.prototype.setGatewayType=function(a){var b={SELECTION:"SELECTION",EVALUATION:"EVALUATION",PARALLEL:"PARALLEL",PARALLEL_EVALUATION:"PARALLEL_EVALUATION",PARALLEL_JOIN:"PARALLEL_JOIN"};b[a]&&(this.gat_type=b[a]);return this};
|
||
|
|
PMGateway.prototype.setDirection=function(a){var b={unspecified:"UNSPECIFIED",diverging:"DIVERGING",converging:"CONVERGING",mixed:"MIXED"};b[a]&&(this.gat_direction=b[a]);return this};PMGateway.prototype.setInstantiate=function(a){this.gat_instantiate=a;return this};PMGateway.prototype.setEventGatewayType=function(a){this.gat_event_gateway_type=a;return this};PMGateway.prototype.setActivationCount=function(a){this.gat_activation_count=a;return this};
|
||
|
|
PMGateway.prototype.setWaitingForStart=function(a){this.gat_waiting_for_start=a;return this};PMGateway.prototype.setDefaultFlow=function(a){this.html&&(AdamShape.prototype.setDefaultFlow.call(this,a),this.canvas.triggerCommandAdam(this,["gat_default_flow"],[this.gat_default_flow],[a]));this.gat_default_flow=a;return this};PMGateway.prototype.getGatewayType=function(){return this.gat_type};
|
||
|
|
PMGateway.prototype.getContextMenu=function(){var a,b,c,d,e,g;c="EXCLUSIVE"===this.gat_type;d="PARALLEL"===this.gat_type;e="INCLUSIVE"===this.gat_type;g="EVENTBASED"===this.gat_type;var h,f=this.getDestElements(),k=1<f.length?!1:!0,n=[],q,m=[],l=this,p,r,s,t,u;t="UNSPECIFIED"===this.gat_direction;u="DIVERGING"===this.gat_direction;var v="CONVERGING"===this.gat_direction;s="MIXED"===this.gat_direction;k=function(a){return function(){var b=new CommandDefaultFlow(l,a);b.execute();l.canvas.commandStack.add(b)}};
|
||
|
|
b=new Action({text:translate("LBL_PMSE_CONTEXT_MENU_DELETE"),cssStyle:"adam-menu-icon-delete",handler:function(){var a;if(a=l.canvas.customShapes.find("id",l.id))a.canvas.emptyCurrentSelection(),a.canvas.addToSelection(a),a.canvas.removeElements()}});a=this.createConfigureAction();c=new Action({text:translate("LBL_PMSE_CONTEXT_MENU_EXCLUSIVE_GATEWAY"),cssStyle:"adam-menu-icon-gateway-exclusive",handler:function(){l.updateGatewayType("EXCLUSIVE")},disabled:c});d=new Action({text:translate("LBL_PMSE_CONTEXT_MENU_PARELLEL_GATEWAY"),
|
||
|
|
cssStyle:"adam-menu-icon-gateway-parallel",handler:function(){l.updateGatewayType("PARALLEL")},disabled:d});e=new Action({text:translate("LBL_PMSE_CONTEXT_MENU_INCLUSIVE_GATEWAY"),cssStyle:"adam-menu-icon-gateway-inclusive",handler:function(){l.updateGatewayType("INCLUSIVE")},disabled:e});g=new Action({text:translate("LBL_PMSE_CONTEXT_MENU_EVENT_BASED_GATEWAY"),cssStyle:"adam-menu-icon-gateway-eventbase",handler:function(){l.updateGatewayType("EVENTBASED")},disabled:g});if(1<f.length){h=new Action({text:translate("LBL_PMSE_CONTEXT_MENU_NONE"),
|
||
|
|
cssStyle:"adam-menu-icon-none",handler:k(""),disabled:0!==l.gat_default_flow?!1:!0});n.push(h);for(h=0;h<this.getPorts().getSize();h+=1)if(p=this.getPorts().get(h),r=p.connection,r.srcPort.parent.getID()===this.getID()){p=r.destPort.parent;switch(p.getType()){case "AdamActivity":q=""!==p.getName()?p.getName():translate("LBL_PMSE_CONTEXT_MENU_DEFAULT_TASK");break;case "AdamEvent":q=""!==p.getName()?p.getName():translate("LBL_PMSE_CONTEXT_MENU_DEFAULT_EVENT");break;case "PMGateway":q=""!==p.getName()?
|
||
|
|
p.getName():translate("LBL_PMSE_CONTEXT_MENU_DEFAULT_GATEWAY")}n.push(new Action({text:q,cssStyle:l.getCanvas().getTreeItem(p).icon,handler:k(r.getID()),disabled:l.gat_default_flow===r.getID()?!0:!1}))}k="PARALLEL"===this.gat_type||"EVENTBASED"===this.gat_type?!0:!1;h={label:translate("LBL_PMSE_CONTEXT_MENU_DEFAULT_FLOW"),icon:"adam-menu-icon-default-flow",disabled:k,menu:{items:n}}}m.push(c);m.push(d);"CONVERGING"!==this.gat_direction&&(m.push(e),m.push(g));n={label:translate("LBL_PMSE_CONTEXT_MENU_CONVERT"),
|
||
|
|
icon:"adam-menu-icon-convert",menu:{items:m}};m=[];new Action({text:translate("LBL_PMSE_CONTEXT_MENU_UNSPECIFIED"),cssStyle:"adam-menu-icon-none",handler:function(){l.updateDirection("UNSPECIFIED")},disabled:t});t=new Action({text:translate("LBL_PMSE_CONTEXT_MENU_CONVERGING"),cssStyle:"adam-menu-icon-gateway-converging",handler:function(){l.updateDirection("CONVERGING");l.cleanFlowConditions()},disabled:v});u=new Action({text:translate("LBL_PMSE_CONTEXT_MENU_DIVERGING"),cssStyle:"adam-menu-icon-gateway-diverging",
|
||
|
|
handler:function(){l.updateDirection("DIVERGING")},disabled:u});new Action({text:translate("LBL_PMSE_CONTEXT_MENU_MIXED"),cssStyle:"adam-menu-icon-gateway-mixed",handler:function(){l.updateDirection("MIXED")},disabled:s});s={label:translate("LBL_PMSE_CONTEXT_MENU_DIRECTION"),icon:"adam-menu-icon-gateway-direction",menu:{items:[t,u]}};1<f.length?(0<a.size&&m.push(a.action,{jtype:"separator"}),"EVENTBASED"!==this.getGatewayType()&&"INCLUSIVE"!==this.getGatewayType()&&m.push(s,{jtype:"separator"}),m.push(n,
|
||
|
|
{jtype:"separator"},h,{jtype:"separator"},b)):(0<a.size&&m.push(a.action,{jtype:"separator"}),"EVENTBASED"!==this.getGatewayType()&&"INCLUSIVE"!==this.getGatewayType()&&m.push(s,{jtype:"separator"}),m.push(n,{jtype:"separator"},b));return{items:m}};
|
||
|
|
PMGateway.prototype.createConfigureAction=function(){var a,b,c,d,e=[],g=this.canvas,h,f,k=0,n,q,m=this;b=new Window({width:750,height:500,modal:!0,title:translate("LBL_PMSE_LABEL_GATEWAY")+": "+this.getName()});for(a=0;a<this.getPorts().getSize();a+=1)d=this.getPorts().get(a).connection,this.gat_default_flow!==d.getID()&&(d.flo_element_origin===this.getID()&&"DEFAULT"!==d.flo_type)&&(n=d.getName()&&""!==d.getName()?d.getName():d.getDestPort().parent.getName(),n=translate("LBL_PMSE_LABEL_CRITERIA")+
|
||
|
|
" ("+n+")",e.push({jtype:"criteria",name:"condition-"+d.getID(),label:n,required:!1,restClient:this.parent.project.restClient,value:d.getFlowCondition(),decimalSeparator:PMSE_DECIMAL_SEPARATOR,base_module:PROJECT_MODULE,base_module_label:translate("LBL_PMSE_ADAM_UI_LBL_TARGET_MODULE"),panels:{math:{enabled:!1},fixedDateEvaluation:{enabled:!1},sugarDateEvaluation:{enabled:!1},unitTimeEvaluation:{enabled:!1}}}),k+=1);c=new Form({items:e,buttons:[{jtype:"submit",caption:translate("LBL_PMSE_BUTTON_SAVE")},
|
||
|
|
{jtype:"normal",caption:translate("LBL_PMSE_BUTTON_CANCEL"),handler:function(){c.isDirty()?(q=new MessagePanel({title:"Confirm",wtype:"Confirm",message:translate("LBL_PMSE_MESSAGE_CANCELCONFIRM"),buttons:[{jtype:"normal",caption:translate("LBL_PMSE_BUTTON_YES"),handler:function(){q.close();b.close()}},{jtype:"normal",caption:translate("LBL_PMSE_BUTTON_NO"),handler:function(){q.close()}}]}),q.show()):b.close()}}],callback:{submit:function(a,c){jQuery.each(a,function(a,b){d=g.connections.find("id",
|
||
|
|
a.split("-")[1]);h=d.getFlowCondition();h!==b&&(f={condition:d.getFlowCondition(),type:d.getFlowType()},d.setFlowCondition("[]"!==b?b:""),d.canvas.triggerFlowConditionChangeEvent(d,f))});b.close()},loaded:function(a){m.canvas.emptyCurrentSelection()}},language:PMSE_DESIGNER_FORM_TRANSLATIONS});b.addPanel(c);a="PARALLEL"===this.gat_type||"EVENTBASED"===this.gat_type||"CONVERGING"===this.gat_direction?!0:!1;a=new Action({text:translate("LBL_PMSE_CONTEXT_MENU_SETTINGS"),cssStyle:"adam-menu-icon-configure",
|
||
|
|
handler:function(){b.show()},disabled:a});return{size:k,action:a}};PMGateway.prototype.cleanFlowConditions=function(){var a,b,c;for(a=0;a<this.getPorts().getSize();a+=1)b=this.getPorts().get(a),b=b.connection,b.srcPort.parent.getID()===this.getID()&&(c={condition:b.getFlowCondition(),type:b.getFlowType()},b.setFlowCondition(""),b.canvas.triggerFlowConditionChangeEvent(b,c))};
|
||
|
|
PMGateway.prototype.updateGatewayType=function(a){var b;b=this.getLayers().get(0);a=new AdamShapeLayerCommand(this,{layers:[b],type:"changetypegateway",changes:a});a.execute();this.canvas.commandStack.add(a);return this};PMGateway.prototype.updateDirection=function(a){(new CommandSingleProperty(this,{propertyName:"gat_direction",before:this.gat_direction,after:a})).execute()};PMGateway.prototype.updateDefaultFlow=function(a){this.gat_default_flow=a};
|
||
|
|
var PMFlow=function(a){PMUI.draw.Connection.call(this,a);this.label=this.flo_state=this.flo_y2=this.flo_x2=this.flo_y1=this.flo_x1=this.flo_condition=this.flo_is_inmediate=this.flo_element_dest_type=this.flo_element_dest=this.flo_element_origin_type=this.flo_element_origin=this.flo_name=this.flo_type=this.flo_uid=null;PMFlow.prototype.init.call(this,a)};PMFlow.prototype=new PMUI.draw.Connection;PMFlow.prototype.type="Connection";
|
||
|
|
PMFlow.prototype.init=function(a){var b={flo_type:"SEQUENCE",flo_is_inmediate:!0,flo_x1:0,flo_y1:0,flo_x2:0,flo_y2:0,name:""};jQuery.extend(!0,b,a);this.setFlowType(b.flo_type).setFlowUid(b.flo_uid).setIsInmediate(b.flo_is_inmediate).setOriginPoint(b.flo_x1,b.flo_y1).setTargetPoint(b.flo_x2,b.flo_y2);this.setFlowName(b.name||null);this.setFlowOrigin(b.flo_element_origin||null,b.flo_element_origin_type||null);this.setFlowTarget(b.flo_element_dest||null,b.flo_element_dest_type||null);this.setFlowCondition(b.flo_condition||
|
||
|
|
null);this.setFlowState(b.flo_state||null)};PMFlow.prototype.getName=function(){return this.flo_name};PMFlow.prototype.setName=function(a){"undefined"!==typeof a&&(this.flo_name=a);return this};PMFlow.prototype.getFlowCondition=function(){return this.flo_condition};PMFlow.prototype.setFlowUid=function(a){this.flo_uid=a;return this};PMFlow.prototype.setFlowType=function(a){this.flo_type=a;return this};PMFlow.prototype.getFlowType=function(){return this.flo_type};
|
||
|
|
PMFlow.prototype.setIsInmediate=function(a){_.isBoolean(a)&&(this.flo_is_inmediate=a);return this};PMFlow.prototype.setOriginPoint=function(a,b){this.flo_x1=a;this.flo_y1=b;return this};PMFlow.prototype.setTargetPoint=function(a,b){this.flo_x2=a;this.flo_y2=b;return this};PMFlow.prototype.setFlowName=function(a){this.flo_name=a;return this};PMFlow.prototype.setFlowOrigin=function(a,b){this.flo_element_origin=a;this.flo_element_origin_type=b;return this};
|
||
|
|
PMFlow.prototype.setFlowTarget=function(a,b){this.flo_element_dest=a;this.flo_element_dest_type=b;return this};PMFlow.prototype.setFlowCondition=function(a){this.flo_condition=a;return this};PMFlow.prototype.setFlowState=function(a){this.flo_state=a;return this};PMFlow.prototype.setOriginShape=function(a){a instanceof PMShape&&(a=this.getNativeType(a),this.flo_element_origin=a.code,this.flo_element_origin_type=a.type);return this};
|
||
|
|
PMFlow.prototype.setTargetShape=function(a){a instanceof PMShape&&(a=this.getNativeType(a),this.flo_element_dest=a.code,this.flo_element_dest_type=a.type);return this};
|
||
|
|
PMFlow.prototype.getDataObject=function(){var a=this.getPoints();return{flo_uid:this.flo_uid,flo_type:{regular:"SEQUENCE",segmented:"MESSAGE",dotted:"ASSOCIATION"}[this.segmentStyle],flo_name:this.flo_name,flo_element_origin:this.flo_element_origin,flo_element_origin_type:this.flo_element_origin_type,flo_element_dest:this.flo_element_dest,flo_element_dest_type:this.flo_element_dest_type,flo_is_inmediate:this.flo_is_inmediate,flo_condition:this.flo_condition,flo_state:a}};
|
||
|
|
PMFlow.prototype.getNativeType=function(a){var b,c;switch(a.getType()){case "PMActivity":b="bpmnActivity";c=a.act_uid;break;case "PMGateway":b="bpmnGateway";c=a.gat_uid;break;case "PMEvent":b="bpmnEvent";c=a.evn_uid;break;case "PMArtifact":b="bpmnArtifact",c=a.art_uid}return{type:b,code:c}};PMFlow.prototype.showMoveHandlers=function(){PMUI.draw.Connection.prototype.showMoveHandlers.call(this);this.canvas.updatedElement=[{relatedObject:this}];$(this.html).trigger("selectelement");return this};
|
||
|
|
PMFlow.prototype.getSegmentHeight=function(a){return Math.abs(this.lineSegments.get(a).endPoint.y-this.lineSegments.get(a).startPoint.y)};PMFlow.prototype.getSegmentWidth=function(a){return Math.abs(this.lineSegments.get(a).endPoint.x-this.lineSegments.get(a).startPoint.x)};
|
||
|
|
PMFlow.prototype.getLabelCoordinates=function(){var a,b;b=0;var c,d,e;e=this.getSegmentWidth(0)>this.getSegmentHeight(0)?this.getSegmentWidth(0):this.getSegmentHeight(0);for(d=1;d<this.lineSegments.getSize();d+=1)a=this.getSegmentWidth(d),c=this.getSegmentHeight(d),a>e+1?(e=a,b=d):c>e+1&&(e=c,b=d);a=(this.lineSegments.get(b).endPoint.x-this.lineSegments.get(b).startPoint.x)/2;c=(this.lineSegments.get(b).endPoint.y-this.lineSegments.get(b).startPoint.y)/2;a=this.lineSegments.get(b).startPoint.x+a;
|
||
|
|
b=this.lineSegments.get(b).startPoint.y+c;return new PMUI.util.Point(a,b)};PMFlow.prototype.connect=function(a){PMUI.draw.Connection.prototype.connect.call(this,a);a=this.getLabelCoordinates();this.label=new PMUI.draw.Label({message:this.getName(),canvas:this.canvas,parent:this,position:{location:"center",diffX:a.getX()/this.canvas.zoomFactor,diffY:a.getY()/this.canvas.zoomFactor}});this.html.appendChild(this.label.getHTML());return this};
|
||
|
|
PMFlow.prototype.changeFlowType=function(a){var b,c,d={"default":{srcPrefix:"PM-decorator_default",destPrefix:"PM-decorator"},conditional:{srcPrefix:"PM-decorator_conditional",destPrefix:"PM-decorator"},sequence:{srcPrefix:"PM-decorator",destPrefix:"PM-decorator"}};"association"===a?(b="dotted",c="con-none"):b="regular";this.setSegmentStyle(b);this.originalSegmentStyle=b;if("association"===a)this.srcDecorator.setDecoratorPrefix("PM-decorator"),this.srcDecorator.paint();else return this.srcDecorator.setDecoratorPrefix(d[a].srcPrefix).setDecoratorType("source").paint(),
|
||
|
|
this.destDecorator.setDecoratorPrefix(d[a].destPrefix).setDecoratorType("target").paint(),this.disconnect().connect().setSegmentMoveHandlers().checkAndCreateIntersectionsWithAll(),this;c&&this.srcDecorator?this.destDecorator.setDecoratorPrefix(c):this.destDecorator.setDecoratorPrefix("PM-decorator");this.srcDecorator.paint();this.disconnect();this.connect();return this};
|
||
|
|
PMFlow.prototype.saveAndDestroy=function(){PMUI.draw.Connection.prototype.saveAndDestroy.call(this);"DEFAULT"===this.getFlowType()&&this.getSrcPort().getParent().updateDefaultFlow("")};
|
||
|
|
var PMCommandReconnect=function(a,b){var c=function(a){PMUI.command.CommandReconnect.call(this,a);c.prototype.init.call(this,a,b)};c.prototype=new PMUI.command.CommandReconnect(a);c.prototype.init=function(a,b){this.prefix={PMActivity:"act",PMGateway:"gat"};this.srcShape=a.connection.getSrcPort().parent;this.before.type=this.receiver.connection.getFlowType?this.receiver.connection.getFlowType():"connection";this.before.condition=this.receiver.connection.getFlowCondition?this.receiver.connection.getFlowCondition():
|
||
|
|
"flowCondition";this.before.defaultFlow="PMGateway"===this.srcShape.type||"PMActivity"===this.srcShape.type?this.srcShape[this.prefix[this.srcShape.type]+"_default_flow"]:"";this.condition=this.after.type=null;this.after.defaultFlow=""};c.prototype.fireTrigger=function(a){var b=[],c=this.receiver.connection,h,f,k;if("DEFAULT"===this.after.type||"DEFAULT"===this.before.type)b.push({id:this.srcShape.getID(),relatedObject:this.srcShape,type:this.srcShape.type,fields:[{field:"default_flow",newVal:this.srcShape[this.prefix[this.srcShape.type]+
|
||
|
|
"_default_flow"],oldVal:a?this.after.defaultFlow:this.before.defaultFlow}]});f={id:c.getID(),relatedObject:c,type:c.type,fields:[]};h=a?this.after.type:this.before.type;k=c.getFlowType();h!==k&&f.fields.push({field:"type",newVal:k,oldVal:h});h=a?this.after.condition:this.before.condition;k=c.getFlowCondition();h!==k&&f.fields.push({field:"condition",newVal:k,oldVal:h});0<f.fields.length&&b.push(f)};c.prototype.execute=function(){var a=this.receiver.connection;a.setFlowType(this.after.type);PMUI.command.CommandReconnect.prototype.execute.call(this);
|
||
|
|
if("PMGateway"===a.getSrcPort().getParent().type||!a.getFlowCondition()&&"PMArtifact"!==this.srcShape.type&&"PMArtifact"!==a.getDestPort().parent.type)a.setFlowType("SEQUENCE").changeFlowType("sequence");else if("PMActivity"===a.getSrcPort().getParent().type&&a.getFlowCondition()&&!("PMArtifact"===a.getSrcPort().getParent().type||"PMArtifact"===a.getDestPort().getParent().type))a.setFlowType("CONDITIONAL").changeFlowType("conditional");else if(a.setFlowType("ASSOCIATION").setFlowCondition("").changeFlowType("association"),
|
||
|
|
"PMActivity"===this.srcShape.type||"PMGateway"===this.srcShape.type)this.srcShape[this.prefix[this.srcShape.type]+"_default_flow"]="",this.after.defaultFlow="";if(!this.after.type||!this.after.condition)this.after.type=a.getFlowType(),this.after.condition=a.getFlowCondition();this.fireTrigger()};c.prototype.undo=function(){var a=this.receiver.connection;a.getFlowType();a.getFlowCondition();PMUI.command.CommandReconnect.prototype.undo.call(this);a.setFlowCondition(this.before.condition).setFlowType(this.before.type).changeFlowType(this.before.type.toLowerCase());
|
||
|
|
this.srcShape.updateDefaultFlow&&this.srcShape.updateDefaultFlow(this.before.defaultFlow);this.fireTrigger(!0)};return new c(a)};
|