Examples of SwitchActivity


Examples of org.apache.ode.bpel.compiler.bom.SwitchActivity

        return new OSwitch(_context.getOProcess(), _context.getCurrent());
  }

  public void compile(OActivity output, Activity src) {
    OSwitch oswitch = (OSwitch) output;
    SwitchActivity switchDef = (SwitchActivity)src;

    for (SwitchActivity.Case ccase : switchDef.getCases()) {
      OSwitch.OCase ocase = new OSwitch.OCase(_context.getOProcess());
      ocase.activity = _context.compile(ccase.getActivity());
      ocase.expression = (ccase.getCondition() == null ? _context.constantExpr(true) : _context.compileExpr(ccase.getCondition()));
      oswitch.addCase(ocase);
    }
View Full Code Here

Examples of org.apache.ode.bpel.compiler.bom.SwitchActivity

        return new OSwitch(_context.getOProcess(), _context.getCurrent());
  }

  public void compile(OActivity output, Activity src) {
    OSwitch oswitch = (OSwitch) output;
    SwitchActivity switchDef = (SwitchActivity)src;

    for (SwitchActivity.Case ccase : switchDef.getCases()) {
      OSwitch.OCase ocase = new OSwitch.OCase(_context.getOProcess());
      ocase.activity = _context.compile(ccase.getActivity());
      ocase.expression = (ccase.getCondition() == null ? _context.constantExpr(true) : _context.compileExpr(ccase.getCondition()));
      oswitch.addCase(ocase);
    }
View Full Code Here

Examples of org.apache.ode.bpel.compiler.bom.SwitchActivity

        return new OSwitch(_context.getOProcess(), _context.getCurrent());
  }

  public void compile(OActivity output, Activity src) {
    OSwitch oswitch = (OSwitch) output;
    SwitchActivity switchDef = (SwitchActivity)src;

    for (SwitchActivity.Case ccase : switchDef.getCases()) {
      OSwitch.OCase ocase = new OSwitch.OCase(_context.getOProcess());
      ocase.activity = _context.compile(ccase.getActivity());
      ocase.expression = (ccase.getCondition() == null ? _context.constantExpr(true) : _context.compileExpr(ccase.getCondition()));
      oswitch.addCase(ocase);
    }
View Full Code Here

Examples of org.uengine.kernel.SwitchActivity

     
      ProcessDefinition sampleProcDef = new ProcessDefinition();
      sampleProcDef = (ProcessDefinition) GlobalContext.deserialize(new FileInputStream(args[0]), ProcessDefinition.class);
      ActivityDesigner actDesigner = sampleProcDef.createDesigner();
     
      SwitchActivity switchAct = new SwitchActivity();
      switchAct.addChildActivity(new HumanActivity());
      switchAct.addChildActivity(new HumanActivity());
     
      JPanel panel = new JPanel(new BorderLayout());
      Component switchDesigner = switchAct.createDesigner().getComponent();
      panel.add("Center", switchDesigner);
      panel.setPreferredSize(new Dimension(300,200));
      JFrame frame = new JFrame();
      frame.getContentPane().setLayout(new BorderLayout());
      frame.getContentPane().add("Center", panel);
View Full Code Here

Examples of org.uengine.kernel.SwitchActivity

      ComplexActivity firstBlock = resultingBlock; 
     
      Vector insertedActivities = new Vector(); //for undo
     
      if (isXOR()) { //Switch block
        innerBlock = new SwitchActivity();

      } else //All block
        //System.out.println("in all");
        innerBlock = new AllActivity();
       
View Full Code Here

Examples of org.uengine.kernel.SwitchActivity

    Component comp = super.boxComponent(designer);
   
    JPanel compPanel = new ProxyPanel(new BorderLayout(0,0));

    final int where = getChildDesigners().size();
    final SwitchActivity switchActivity = (SwitchActivity)getActivity();
    Condition[] conditions = switchActivity.getConditions();
    String conditionDescription;// = "condition" + where;
   
    if(conditions!=null && conditions.length>where){
      conditionDescription = conditions[where].toString();
      switchActivity.setExtendedAttribute("conditionDescriptions_" + where, conditionDescription);
    }else{
      conditionDescription = "condition" + where;
    }
   
    final JPanel conditionLabelPanel = new ProxyPanel(new BorderLayout());
    final JLabel conditionLabel = new JLabel(conditionDescription);

    conditionLabelPanel.add("Center", conditionLabel);
    conditionLabel.addMouseListener(new MouseAdapter(){

      public void mouseClicked(MouseEvent arg0) {
        conditionLabelPanel.removeAll();
        final JTextField labelEditor = new JTextField();
        labelEditor.setText(conditionLabel.getText());
        conditionLabelPanel.add("Center", labelEditor);
       
        final ActionListener onEditDone = new ActionListener(){
          public void actionPerformed(ActionEvent arg0) {
           
            Condition theCondition = null;
           
            int where = switchActivity.getChildActivities().indexOf(designer.getActivity());
            Condition[] conditions = switchActivity.getConditions();
            if(conditions!=null && conditions.length > where){
              theCondition = conditions[where];
            }

            String conditionDescription = labelEditor.getText();
           
            if(theCondition!=null){
              if(conditionDescription==null || conditionDescription.trim().length()==0){
                conditionDescription = theCondition.toString();
              }else{
                theCondition.getDescription().setText(conditionDescription);
              }
            }
           
            conditionLabel.setText(conditionDescription);
            conditionLabelPanel.removeAll();
            conditionLabelPanel.add("Center", conditionLabel);
            conditionLabelPanel.revalidate();
           
            switchActivity.setExtendedAttribute("conditionDescriptions_" + where, conditionDescription);
          }
        };
       
        labelEditor.addFocusListener(new FocusListener(){
          public void focusGained(FocusEvent arg0) {
          }
          public void focusLost(FocusEvent arg0) {
            onEditDone.actionPerformed(null);           
          }
        });
       
        labelEditor.addActionListener(onEditDone);
       
        conditionLabelPanel.revalidate();
      }
     
    });
   
    switchActivity.addProperyChangeListener(
      new PropertyChangeListener(){
        public void propertyChange(PropertyChangeEvent pce){
          if(pce.getPropertyName().equals("conditions")){
            try{
              int where = switchActivity.getChildActivities().indexOf(designer.getActivity());
              Condition[] conditions = (Condition[])pce.getNewValue()
              conditionLabel.setText(conditions[where].toString());
            }catch(Exception e){
            }
          }
View Full Code Here

Examples of org.uengine.kernel.SwitchActivity

*/
  
public class SwitchActivityAdapter implements Adapter{
 
  public Object convert(Object src, java.util.Hashtable keyedContext) throws Exception{
    SwitchActivity srcAct = (SwitchActivity)src;

    tSwitch destAct = new tSwitch();
    destAct.setname_Attribute(new XNCName(srcAct.getName().getText().replace(' ', '_')));
   
    Vector childActivities = srcAct.getChildActivities();
    int i=0;
    for(Enumeration enumeration = childActivities.elements(); enumeration.hasMoreElements();){
      Object item = (Object)enumeration.nextElement();
      Adapter adpt = ProcessDefinitionAdapter.getAdapter(item.getClass());
      if(adpt==null){
        continue;
      }
             
      activity actGrp_ = (activity)adpt.convert(item, keyedContext);
     
      Condition condition = srcAct.getConditions()[i];
      if(condition instanceof Otherwise){
        tActivityContainer actContainer = new tActivityContainer();
        actContainer.setactivity_Group(actGrp_);
        destAct.setotherwise(actContainer);
      }else{
View Full Code Here

Examples of org.uengine.kernel.SwitchActivity

  }

  public void setActivity(Activity activity, String propertyName) {
    editingActivity = activity;
    if(editingActivity!=null && editingActivity instanceof SwitchActivity){
      SwitchActivity switchActivity = (SwitchActivity)editingActivity;
      switchActivity.addProperyChangeListener(this);
      propertyChange(new PropertyChangeEvent(switchActivity, "extendedAttribute", null, null));
    }
   
    table.setProcessDefinition(activity.getProcessDefinition());
  }
View Full Code Here

Examples of org.uengine.kernel.SwitchActivity

    table.setProcessDefinition(activity.getProcessDefinition());
  }

  public void propertyChange(PropertyChangeEvent pce) {   
    if(editingActivity!=null && editingActivity instanceof SwitchActivity && pce.getPropertyName().equals("extendedAttribute")){
      SwitchActivity switchActivity = (SwitchActivity)editingActivity;

      Map extAttrs = ((SwitchActivity)editingActivity).getExtendedAttributes();
     
      String[] conditionNames = new String[switchActivity.getChildActivities().size()];
      for(int i=0; i<switchActivity.getChildActivities().size(); i++){
        String attrKey = "conditionDescriptions_" + i;
        String conditionDescription = null;
        if(extAttrs!=null && extAttrs.containsKey(attrKey)){
          conditionDescription = (String)extAttrs.get(attrKey);
        }
       
        if(conditionDescription == null){
          if(switchActivity.getConditions()!=null && switchActivity.getConditions().length > i){
            conditionDescription = switchActivity.getConditions()[i].toString();
          }
        }
       
        conditionNames[i] = (conditionDescription !=null ? conditionDescription : ("condition" + i));
      }
View Full Code Here

Examples of org.uengine.kernel.SwitchActivity

 
  public void setInstance(Instance rec, String fieldName) {
    if(rec!=null && rec instanceof ObjectInstance){
      editingActivity = (Activity)((ObjectInstance)rec).getObject();
      if(editingActivity!=null && editingActivity instanceof SwitchActivity){
        SwitchActivity switchActivity = (SwitchActivity)editingActivity;
        Map extAttrs = ((SwitchActivity)editingActivity).getExtendedAttributes();
       
        String[] conditionNames = new String[switchActivity.getChildActivities().size()];
        for(int i=0; i<switchActivity.getChildActivities().size(); i++){
          String conditionDescription = (String)extAttrs.get("conditionDescription_" + i);
          conditionNames[i] = (conditionDescription !=null ? conditionDescription : ("condition" + i));
        }
       
        table.setConditionNames(conditionNames);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.