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

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

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

origin: kiegroup/jbpm

public NodeInstance getNodeInstance(long nodeInstanceId) {
  for (NodeInstance nodeInstance: nodeInstances) {
    if (nodeInstance.getId() == nodeInstanceId) {
      return nodeInstance;
    }
  }
  return null;
}
origin: kiegroup/jbpm

public NodeInstance getNodeInstance(long nodeInstanceId) {
  for (NodeInstance nodeInstance: nodeInstances) {
    if (nodeInstance.getId() == nodeInstanceId) {
      return nodeInstance;
    }
  }
  return null;
}
origin: kiegroup/jbpm

public void addNodeInstance(final NodeInstance nodeInstance) {
  if (nodeInstance.getId() == -1) {
    // assign new id only if it does not exist as it might already be set by marshalling 
    // it's important to keep same ids of node instances as they might be references e.g. exclusive group
    long id = singleNodeInstanceCounter.incrementAndGet();  
    ((NodeInstanceImpl) nodeInstance).setId(id);
  }
  this.nodeInstances.add(nodeInstance);
}
origin: kiegroup/jbpm

public NodeInstance getNodeInstance(long nodeInstanceId, boolean recursive) {
  for (NodeInstance nodeInstance: getNodeInstances(recursive)) {
    if (nodeInstance.getId() == nodeInstanceId) {
      return nodeInstance;
    }
  }
  return null;
}
origin: kiegroup/jbpm

public void addNodeInstance(final NodeInstance nodeInstance) {
  if (nodeInstance.getId() == -1) {
    // assign new id only if it does not exist as it might already be set by marshalling
    // it's important to keep same ids of node instances as they might be references e.g. exclusive group
    long id = singleNodeInstanceCounter.incrementAndGet();
    ((NodeInstanceImpl) nodeInstance).setId(id);
  }
  this.nodeInstances.add(nodeInstance);
}
origin: kiegroup/jbpm

public NodeInstance getNodeInstance(long nodeInstanceId, boolean recursive) {
  for (NodeInstance nodeInstance: getNodeInstances(recursive)) {
    if (nodeInstance.getId() == nodeInstanceId) {
      return nodeInstance;
    }
  }
  return null;
}
origin: kiegroup/jbpm

  @Override
  public Map<Long, List<TimerInstance>> execute(Context context) {
    Map<Long, List<TimerInstance>> result = new LinkedHashMap<>();
    KieSession kieSession = ((RegistryContext) context).lookup(KieSession.class);
    TimerManager timerManager = getTimerManager(kieSession);
    WorkflowProcessInstanceImpl processInstance = (WorkflowProcessInstanceImpl) kieSession.getProcessInstance(migrationSpec.getProcessInstanceId());
    Collection<org.jbpm.workflow.instance.NodeInstance> activeInstances = processInstance.getNodeInstances(true);
    for (org.jbpm.workflow.instance.NodeInstance active : activeInstances) {
      if (active instanceof TimerNodeInstance) {
        TimerInstance timerInstance = timerManager.getTimerMap().get(((TimerNodeInstance) active).getTimerId());
        
        timerManager.cancelTimer(timerInstance.getId());
        result.put(active.getId(), Arrays.asList(timerInstance));
      } else if (active instanceof StateBasedNodeInstance) {
        List<Long> timers = ((StateBasedNodeInstance) active).getTimerInstances();
        if (timers != null && !timers.isEmpty()) {
          List<TimerInstance> collected = new ArrayList<>();
          for (Long timerId : timers) {
            TimerInstance timerInstance = timerManager.getTimerMap().get(timerId);
            timerManager.cancelTimer(timerInstance.getId());
            collected.add(timerInstance);
          }
          result.put(active.getId(), collected);
        }
      }
    }
    return result;
  }
});
origin: kiegroup/jbpm

  private int getSLAComplianceForNodeInstance(long processInstanceId, org.jbpm.workflow.instance.NodeInstance nodeInstance, int logType) {
    int slaCompliance = -1;
    if (sessionPersistence) {
      List<NodeInstanceLog> logs = logService.findNodeInstances(processInstanceId);
      if (logs != null) {

        for (NodeInstanceLog log : logs) {
          if (log.getType() == logType && log.getNodeInstanceId().equals(String.valueOf(nodeInstance.getId()))) {
            slaCompliance = log.getSlaCompliance();
            break;
          }
        }
      }
    } else {
      slaCompliance = nodeInstance.getSlaCompliance();
    }
    return slaCompliance;
  }
}
origin: org.jbpm/jbpm-flow

