Tabnine Logo
RuleSetNode
Code IndexAdd Tabnine to your IDE (free)

How to use
RuleSetNode
in
org.jbpm.workflow.core.node

Best Java code snippets using org.jbpm.workflow.core.node.RuleSetNode (Showing top 20 results out of 315)

origin: kiegroup/jbpm

private void postProcessNodes(RuleFlowProcess process, NodeContainer container, ProcessBuildData buildData, ExtensibleXmlParser parser) {
  for (Node node : container.getNodes()) {
    if (node instanceof SubProcessNode) {
      Map<String, String> processes = (Map<String, String>) buildData.getMetaData("ProcessElements");
      if (processes != null) {
        SubProcessNode subprocessNode = (SubProcessNode) node;
        subprocessNode.setProcessId(processes.getOrDefault(subprocessNode.getProcessId(), subprocessNode.getProcessId()));    
      }
    } else if (node instanceof RuleSetNode) {
      Map<String, Decision> decisions = (Map<String, Decision>) buildData.getMetaData("DecisionElements");
      RuleSetNode ruleSetNode = (RuleSetNode) node;
      if (decisions != null && decisions.containsKey(ruleSetNode.getRuleFlowGroup())) {
        Decision decision = decisions.get(ruleSetNode.getRuleFlowGroup());
        ruleSetNode.setRuleFlowGroup(null);
        ruleSetNode.setLanguage(RuleSetNode.DMN_LANG);
        ruleSetNode.setNamespace((String) parser.getNamespaceURI(decision.getNamespace()));
        ruleSetNode.setModel(decision.getModel());
        ruleSetNode.setDecision(decision.getDecision());
      }
    }
    if (node instanceof NodeContainer) {                
      postProcessNodes(process, (NodeContainer) node, buildData, parser);
    }
  }
}
origin: kiegroup/jbpm

protected Node createNode() {
  return new RuleSetNode();
}

origin: kiegroup/jbpm

public void writeNode(Node node, StringBuilder xmlDump, int metaDataType) {
  RuleSetNode ruleSetNode = (RuleSetNode) node;
  writeNode("businessRuleTask", ruleSetNode, xmlDump, metaDataType);
  if (ruleSetNode.getRuleFlowGroup() != null) {
    xmlDump.append("g:ruleFlowGroup=\"" + XmlBPMNProcessDumper.replaceIllegalCharsAttribute(ruleSetNode.getRuleFlowGroup()) + "\" " + EOL);
  }
  
  xmlDump.append(" implementation=\"" + XmlBPMNProcessDumper.replaceIllegalCharsAttribute(ruleSetNode.getLanguage()) + "\" >" + EOL);        
  
  writeExtensionElements(ruleSetNode, xmlDump);
  writeIO(ruleSetNode, xmlDump);
  endNode("businessRuleTask", xmlDump);
}

origin: kiegroup/jbpm

protected void handleNode(final Node node,
             final Element element,
             final String uri,
             final String localName,
             final ExtensibleXmlParser parser) throws SAXException {
  super.handleNode(node, element, uri, localName, parser);
  String decisionRef = element.getAttribute("decisionRef");
  if (decisionRef == null) {
    throw new IllegalArgumentException("Decision information is mandatory");
  }
  RuleSetNode ruleSetNode = (RuleSetNode) node;
  ruleSetNode.setRuleFlowGroup(decisionRef);
  ruleSetNode.setLanguage(RuleSetNode.DRL_LANG);
  ruleSetNode.setNamespace((String) ruleSetNode.removeParameter(NAMESPACE_PROP));
  ruleSetNode.setModel((String) ruleSetNode.removeParameter(MODEL_PROP));
  ruleSetNode.setDecision((String) ruleSetNode.removeParameter(DECISION_PROP));
  Map<String, String> inputs = new HashMap<>();
  Map<String, String> outputs = new HashMap<>();
  Map<String, String> inputTypes = new HashMap<>();
  Map<String, String> outputTypes = new HashMap<>();
  loadDataInputsAndOutputs(element, inputs, outputs, inputTypes, outputTypes, parser);
  ruleSetNode.setMetaData("DataInputs", inputTypes);
  ruleSetNode.setMetaData("DataOutputs", outputTypes);
  for (Entry<String, String> entry : inputs.entrySet()) {
    ruleSetNode.addInAssociation(new DataAssociation(entry.getValue(), entry.getKey(), Collections.emptyList(), null));
  }
  for (Entry<String, String> entry : outputs.entrySet()) {
    ruleSetNode.addOutAssociation(new DataAssociation(entry.getKey(), entry.getValue(), Collections.emptyList(), null));
  }
}
origin: kiegroup/jbpm

