Package com.catify.processengine.core.data.model.entities

Examples of com.catify.processengine.core.data.model.entities.FlowNodeInstance


   */
  @Override
  public Iterable<FlowNodeInstance> findLoosingFlowNodeInstances(
      String uniqueProcessId, String uniqueFlowNodeId, String instanceId) {

    FlowNodeInstance startingNode = this.findFlowNodeInstance(
        uniqueProcessId, uniqueFlowNodeId, instanceId);
   
    return flowNodeInstanceRepository.findAllByTraversal(startingNode,
        getTraversalDescriptionStopOnStatePassed());
  }
View Full Code Here


   */
  @Override
  public Set<String> findLoosingFlowNodeIds(
      String uniqueProcessId, String uniqueFlowNodeId, String instanceId) {

    FlowNodeInstance startingNode = this.findFlowNodeInstance(
        uniqueProcessId, uniqueFlowNodeId, instanceId);
       
    return flowNodeInstanceRepository.findPreviousFlowNodeIdsNotInGivenStates(
        startingNode.getGraphId(), NodeInstaceStates.PASSED_STATE, NodeInstaceStates.DEACTIVATED_STATE);
  }
View Full Code Here

    // operation) to avoid unnecessary db lookups
    if (this.nodeInstance == null
        || !this.nodeInstance.getHasInstanceRelationship()
            .getInstanceId().equals(processInstanceId)) {
     
      FlowNodeInstance flowNodeInstance = flowNodeInstanceRepositoryService.findFlowNodeInstance(
          uniqueProcessId, uniqueFlowNodeId, processInstanceId);
     
      LOG.debug(String.format(
          "Searching FlowNodeInstance in db with parameters: %s, %s, %s. Found: %s",
          uniqueProcessId, uniqueFlowNodeId, processInstanceId,
View Full Code Here

   
    // create relationships between process instance node and start node instances
    // TODO: this is a pretty costly operation and should be evaluated
    for (FlowNode flowNode : flowNodes) {
      if (flowNode.getNodeType().equals(TStartEvent.class.toString())) {
        FlowNodeInstance startNodeInstance = flowNodeInstanceRepositoryService
        .findFlowNodeInstance(uniqueProcessId, flowNode.getUniqueFlowNodeId(), processInstanceId);
        processInstanceNode.addRelationshipToStartEventInstance(startNodeInstance);
      }
    }
   
View Full Code Here

   
    for (FlowNode flowNode : flowNodes) {
      LOG.debug(String
          .format("FlowNode to be instantiated: %s:%s", flowNode.getFlowNodeId(), flowNode.getNodeType()));
     
      FlowNodeInstance flowNodeInstance = new FlowNodeInstance(
          NodeInstaceStates.INACTIVE_STATE,
          flowNode.getFiredFlowsNeeded());
     
      flowNodeInstance.addAsInstanceOf(flowNode, processInstanceId);
     
      flowNodeInstanceRepositoryService.save(flowNodeInstance);
     
      flowNodeInstances.put(flowNode, flowNodeInstance);
    }  
   
    // create relationships between the node instances
    for (FlowNode flowNode : flowNodeInstances.keySet()) {
     
      // get the flow node this instance node is an instance of (it has
      // the needed relationship information)
      FlowNodeInstance flowNodeInstance = flowNodeInstances.get(flowNode);
     
      // mirror the flow node relationships to the flow node instances
      for (FlowNode followingFlowNode : neo4jTemplate.fetch(flowNode.getFollowingFlowNodes())) {

        // (TODO: evaluate if a query beginning at the process might be faster)
        FlowNodeInstance followingFlowNodeInstance = flowNodeInstanceRepositoryService
            .findFlowNodeInstance(followingFlowNode.getGraphId(),
                processInstanceId);

        flowNodeInstance.addFollowingInstance(followingFlowNodeInstance);
View Full Code Here

  public void archiveProcessInstance(String uniqueProcessId, String processInstanceId, Date endTime) { 
   
    // save the flow node instances to their archived flow nodes
    Iterable<Map<String,Object>> result = flowNodeInstanceRepositoryService.findAllFlowNodeInstancesAndFlowNodeIds(uniqueProcessId, processInstanceId);
    for (Map<String, Object> map : result) {
      FlowNodeInstance flowNodeInstance = neo4jTemplate.convert(map.get("flownodeinstance"), FlowNodeInstance.class);
      String flowNodeId = (String) map.get("flownode.uniqueFlowNodeId");
     
      FlowNode archivedFlowNode = flowNodeRepositoryService.findArchivedByRunningUniqueFlowNodeId(flowNodeId);
      flowNodeInstance.moveToArchive(archivedFlowNode, processInstanceId);
    }
   
    // save the process instance node to the archived process node
    ProcessNode archivedProcessNode = processRepositoryService.findArchivedByRunningUniqueProcessId(uniqueProcessId);
    ProcessInstanceNode processInstanceNode = loadProcessInstanceNode(uniqueProcessId, processInstanceId);
View Full Code Here

TOP

Related Classes of com.catify.processengine.core.data.model.entities.FlowNodeInstance

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.