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

  • Running tasks concurrently on multiple threads
  • compareTo (BigDecimal)
  • notifyDataSetChanged (ArrayAdapter)
  • addToBackStack (FragmentTransaction)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Notification (javax.management)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top 15 Vim Plugins
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