3 Replies Latest reply on Feb 15, 2013 10:04 AM by roxy1987

    Implementing "Where Is the Process Now" feature

    anindyas79

      Our customer a major financial giant wants a "Where Is the Process Now" feature as is available in some of the BPM products. I have looked at the GraphViewerPluginImpl.java and ProcessActivityPluginImpl.java of jbpm-gwt-graph project and got some idea on how to get the diagram of a process on the fly and also overlay a red arrow .jpg file on the active node to signify the current state of the process pictorially. I followed this http://www.simplethoughtsonline.com/2012/09/displaying-jbpm-diagram-of-current.html

       

      However, I also looked at the simulation video here http://kverlaen.blogspot.be/2012/11/jbpm-54-released.html The way the path is tracked in the simulation is actually nice and we want to implement soething like that by showing the process and highlighting the path the process has taken till now.

       

      Any thoughts on how could it be done elegantly?

       

      With regards

      Anindya

        • 1. Re: Implementing "Where Is the Process Now" feature
          roxy1987

          To get the status of a process graphically, you need to find out the coordinates of the activity which is currently pending. The coordinates are saved in the bpmn file and can be retrieved as following :

          process = kbase.getProcess(processDefId);
          ArrayList<Object> coordinates = new ArrayList<Object>();
          try
          {
          List<NodeInstanceLog> nodeInstanceLogList;
          for (Node node : (Node[])((WorkflowProcessImpl) process).getNodes())
          {
          nodeInstanceLogList = JPAProcessInstanceDbLog.findNodeInstances(Long.parseLong(processInstanceId), new Long(node.getId()).toString());
          if(nodeInstanceLogList.size() == 1)
          {
          logger.info("Name of the Node : "+node.getName());
          coordinates.add(node.getMetaData().get("x"));
          coordinates.add(node.getMetaData().get("y"));
          coordinates.add(node.getMetaData().get("height"));
          coordinates.add(node.getMetaData().get("width"));
          }
          }
          coordinates.add(processName);
          }
          catch(Exception e)
          {
          CustomExceptionHandler.handleException(e);
          }
          
          


          Once you have the coordinates you can use div tags in html to relatively places images of process and arrow.

          • 2. Re: Implementing "Where Is the Process Now" feature
            anindyas79

            Yes, I am aware of that and I have posted the links of that too. However, that is not what I am looking for. The way the path is tracked in the new jBPM Process Simulation is actually nice and we want to implement something like that by showing the process diagram and highlighting the entire path the process has taken till now.

            • 3. Re: Implementing "Where Is the Process Now" feature
              roxy1987

              yeah well your link dont use the same method.

              Cant check out the video in office. ANyway. good luck with that.