Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[bpel-dev] BPEL Editor selections

The selections in the BPEL Editor are a mess.

I've noticed that selection on the main canvas area deteriorate the performance of the editor to the point where at some point my 1 core is pegged to 100% when doing quick selections between elements in the main drawing area. If you got 3 minutes you can try it. Just create a process and then start selecting the main canvas items (activities). For comparison, try selecting the tray elements ( variables, pl) to see that these selections are processed more quickly. Open the properties view too for added benefit and if you really wanna see it go bad after a minute or so of clicking, try multi-select a bunch of objects on the canvas.

I noticed that if uncomment two lines in BPELEditor this seems to go away.

   // Most of our SelectionActions can't handle selections
// in other editors properly. TODO: Note that they'll still get *notified* and // calculateEnabled() will be called on them; maybe we should try to make some of // those less expensive (especially AppendNewAction.calculateEnabled() which does // lots of work and gets called for around 20 instances on each selection)?
   // TODO: TEMPORARY HACK!
   protected void makeSelectionActionBPELOnlyEP(IAction action) {
// if (!(action instanceof SelectionAction)) throw new IllegalArgumentException(); // ((SelectionAction)action).setSelectionProvider(getFilteredEditPartSelectionProvider());
   }
protected void makeSelectionActionBPELOnly(IAction action) {
//        if (action instanceof SelectionAction) {
//            SelectionAction anAction = (SelectionAction) action;
//            anAction.setSelectionProvider(getAdaptingSelectionProvider());
// } // throw new IllegalArgumentException();
   }

Some of the selection dependent actions do not work correctly after but I think I found a way to fix this.
For example, calculateEnabled in AppendNewAction can now look like this ...

   @Override
   protected boolean calculateEnabled() {
List objects = getSelectedObjects();
       if ( objects.size() != 1 ) {
           return false;
       }

       Object sel = objects.get(0);
       EObject eSel = null;
if (sel instanceof EditPart) {
           EditPart part = (EditPart) sel;
           sel = part.getModel();
       }
if (sel instanceof EObject) {
           eSel = (EObject) sel;
       }
if (eSel == null) {
           return false;
       }
IContainer container = BPELUtil.adapt(eSel, IContainer.class);
       if (container == null) {
           return false;
       }
       // make sure it can contain something of this type
       return container.canAddObject(eSel, cachedInstance, null);
   }


Do selections generated from other editors concern us that much and what was the real magic behind this ?

--
Michal Chmielewski, CMTS, Oracle Corp, W:650-506-5952 / M:408-209-9321 "Manuals ?! What manuals ? Son, it's Unix, you just gotta know."


Back to the top