/** * Get the activity handler for an activity. * @param actvity The activity. * @return The activity handler. */ public IActivityHandler getActivityHandler(MActivity activity) { return (IActivityHandler)activityhandlers.get(activity.getActivityType()); }
/** Checks if an object is a visual event. */ public static final boolean isVisualEvent(Object obj) { boolean ret = false; if (obj instanceof VActivity) { VActivity vactivity = (VActivity) obj; MActivity mactivity = vactivity.getMActivity(); ret = mactivity != null && mactivity.getActivityType() != null && mactivity.getActivityType().startsWith("Event"); } return ret; } }
public boolean filter(Object obj) { boolean ret = false; if (obj instanceof VActivity) { VElement velement = (VElement) obj; if (((MActivity)velement.getBpmnElement()).getActivityType().contains("Signal")) { ret = true; } } return ret; } });
public boolean filter(Object obj) { boolean ret = false; if (obj instanceof VActivity) { VElement velement = (VElement) obj; if (((MActivity) velement.getBpmnElement()).getActivityType() != null && ((MActivity) velement.getBpmnElement()).getActivityType().contains("Timer")) { ret = true; } } return ret; } });
public boolean filter(Object obj) { boolean ret = false; if (obj instanceof VActivity) { VElement velement = (VElement) obj; if (MBpmnModel.EVENT_INTERMEDIATE_RULE.equals(((MActivity) velement.getBpmnElement()).getActivityType()) || MBpmnModel.EVENT_START_RULE.equals(((MActivity) velement.getBpmnElement()).getActivityType())) { ret = true; } } return ret; } });
public boolean filter(Object obj) { boolean ret = false; if (obj instanceof VActivity) { VElement velement = (VElement) obj; if (((MActivity) velement.getBpmnElement()).getActivityType() != null && ((MActivity) velement.getBpmnElement()).getActivityType().matches("Event.*Error")) { ret = true; } } return ret; } });
public boolean filter(Object obj) { boolean ret = false; if (obj instanceof VActivity) { VElement velement = (VElement) obj; if (MBpmnModel.EVENT_INTERMEDIATE_MESSAGE.equals(((MActivity) velement.getBpmnElement()).getActivityType()) || MBpmnModel.EVENT_START_MESSAGE.equals(((MActivity) velement.getBpmnElement()).getActivityType()) || MBpmnModel.EVENT_END_MESSAGE.equals(((MActivity) velement.getBpmnElement()).getActivityType())) { ret = true; } } return ret; } });
public boolean filter(Object obj) { boolean ret = false; if (obj instanceof VActivity) { VActivity vactivity = (VActivity) obj; MActivity mactivity = (MActivity) vactivity.getBpmnElement(); if (activitytype.endsWith("Handler")) { String shortat = activitytype.substring(0, activitytype.length() - 7); ret = mactivity.getActivityType() != null && mactivity.getActivityType().equals(shortat) && mactivity.isEventHandler(); } else { ret = mactivity.getActivityType() != null && mactivity.getActivityType().equals(activitytype) && !mactivity.isEventHandler(); } } return ret; } }
public Object getValueAt(int row, int column) { Object ret = null; if(column==1) { MActivity act = (MActivity)activities.get(row); ret = act.getName(); if(ret!=null) { // ret = ret + " (type = " + act.getActivityType() + ", id = " + act.getId() + ")"; ret = ret + " (type = " + act.getActivityType() + ")"; } else { ret = act.getActivityType() + " (id = " + act.getId() + ")"; } } return ret; } public boolean isCellEditable(int row, int column)
/** * Create a string representation of this activity. * @return A string representation of this activity. */ public String toString() { StringBuffer buf = new StringBuffer(); buf.append(SReflect.getInnerClassName(this.getClass())); buf.append("(name="); buf.append(getName()); buf.append(", activityType="); buf.append(getActivityType()); buf.append(")"); return buf.toString(); }
public Object getValueAt(int row, int column) { Object ret = null; if(column==1) { MActivity act = (MActivity)activities.get(row); ret = act.getName(); if(ret!=null) { // ret = ret + " (type = " + act.getActivityType() + ", id = " + act.getId() + ")"; ret = ret + " (type = " + act.getActivityType() + ")"; } else { ret = act.getActivityType() + " (id = " + act.getId() + ")"; } } return ret; } public boolean isCellEditable(int row, int column)
/** * Get a string to identify this activity in a tool such as the debugger. * @return A unique but nicely readable name. */ public String getBreakpointId() { String name = getName(); if(name==null) name = getActivityType()+"("+getId()+")"; return name; }
protected boolean useLabelBounds(mxCellState state) { boolean ret = true; if (state.getCell() instanceof VActivity && ((MActivity) ((VActivity) state.getCell()).getBpmnElement()).getActivityType().startsWith("Gateway")) { ret = false; } return ret; } };
public void setActivityGeometry(VActivity vactivity) { MActivity mactivity = (MActivity) vactivity.getBpmnElement(); Dimension ds = BpmnStylesheetColor.DEFAULT_ACTIVITY_SIZES.containsKey(mactivity.getActivityType()) ? BpmnStylesheetColor.DEFAULT_ACTIVITY_SIZES.get(mactivity.getActivityType()) : BpmnStylesheetColor.DEFAULT_ACTIVITY_SIZES.get(vactivity.getStyle()); mxGeometry geo = new mxGeometry(0, 0, ds.width, ds.height); vactivity.setGeometry(geo); if (BpmnStylesheetColor.COLLAPSED_SIZES.containsKey(vactivity.getStyle()) || BpmnStylesheetColor.COLLAPSED_SIZES.containsKey(mactivity.getActivityType())) { Dimension ads = (Dimension) (BpmnStylesheetColor.COLLAPSED_SIZES.get(vactivity.getStyle()) != null? BpmnStylesheetColor.COLLAPSED_SIZES.get(vactivity.getStyle()) : BpmnStylesheetColor.COLLAPSED_SIZES.get(mactivity.getActivityType())); vactivity.getGeometry().setAlternateBounds(new mxGeometry(0, 0, ads.width, ads.height)); } } }
/** * Set BPMN element. */ public void setBpmnElement(MIdElement bpmnelement) { super.setBpmnElement(bpmnelement); // if (MBpmnModel.TASK.equals(getMActivity().getActivityType()) || // MBpmnModel.SUBPROCESS.equals(getMActivity().getActivityType())) if (getMActivity() instanceof MTask || MBpmnModel.SUBPROCESS.equals(getMActivity().getActivityType())) { createParameterObjects(); } }
/** * Make a process step, i.e. find the next edge or activity for a just executed thread. * @param activity The activity to execute. * @param instance The process instance. * @param thread The process thread. */ public void step(MActivity activity, BpmnInterpreter instance, ProcessThread thread, Object event) { // System.out.println("step: "+activity.getName()); // notifyListeners(createActivityEvent(IComponentChangeEvent.EVENT_TYPE_DISPOSAL, thread, activity)); if(thread.getThreadContext()!=null && hasEventTargets(PublishTarget.TOALL, PublishEventLevel.FINE)) { publishEvent(createActivityEvent(IMonitoringEvent.EVENT_TYPE_DISPOSAL, thread, activity), PublishTarget.TOALL); } IStepHandler ret = (IStepHandler)stephandlers.get(activity.getActivityType()); if(ret==null) ret = (IStepHandler)stephandlers.get(IStepHandler.STEP_HANDLER); ret.step(activity, instance, thread, event); }
MActivity mevt2 = (MActivity) evt2.getBpmnElement(); if (mevt1.getActivityType() != null && mevt1.getActivityType().endsWith("Message") && mevt2.getActivityType() != null && mevt2.getActivityType().endsWith("Message"))
if(!ret && thread.getActivity()!=null && MBpmnModel.EVENT_INTERMEDIATE_MULTIPLE.equals(thread.getActivity().getActivityType())) if(!ret && thread.getActivity()!=null && MBpmnModel.SUBPROCESS.equals(thread.getActivity().getActivityType())) ret = activity.equals(handler) && handler.getActivityType().equals("EventIntermediateTimer");
if (element instanceof MActivity) return ((MActivity) element).getActivityType();
/** * Gets the layout. */ protected mxIGraphLayout getLayout(Object parent) { if (parent instanceof VPool && graph.getModel().getChildCount(parent) > 0 && graph.getModel().getChildAt(parent, 0) instanceof VLane) { return lanelayout; } if (parent instanceof VElement && ((VElement) parent).getBpmnElement() instanceof MActivity) { MActivity mparent = (MActivity) ((VElement) parent).getBpmnElement(); // if (MBpmnModel.TASK.equals(mparent.getActivityType()) || // MBpmnModel.SUBPROCESS.equals(mparent.getActivityType())) if (mparent instanceof MTask || MBpmnModel.SUBPROCESS.equals(mparent.getActivityType())) { return evtlayout; } } return null; } }