Tabnine Logo
NodeInstance.getNode
Code IndexAdd Tabnine to your IDE (free)

How to use
getNode
method
in
org.jbpm.workflow.instance.NodeInstance

Best Java code snippets using org.jbpm.workflow.instance.NodeInstance.getNode (Showing top 16 results out of 315)

origin: kiegroup/jbpm

private boolean canComplete() {
  if (nodeInstances.isEmpty()) {
    return true;
  } else {
    int eventSubprocessCounter = 0;
    for (NodeInstance nodeInstance : nodeInstances) {
      Node node = nodeInstance.getNode();
      if (node instanceof EventSubProcessNode) {
        if (((EventSubProcessNodeInstance) nodeInstance).getNodeInstances().isEmpty()) {
          eventSubprocessCounter++;
        }
      } else {
        return false;
      }
    }
    return eventSubprocessCounter == nodeInstances.size();
  }
}
origin: kiegroup/jbpm

public void nodeInstanceCompleted(NodeInstance nodeInstance, String outType) {
  Node nodeInstanceNode = nodeInstance.getNode();
  if( nodeInstanceNode != null ) {
    Object compensationBoolObj =  nodeInstanceNode.getMetaData().get("isForCompensation");
    boolean isForCompensation = compensationBoolObj == null ? false : ((Boolean) compensationBoolObj);
    if( isForCompensation ) {
      return;
    }
  }
  if (nodeInstance instanceof FaultNodeInstance || nodeInstance instanceof EndNodeInstance || nodeInstance instanceof EventSubProcessNodeInstance ) {
    if (getCompositeNode().isAutoComplete()) {
      if (nodeInstances.isEmpty()) {
        triggerCompleted(
          org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE);
      }
    }
  } else {
    throw new IllegalArgumentException(
      "Completing a node instance that has no outgoing connection not supported.");
  }
}
origin: kiegroup/jbpm

private void updateNodeInstances(NodeInstanceContainer nodeInstanceContainer, Map<String, Long> nodeMapping) {
  for (NodeInstance nodeInstance: nodeInstanceContainer.getNodeInstances()) {
    String oldNodeId = ((NodeImpl)
      ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).getNode()).getUniqueId();
    Long newNodeId = nodeMapping.get(oldNodeId);
    if (newNodeId == null) {
      newNodeId = nodeInstance.getNodeId();
    }
    ((NodeInstanceImpl) nodeInstance).setNodeId(newNodeId);
    if (nodeInstance instanceof NodeInstanceContainer) {
      updateNodeInstances((NodeInstanceContainer) nodeInstance, nodeMapping);
    }
  }
}

origin: kiegroup/jbpm

public void nodeInstanceCompleted(NodeInstance nodeInstance, String outType) {
  Node nodeInstanceNode = nodeInstance.getNode();
  if( nodeInstanceNode != null ) {
    Object compensationBoolObj =  nodeInstanceNode.getMetaData().get("isForCompensation");
    boolean isForCompensation = compensationBoolObj == null ? false : ((Boolean) compensationBoolObj);
    if( isForCompensation ) {
      return;
    }
  }
  if (nodeInstance instanceof FaultNodeInstance || nodeInstance instanceof EndNodeInstance ||
      ((org.jbpm.workflow.core.WorkflowProcess) getWorkflowProcess()).isDynamic()
      || nodeInstance instanceof CompositeNodeInstance) {
    if (((org.jbpm.workflow.core.WorkflowProcess) getProcess()).isAutoComplete()) {
      if (canComplete()) {
        setState(ProcessInstance.STATE_COMPLETED);
      }
    }
  } else {
    throw new IllegalArgumentException(
        "Completing a node instance that has no outgoing connection is not supported.");
  }
}
origin: kiegroup/jbpm

