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

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


   * @see com.catify.processengine.core.data.services.FlowNodeRepositoryService#delete(java.lang.String)
   */
  @Override
  public boolean delete(String uniqueFlowNodeId) {

    FlowNode flowNode = findByUniqueFlowNodeId(uniqueFlowNodeId);

    if (flowNode != null) {
      flowNodeRepository.delete(flowNode);
      return true;
    } else {
View Full Code Here


   * @see com.catify.processengine.core.data.services.FlowNodeRepositoryService#getOrCreateFlowNode(com.catify.processengine.core.data.model.entities.FlowNode)
   */
  @Override
  public FlowNode getOrCreateFlowNode(FlowNode proposedFlowNode) {
   
    FlowNode node = findByUniqueFlowNodeId(proposedFlowNode.getUniqueFlowNodeId());

    if (node == null) {
      return this.save(proposedFlowNode);
    }

View Full Code Here

   * @param processInstanceId the process instance id
   */
  @Transactional
  public void createSubProcessInstance(String parentUniqueFlowNodeId, String processInstanceId) {
   
    FlowNode subProcessFlowNode = flowNodeRepositoryService.findByUniqueFlowNodeId(parentUniqueFlowNodeId);
   
    LOG.debug(String.format(
        "Starting to instantiate sub-process %s with instanceId %s",
        subProcessFlowNode.getName(), processInstanceId));

    Set<FlowNode> flowNodes = neo4jTemplate.fetch(subProcessFlowNode.getSubProcessNodes());
   
    createFlowNodeInstances(processInstanceId, flowNodes);
   
    LOG.debug(String.format(
        "Finished instantiating process %s with instanceId %s",
View Full Code Here

    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);
View Full Code Here

    // create the top level flow nodes and connect them to the process
    for (TFlowNode flowNodeJaxb : flowNodesJaxb) {

      // create running nodes (database)
      FlowNode runningFlowNode = createRunningFlowNode(clientId, processJaxb, flowNodeJaxb, subProcessesJaxb, runningParentNode);
      jaxbToNeo4jRunningProcess.put(flowNodeJaxb, runningFlowNode);

      // create archive nodes (database)
      FlowNode archiveFlowNode = createArchiveFlowNode(clientId, processJaxb, flowNodeJaxb, subProcessesJaxb, archiveParentNode);
      jaxbToNeo4jArchiveProcess.put(flowNodeJaxb, archiveFlowNode);
 
      // create service nodes (runtime)
      createNodeServiceActor(clientId, processJaxb, subProcessesJaxb, flowNodeJaxb, sequenceFlowsJaxb);
     
View Full Code Here

   */
  private FlowNode createRunningFlowNode(String clientId, TProcess processJaxb, TFlowNode flowNodeJaxb,
      ArrayList<TSubProcess> subProcessesJaxb, Object runningParentNode) {

    // create running flow node
    FlowNode runningFlowNode = flowNodeRepositoryService.getOrCreateFlowNode(
        FlowNodeFactory.createFlowNode(flowNodeJaxb,
            IdService.getUniqueFlowNodeId(clientId, processJaxb, subProcessesJaxb, flowNodeJaxb)));
   
    LOG.debug(String.format("Added %s as %s with grapId: %s to neo4j db (running node)",
        flowNodeJaxb.getName(), runningFlowNode, runningFlowNode.getGraphId()));
   
    // depending on the type of the parent node, add a relationship between the new flow node and its parent
    if (runningParentNode instanceof ProcessNode) {
      ((ProcessNode) runningParentNode).addRelationshipToFlowNode(runningFlowNode);   
    } else if (runningParentNode instanceof FlowNode) {
View Full Code Here

   * @return the flow node
   */
  private FlowNode createArchiveFlowNode(String clientId, TProcess processJaxb, TFlowNode flowNodeJaxb,
      ArrayList<TSubProcess> subProcessesJaxb, Object archiveParentNode) {
    // create archive node
    FlowNode archiveFlowNode = flowNodeRepositoryService.getOrCreateFlowNode(
        FlowNodeFactory.createFlowNode(flowNodeJaxb,
            IdService.ARCHIVEPREFIX + IdService.getUniqueFlowNodeId(clientId, processJaxb, subProcessesJaxb, flowNodeJaxb)));
   
    LOG.debug(String.format("Added %s as %s with grapId: %s to neo4j db (archive node)",
        flowNodeJaxb.getName(), archiveFlowNode, archiveFlowNode.getGraphId()));
   
    // depending on the type of the parent node, add a relationship between the new flow node and its parent
    if (archiveParentNode instanceof ProcessNode) {
      ((ProcessNode) archiveParentNode).addRelationshipToFlowNode(archiveFlowNode);
    } else if (archiveParentNode instanceof FlowNode) {
View Full Code Here

   *            node objects
   */
  private void connectFlowNodes(TSequenceFlow sequenceFlowJaxb,
      Map<TFlowNode, FlowNode> jaxbToNeo4j) {

    FlowNode sourceNode = jaxbToNeo4j.get(sequenceFlowJaxb.getSourceRef());
    FlowNode targetNode = jaxbToNeo4j.get(sequenceFlowJaxb.getTargetRef());

    sourceNode.addFollowingFlowNodes(neo4jTemplate, targetNode);

    LOG.debug(String.format("Connecting %s:%s and %s:%s in neo4j db",
        sourceNode.getClass().getSimpleName(), sourceNode
            .getUniqueFlowNodeId(), targetNode.getClass()
            .getSimpleName(), targetNode.getUniqueFlowNodeId()));
  }
View Full Code Here

TOP

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

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.