Package org.jbpm.ui.bsh

Examples of org.jbpm.ui.bsh.BSHDecisionModel


        }
  }

    public Set<String> getTransitionNames(Decision decision) {
        try {
            BSHDecisionModel model = new BSHDecisionModel(decision.getDelegationConfiguration(), decision.getProcessDefinition().getVariablesList());
            if (model != null)
                return new HashSet<String>(model.getTransitionNames());
        } catch (Exception e) {
        }
        return new HashSet<String>();
    }
View Full Code Here


        return new HashSet<String>();
    }

    public String getDefaultTransitionName(Decision decision) {
        try {
            BSHDecisionModel model = new BSHDecisionModel(decision.getDelegationConfiguration(), decision.getProcessDefinition().getVariablesList());
            if (model != null)
                return model.getDefaultTransitionName();
        } catch (Exception e) {
        }
        return null;
    }
View Full Code Here

        for (Variable variable : variables) {
            variableNames.add(variable.getName());
        }
        if (this.initValue.length() > 0) {
            try {
                initModel = new BSHDecisionModel(initValue, variables);
            } catch (Throwable e) {
                initErrorMessage = e.getMessage();
                DesignerLogger.logErrorWithoutDialog("", e);
            }
        }
View Full Code Here

            }
        }
        clearErrorLabelText();

        try {
            BSHDecisionModel decisionModel = new BSHDecisionModel(variables);
            for (int i = 0; i < transitionNames.size(); i++) {
                IfExpr ifExpr;
                if (labels[i].getText().equals(defaultTransitionCombo.getText())) {
                    ifExpr = new IfExpr(labels[i].getText());
                } else {
                    Variable var1 = (Variable) comboBoxes[i][0].getData(DATA_VARIABLE_KEY);
                    String operationName = comboBoxes[i][1].getItem(comboBoxes[i][1].getSelectionIndex());
                    String lexem2Text = comboBoxes[i][2].getText();

                    Object lexem2;
                    Variable var2 = getVariableByName(lexem2Text);
                    if (var2 != null) {
                        lexem2 = var2;
                    } else {
                        lexem2 = lexem2Text;
                    }
                    BSHTypeSupport typeSupport = BSHTypeSupport.getByFormat(var1.getFormat());

                    ifExpr = new IfExpr(labels[i].getText(), var1, lexem2, Operation.getByName(operationName, typeSupport));
                }
                decisionModel.addIfExpr(ifExpr);
            }
            styledText.setText(decisionModel.generateCode());
        } catch (RuntimeException e1) {
            DesignerLogger.logError(e1);
            setErrorLabelText(Messages.getString("BSHEditor.error.construct"));
        }
    }
View Full Code Here

TOP

Related Classes of org.jbpm.ui.bsh.BSHDecisionModel

Copyright © 2018 www.massapicom. 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.