String oldNodeId = (String) ((NodeImpl) ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).getNode()).getMetaData().get("UniqueId");
String newNodeId = nodeMapping.get(oldNodeId);
if (newNodeId == null) {
  Boolean isHidden = (Boolean) ((NodeImpl) ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).getNode()).getMetaData().get("hidden");
  if (isHidden != null && isHidden.booleanValue()) {
origin: kiegroup/jbpm

private static void updateNodeInstances(NodeInstanceContainer nodeInstanceContainer, Map<String, Long> nodeMapping) {
  for (NodeInstance nodeInstance : nodeInstanceContainer.getNodeInstances()) {
    String oldNodeId = ((NodeImpl)
        ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).getNode()).getUniqueId();
    Long newNodeId = nodeMapping.get(oldNodeId);
    if (newNodeId == null) {
      newNodeId = nodeInstance.getNodeId();
    }
    // clean up iteration levels for removed (old) nodes
    Map<String, Integer> iterLevels = ((WorkflowProcessInstanceImpl) nodeInstance.getProcessInstance()).getIterationLevels();
    String uniqueId = (String) ((NodeImpl) nodeInstance.getNode()).getMetaData("UniqueId");
    iterLevels.remove(uniqueId);
    // and now set to new node id
    ((NodeInstanceImpl) nodeInstance).setNodeId(newNodeId);
    if (nodeInstance instanceof NodeInstanceContainer) {
      updateNodeInstances((NodeInstanceContainer) nodeInstance, nodeMapping);
    }
  }
}
origin: kiegroup/jbpm

public void nodeInstanceCompleted(org.jbpm.workflow.instance.NodeInstance nodeInstance, String outType) {
  Node nodeInstanceNode = nodeInstance.getNode();
  if( nodeInstanceNode != null ) {
    Object compensationBoolObj =  nodeInstanceNode.getMetaData().get("isForCompensation");
    boolean isForCompensation = compensationBoolObj == null ? false : ((Boolean) compensationBoolObj);
    if( isForCompensation ) {
      return;
    }
  }
  String completionCondition = getDynamicNode().getCompletionExpression();
  // TODO what if we reach the end of one branch but others might still need to be created ?
  // TODO are we sure there will always be node instances left if we are not done yet?
  if (isTerminated(nodeInstance)) {
    triggerCompleted(NodeImpl.CONNECTION_DEFAULT_TYPE);
  } else if (getDynamicNode().isAutoComplete() && getNodeInstances(false).isEmpty()) {
    triggerCompleted(NodeImpl.CONNECTION_DEFAULT_TYPE);
  } else if (completionCondition != null && "mvel".equals(getDynamicNode().getLanguage())) {
    Object value = MVELSafeHelper.getEvaluator().eval(completionCondition, new NodeInstanceResolverFactory(this));
    if ( !(value instanceof Boolean) ) {
      throw new RuntimeException( "Completion condition expression must return boolean values: " + value
          + " for expression " + completionCondition);
    }
    if (((Boolean) value).booleanValue()) {
      triggerCompleted(NodeImpl.CONNECTION_DEFAULT_TYPE);
    }
  }
}
origin: kiegroup/jbpm

public boolean evaluate(NodeInstance instance,
            Connection connection,
            Constraint constraint) {
  WorkflowProcessInstance processInstance = instance.getProcessInstance();
  InternalAgenda agenda = (InternalAgenda) ((ProcessInstance) processInstance).getKnowledgeRuntime().getAgenda();
  String rule = "RuleFlow-Split-" + processInstance.getProcessId() + "-" + 
    ((Node) instance.getNode()).getUniqueId() + "-" + 
    ((Node) connection.getTo()).getUniqueId() + "-" + connection.getToType();
  return agenda.isRuleActiveInRuleFlowGroup( "DROOLS_SYSTEM", rule, processInstance.getId() );
}
origin: org.jbpm/jbpm-flow