public NodeInstance getNodeInstance(long nodeInstanceId) {
  for (NodeInstance nodeInstance: nodeInstances) {
    if (nodeInstance.getId() == nodeInstanceId) {
      return nodeInstance;
    }
  }
  return null;
}
origin: org.jbpm/jbpm-flow

public NodeInstance getNodeInstance(long nodeInstanceId) {
  for (NodeInstance nodeInstance: nodeInstances) {
    if (nodeInstance.getId() == nodeInstanceId) {
      return nodeInstance;
    }
  }
  return null;
}
origin: org.jbpm/jbpm-flow

public void addNodeInstance(final NodeInstance nodeInstance) {
  if (nodeInstance.getId() == -1) {
    // assign new id only if it does not exist as it might already be set by marshalling 
    // it's important to keep same ids of node instances as they might be references e.g. exclusive group
    long id = singleNodeInstanceCounter.incrementAndGet();  
    ((NodeInstanceImpl) nodeInstance).setId(id);
  }
  this.nodeInstances.add(nodeInstance);
}
origin: org.jbpm/jbpm-flow

public void addNodeInstance(final NodeInstance nodeInstance) {
  if (nodeInstance.getId() == -1) {
    // assign new id only if it does not exist as it might already be set by marshalling
    // it's important to keep same ids of node instances as they might be references e.g. exclusive group
    long id = singleNodeInstanceCounter.incrementAndGet();
    ((NodeInstanceImpl) nodeInstance).setId(id);
  }
  this.nodeInstances.add(nodeInstance);
}
origin: org.jbpm/jbpm-flow

public NodeInstance getNodeInstance(long nodeInstanceId, boolean recursive) {
  for (NodeInstance nodeInstance: getNodeInstances(recursive)) {
    if (nodeInstance.getId() == nodeInstanceId) {
      return nodeInstance;
    }
  }
  return null;
}
origin: org.jbpm/jbpm-flow

public NodeInstance getNodeInstance(long nodeInstanceId, boolean recursive) {
  for (NodeInstance nodeInstance: getNodeInstances(recursive)) {
    if (nodeInstance.getId() == nodeInstanceId) {
      return nodeInstance;
    }
  }
  return null;
}
origin: org.jbpm/jbpm-runtime-manager

  @Override
  public Map<Long, List<TimerInstance>> execute(Context context) {
    Map<Long, List<TimerInstance>> result = new LinkedHashMap<>();
    KieSession kieSession = ((RegistryContext) context).lookup(KieSession.class);
    TimerManager timerManager = getTimerManager(kieSession);
    WorkflowProcessInstanceImpl processInstance = (WorkflowProcessInstanceImpl) kieSession.getProcessInstance(migrationSpec.getProcessInstanceId());
    Collection<org.jbpm.workflow.instance.NodeInstance> activeInstances = processInstance.getNodeInstances(true);
    for (org.jbpm.workflow.instance.NodeInstance active : activeInstances) {
      if (active instanceof TimerNodeInstance) {
        TimerInstance timerInstance = timerManager.getTimerMap().get(((TimerNodeInstance) active).getTimerId());
        
        timerManager.cancelTimer(timerInstance.getId());
        result.put(active.getId(), Arrays.asList(timerInstance));
      } else if (active instanceof StateBasedNodeInstance) {
        List<Long> timers = ((StateBasedNodeInstance) active).getTimerInstances();
        if (timers != null && !timers.isEmpty()) {
          List<TimerInstance> collected = new ArrayList<>();
          for (Long timerId : timers) {
            TimerInstance timerInstance = timerManager.getTimerMap().get(timerId);
            timerManager.cancelTimer(timerInstance.getId());
            collected.add(timerInstance);
          }
          result.put(active.getId(), collected);
        }
      }
    }
    return result;
  }
});
origin: org.jbpm/jbpm-bpmn2

  private int getSLAComplianceForNodeInstance(long processInstanceId, org.jbpm.workflow.instance.NodeInstance nodeInstance, int logType) {
    int slaCompliance = -1;
    if (sessionPersistence) {
      List<NodeInstanceLog> logs = logService.findNodeInstances(processInstanceId);
      if (logs != null) {

        for (NodeInstanceLog log : logs) {
          if (log.getType() == logType && log.getNodeInstanceId().equals(String.valueOf(nodeInstance.getId()))) {
            slaCompliance = log.getSlaCompliance();
            break;
          }
        }
      }
    } else {
      slaCompliance = nodeInstance.getSlaCompliance();
    }
    return slaCompliance;
  }
}
org.jbpm.workflow.instanceNodeInstancegetId

Popular methods of NodeInstance

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

Popular in Java

  • Reactive rest calls using spring rest template
  • setRequestProperty (URLConnection)
  • putExtra (Intent)
  • startActivity (Activity)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • 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