String ruleFlowGroup = element.getAttribute("ruleFlowGroup");
if (ruleFlowGroup != null) {
  ruleSetNode.setRuleFlowGroup(ruleFlowGroup);
  language = RuleSetNode.DRL_LANG;
ruleSetNode.setLanguage(language);
ruleSetNode.setNamespace((String) ruleSetNode.removeParameter(NAMESPACE_PROP));
ruleSetNode.setModel((String) ruleSetNode.removeParameter(MODEL_PROP));
ruleSetNode.setDecision((String) ruleSetNode.removeParameter(DECISION_PROP));
origin: kiegroup/jbpm

assertThat(decisionTask.getName()).isEqualTo("call my decision");
assertThat(decisionTask.getLanguage()).isEqualTo(RuleSetNode.DMN_LANG);
assertThat(decisionTask.getRuleFlowGroup()).isNull();
assertThat(decisionTask.getNamespace()).isEqualTo("http://www.trisotech.com/definitions/_0020_vacation_days");
assertThat(decisionTask.getModel()).isEqualTo("_0020_vacation_days");
assertThat(decisionTask.getDecision()).isEqualTo("Total Vacation Days");
assertThat(decisionTask.getInAssociations()).hasSize(0);        
assertThat(decisionTask.getOutAssociations()).hasSize(0);        
origin: kiegroup/jbpm

assertThat(decisionTask.getLanguage()).isEqualTo(RuleSetNode.DRL_LANG);
assertThat(decisionTask.getName()).isEqualTo("Make a decision");
assertThat(decisionTask.getRuleFlowGroup()).isEqualTo("decisionName");
assertThat(decisionTask.getInAssociations()).hasSize(1);
assertThat(decisionTask.getInAssociations().get(0).getSources()).hasSize(1);
assertThat(decisionTask.getInAssociations().get(0).getSources().get(0)).isEqualTo("caseFile_invoice");
assertThat(decisionTask.getInAssociations().get(0).getTarget()).isEqualTo("toApprove");   
assertThat(decisionTask.getOutAssociations()).hasSize(1);
assertThat(decisionTask.getOutAssociations().get(0).getSources()).hasSize(1);
assertThat(decisionTask.getOutAssociations().get(0).getSources().get(0)).isEqualTo("decided");
assertThat(decisionTask.getOutAssociations().get(0).getTarget()).isEqualTo("caseFile_invoice");
origin: kiegroup/jbpm

} else if (node instanceof RuleSetNode) {
  final RuleSetNode ruleSetNode = (RuleSetNode) node;
  if (ruleSetNode.getFrom() == null && !acceptsNoIncomingConnections(node)) {
    addErrorMessage(process,
            node,
  if (ruleSetNode.getTo() == null && !acceptsNoOutgoingConnections(node)) {
    addErrorMessage(process,
            node,
  final String language = ruleSetNode.getLanguage();
    final String ruleFlowGroup = ruleSetNode.getRuleFlowGroup();
    if (ruleFlowGroup == null || "".equals(ruleFlowGroup)) {
      addErrorMessage(process,
    final String namespace = ruleSetNode.getNamespace();
    if (namespace == null || "".equals(namespace)) {
      addErrorMessage(process,
    final String model = ruleSetNode.getModel();
    if (model == null || "".equals(model)) {
      addErrorMessage(process,
  if (ruleSetNode.getTimers() != null) {
    for (Timer timer : ruleSetNode.getTimers().keySet()) {
      validateTimer(timer,
             node,
origin: kiegroup/jbpm

process.addNode(actionNode);
RuleSetNode ruleSetNode = new RuleSetNode();
ruleSetNode.setName("action");
ruleSetNode.setMetaData("x", 1);
ruleSetNode.setMetaData("y", 2);
ruleSetNode.setMetaData("width", 3);
ruleSetNode.setMetaData("height", 4);
ruleSetNode.setRuleFlowGroup("ruleFlowGroup");
Timer timer = new Timer();
timer.setDelay("100");
timer.setPeriod("100");
action = new DroolsConsequenceAction("dialect", "consequence");
ruleSetNode.addTimer(timer, action);
timer = new Timer();
timer.setDelay("200");
timer.setPeriod("200");
action = new DroolsConsequenceAction("dialect", "consequence");
ruleSetNode.addTimer(timer, action);
process.addNode(ruleSetNode);
origin: kiegroup/jbpm

Map<String, Object> inputs = evaluateParameters(ruleSetNode);
if (ruleSetNode.isDMN()) {
  String namespace = resolveVariable(ruleSetNode.getNamespace());
  String model = resolveVariable(ruleSetNode.getModel());
  String decision = resolveVariable(ruleSetNode.getDecision());
  setRuleFlowGroup(resolveRuleFlowGroup(ruleSetNode.getRuleFlowGroup()));
origin: kiegroup/jbpm

public void writeNode(Node node, StringBuilder xmlDump, boolean includeMeta) {
  RuleSetNode ruleSetNode = (RuleSetNode) node;
  writeNode("ruleSet", ruleSetNode, xmlDump, includeMeta);
  String ruleFlowGroup = ruleSetNode.getRuleFlowGroup();
  if (ruleFlowGroup != null) {
    xmlDump.append("ruleFlowGroup=\"" + ruleFlowGroup + "\" ");
  }
  if (ruleSetNode.getTimers() != null || (includeMeta && containsMetaData(ruleSetNode))) {
    xmlDump.append(">\n");
    if (ruleSetNode.getTimers() != null) {
      writeTimers(ruleSetNode.getTimers(), xmlDump);
    }
    if (includeMeta) {
      writeMetaData(ruleSetNode, xmlDump);
    }
    endNode("ruleSet", xmlDump);
  } else {
    endNode(xmlDump);
  }
}
origin: kiegroup/jbpm

public String getRuleFlowGroup() {
  if (ruleFlowGroup == null || ruleFlowGroup.trim().length() == 0) {
    ruleFlowGroup = getRuleSetNode().getRuleFlowGroup();
  }
  return ruleFlowGroup;
}
origin: kiegroup/jbpm

public void handleNode(final Node node, final Element element, final String uri,
    final String localName, final ExtensibleXmlParser parser)
    throws SAXException {
  super.handleNode(node, element, uri, localName, parser);
  RuleSetNode ruleSetNode = (RuleSetNode) node;
  String ruleFlowGroup = element.getAttribute("ruleFlowGroup");
  if (ruleFlowGroup != null && ruleFlowGroup.length() > 0) {
    ruleSetNode.setRuleFlowGroup(ruleFlowGroup);
  }
}
origin: kiegroup/jbpm

protected Map<String, Object> evaluateParameters(RuleSetNode ruleSetNode) {
  Map<String, Object> replacements = new HashMap<String, Object>();
  for (Iterator<DataAssociation> iterator = ruleSetNode.getInAssociations().iterator(); iterator.hasNext(); ) {
    DataAssociation association = iterator.next();
    if (association.getTransformation() != null) {
        } catch (Throwable t) {
          logger.error("Could not find variable scope for variable {}", association.getSources().get(0));
          logger.error("when trying to execute RuleSetNode {}", ruleSetNode.getName());
          logger.error("Continuing without setting parameter.");
  for (Map.Entry<String, Object> entry: ruleSetNode.getParameters().entrySet()) {
    if (entry.getValue() instanceof String) {
origin: kiegroup/jbpm

@Override
public void build(Process process, ProcessDescr processDescr, ProcessBuildContext context, Node node) {
  super.build(process, processDescr, context, node);
  WorkflowProcess wfProcess = (WorkflowProcess) process;
  Map<String, Object> parameters = new HashMap<String, Object>();
  parameters.put("imports", wfProcess.getImports());
  parameters.put("classloader", context.getConfiguration().getClassLoader());
  
  for (DataAssociation dataAssociation: ((RuleSetNode) node).getInAssociations()) {
    Transformation transformation = dataAssociation.getTransformation();
    if (transformation != null) {				
      
      DataTransformer transformer = DataTransformerRegistry.get().find(transformation.getLanguage());
      transformation.setCompiledExpression(transformer.compile(transformation.getExpression(), parameters));
      
    }
  }
  
  for (DataAssociation dataAssociation: ((RuleSetNode) node).getOutAssociations()) {
    Transformation transformation = dataAssociation.getTransformation();
    if (transformation != null) {
      
      DataTransformer transformer = DataTransformerRegistry.get().find(transformation.getLanguage());
      transformation.setCompiledExpression(transformer.compile(transformation.getExpression(), parameters));
      
    }
  }
}
origin: kiegroup/jbpm

private void processOutputs(Map<String, Object> objects) {
  RuleSetNode ruleSetNode = getRuleSetNode();
  if (ruleSetNode != null) {
    for (Iterator<DataAssociation> iterator = ruleSetNode.getOutAssociations().iterator(); iterator.hasNext(); ) {
      DataAssociation association = iterator.next();
      if (association.getTransformation() != null) {
origin: kiegroup/jbpm

  subNode = subNode.getNextSibling();
ruleSetNode.addInAssociation(new DataAssociation(
    source,
    dataInputs.get(target), assignments, transformation));
  if (nl.getLength() > 1) {
    ruleSetNode.setParameter(dataInputs.get(to), subSubNode.getTextContent());
    return;
  } else if (nl.getLength() == 0) {
    result = nl.item(0);
  ruleSetNode.setParameter(dataInputs.get(to), result);
origin: kiegroup/jbpm

public RuleSetNodeFactory timer(String delay, String period, String dialect, String action) {
  Timer timer = new Timer();
  timer.setDelay(delay);
  timer.setPeriod(period);
  getRuleSetNode().addTimer(timer, new DroolsConsequenceAction(dialect, action));
  return this;
}
origin: kiegroup/jbpm

  subNode = subNode.getNextSibling();
ruleSetNode.addOutAssociation(new DataAssociation(dataOutputs.get(source), target, assignments, transformation));
origin: org.jbpm/jbpm-case-mgmt-cmmn

assertThat(decisionTask.getName()).isEqualTo("call my decision");
assertThat(decisionTask.getLanguage()).isEqualTo(RuleSetNode.DMN_LANG);
assertThat(decisionTask.getRuleFlowGroup()).isNull();
assertThat(decisionTask.getNamespace()).isEqualTo("http://www.trisotech.com/definitions/_0020_vacation_days");
assertThat(decisionTask.getModel()).isEqualTo("_0020_vacation_days");
assertThat(decisionTask.getDecision()).isEqualTo("Total Vacation Days");
assertThat(decisionTask.getInAssociations()).hasSize(0);        
assertThat(decisionTask.getOutAssociations()).hasSize(0);        
org.jbpm.workflow.core.nodeRuleSetNode

Javadoc

Default implementation of a RuleSet node.

Most used methods

  • getRuleFlowGroup
  • <init>
  • setRuleFlowGroup
  • getInAssociations
  • getLanguage
  • getOutAssociations
  • addInAssociation
  • addOutAssociation
  • addTimer
  • getDecision
  • getInMappings
  • getModel
  • getInMappings,
  • getModel,
  • getName,
  • getNamespace,
  • getOutMappings,
  • getParameters,
  • getTimers,
  • removeParameter,
  • setDecision,
  • setLanguage

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getContentResolver (Context)
  • getResourceAsStream (ClassLoader)
  • onCreateOptionsMenu (Activity)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now