private boolean canComplete() {
  if (nodeInstances.isEmpty()) {
    return true;
  } else {
    int eventSubprocessCounter = 0;
    for (NodeInstance nodeInstance : nodeInstances) {
      Node node = nodeInstance.getNode();
      if (node instanceof EventSubProcessNode) {
        if (((EventSubProcessNodeInstance) nodeInstance).getNodeInstances().isEmpty()) {
          eventSubprocessCounter++;
        }
      } else {
        return false;
      }
    }
    return eventSubprocessCounter == nodeInstances.size();
  }
}
origin: org.jbpm/jbpm-flow

public void nodeInstanceCompleted(NodeInstance nodeInstance, String outType) {
  Node nodeInstanceNode = nodeInstance.getNode();
  if( nodeInstanceNode != null ) {
    Object compensationBoolObj =  nodeInstanceNode.getMetaData().get("isForCompensation");
    boolean isForCompensation = compensationBoolObj == null ? false : ((Boolean) compensationBoolObj);
    if( isForCompensation ) {
      return;
    }
  }
  if (nodeInstance instanceof FaultNodeInstance || nodeInstance instanceof EndNodeInstance || nodeInstance instanceof EventSubProcessNodeInstance ) {
    if (getCompositeNode().isAutoComplete()) {
      if (nodeInstances.isEmpty()) {
        triggerCompleted(
          org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE);
      }
    }
  } else {
    throw new IllegalArgumentException(
      "Completing a node instance that has no outgoing connection not supported.");
  }
}
origin: org.jbpm/jbpm-flow

private void updateNodeInstances(NodeInstanceContainer nodeInstanceContainer, Map<String, Long> nodeMapping) {
  for (NodeInstance nodeInstance: nodeInstanceContainer.getNodeInstances()) {
    String oldNodeId = ((NodeImpl)
      ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).getNode()).getUniqueId();
    Long newNodeId = nodeMapping.get(oldNodeId);
    if (newNodeId == null) {
      newNodeId = nodeInstance.getNodeId();
    }
    ((NodeInstanceImpl) nodeInstance).setNodeId(newNodeId);
    if (nodeInstance instanceof NodeInstanceContainer) {
      updateNodeInstances((NodeInstanceContainer) nodeInstance, nodeMapping);
    }
  }
}

origin: org.jbpm/jbpm-flow

public void nodeInstanceCompleted(NodeInstance nodeInstance, String outType) {
  Node nodeInstanceNode = nodeInstance.getNode();
  if( nodeInstanceNode != null ) {
    Object compensationBoolObj =  nodeInstanceNode.getMetaData().get("isForCompensation");
    boolean isForCompensation = compensationBoolObj == null ? false : ((Boolean) compensationBoolObj);
    if( isForCompensation ) {
      return;
    }
  }
  if (nodeInstance instanceof FaultNodeInstance || nodeInstance instanceof EndNodeInstance ||
      ((org.jbpm.workflow.core.WorkflowProcess) getWorkflowProcess()).isDynamic()
      || nodeInstance instanceof CompositeNodeInstance) {
    if (((org.jbpm.workflow.core.WorkflowProcess) getProcess()).isAutoComplete()) {
      if (canComplete()) {
        setState(ProcessInstance.STATE_COMPLETED);
      }
    }
  } else {
    throw new IllegalArgumentException(
        "Completing a node instance that has no outgoing connection is not supported.");
  }
}
origin: org.jbpm/jbpm-runtime-manager

String oldNodeId = (String) ((NodeImpl) ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).getNode()).getMetaData().get("UniqueId");
String newNodeId = nodeMapping.get(oldNodeId);
if (newNodeId == null) {
  Boolean isHidden = (Boolean) ((NodeImpl) ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).getNode()).getMetaData().get("hidden");
  if (isHidden != null && isHidden.booleanValue()) {
origin: org.jbpm/jbpm-flow

private static void updateNodeInstances(NodeInstanceContainer nodeInstanceContainer, Map<String, Long> nodeMapping) {
  for (NodeInstance nodeInstance : nodeInstanceContainer.getNodeInstances()) {
    String oldNodeId = ((NodeImpl)
        ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).getNode()).getUniqueId();
    Long newNodeId = nodeMapping.get(oldNodeId);
    if (newNodeId == null) {
      newNodeId = nodeInstance.getNodeId();
    }
    // clean up iteration levels for removed (old) nodes
    Map<String, Integer> iterLevels = ((WorkflowProcessInstanceImpl) nodeInstance.getProcessInstance()).getIterationLevels();
    String uniqueId = (String) ((NodeImpl) nodeInstance.getNode()).getMetaData("UniqueId");
    iterLevels.remove(uniqueId);
    // and now set to new node id
    ((NodeInstanceImpl) nodeInstance).setNodeId(newNodeId);
    if (nodeInstance instanceof NodeInstanceContainer) {
      updateNodeInstances((NodeInstanceContainer) nodeInstance, nodeMapping);
    }
  }
}
origin: org.jbpm/jbpm-flow

public void nodeInstanceCompleted(org.jbpm.workflow.instance.NodeInstance nodeInstance, String outType) {
  Node nodeInstanceNode = nodeInstance.getNode();
  if( nodeInstanceNode != null ) {
    Object compensationBoolObj =  nodeInstanceNode.getMetaData().get("isForCompensation");
    boolean isForCompensation = compensationBoolObj == null ? false : ((Boolean) compensationBoolObj);
    if( isForCompensation ) {
      return;
    }
  }
  String completionCondition = getDynamicNode().getCompletionExpression();
  // TODO what if we reach the end of one branch but others might still need to be created ?
  // TODO are we sure there will always be node instances left if we are not done yet?
  if (isTerminated(nodeInstance)) {
    triggerCompleted(NodeImpl.CONNECTION_DEFAULT_TYPE);
  } else if (getDynamicNode().isAutoComplete() && getNodeInstances(false).isEmpty()) {
    triggerCompleted(NodeImpl.CONNECTION_DEFAULT_TYPE);
  } else if (completionCondition != null && "mvel".equals(getDynamicNode().getLanguage())) {
    Object value = MVELSafeHelper.getEvaluator().eval(completionCondition, new NodeInstanceResolverFactory(this));
    if ( !(value instanceof Boolean) ) {
      throw new RuntimeException( "Completion condition expression must return boolean values: " + value
          + " for expression " + completionCondition);
    }
    if (((Boolean) value).booleanValue()) {
      triggerCompleted(NodeImpl.CONNECTION_DEFAULT_TYPE);
    }
  }
}
origin: org.jbpm/jbpm-flow

public boolean evaluate(NodeInstance instance,
            Connection connection,
            Constraint constraint) {
  WorkflowProcessInstance processInstance = instance.getProcessInstance();
  InternalAgenda agenda = (InternalAgenda) ((ProcessInstance) processInstance).getKnowledgeRuntime().getAgenda();
  String rule = "RuleFlow-Split-" + processInstance.getProcessId() + "-" + 
    ((Node) instance.getNode()).getUniqueId() + "-" + 
    ((Node) connection.getTo()).getUniqueId() + "-" + connection.getToType();
  return agenda.isRuleActiveInRuleFlowGroup( "DROOLS_SYSTEM", rule, processInstance.getId() );
}
org.jbpm.workflow.instanceNodeInstancegetNode

Popular methods of NodeInstance

  • getId
  • getSlaCompliance
  • resolveContextInstance
  • trigger
  • cancel
  • getLevel
  • getNodeId
  • getNodeInstanceContainer
  • getNodeName
  • getProcessInstance
  • getSlaDueDate
  • getSlaTimerId
  • getSlaDueDate,
  • getSlaTimerId,
  • setDynamicParameters

Popular in Java

  • Reactive rest calls using spring rest template
  • setScale (BigDecimal)
  • getExternalFilesDir (Context)
  • scheduleAtFixedRate (Timer)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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