Discussion:
[jboss-user] [jBPM] - How track JBPM5 flow diagram?
Zhao Lu
2013-03-14 09:20:21 UTC
Permalink
Zhao Lu [https://community.jboss.org/people/tiandaochouqin] created the discussion

"How track JBPM5 flow diagram?"

To view the discussion, visit: https://community.jboss.org/message/802578#802578

--------------------------------------------------------------
     I want to know when I start the process,
how to view a flow chart to keep track of the current node,
be able to view the flow chart of the current node.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/802578#802578]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Shobhit Tyagi
2013-03-14 15:11:58 UTC
Permalink
Shobhit Tyagi [https://community.jboss.org/people/roxy1987] created the discussion

"Re: How track JBPM5 flow diagram?"

To view the discussion, visit: https://community.jboss.org/message/802701#802701

--------------------------------------------------------------
Zhao,

I believe you only have process instance id.
So you can use the following to get the coordinates of the current node :
public static ArrayList<String> getProcessGraphicalStatus(String processInstanceId) throws Exception
{
  String processDefId = JPAProcessInstanceDbLog.findProcessInstance(Long.parseLong(processInstanceId)).getProcessId();
    kbase = readKnowledgeBase();  // Method to get the KnowledgeBase object.
     Process process = kbase.getProcess(processDefId);
 

  ArrayList<String> coordinates = new ArrayList<String>();
  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)
    {
     coordinates.add(node.getMetaData().get("x")+"");
     coordinates.add(node.getMetaData().get("y")+"");
     coordinates.add(node.getMetaData().get("height")+"");
     coordinates.add(node.getMetaData().get("width")+"");
    }
   }
  }
  catch(Exception e)
  {
   e.printStackTrace();
  }
  return coordinates;
}


Once you have the coordinates you can put the following in your view :


<div style="position:relative;width:1024px; height:768px;">
        <img src="ProcessImageUrl" style="position:absolute;top:0;left:0" />
       <ui:repeat value="CoordinateArrayList" var="item">
                 <div style="position:absolute;top:YCoordinatepx;left:XCoordinatepx;height:HeightCoordinatepx;width:WidthCoordinatepx;border:3px solid red; z-index:1000;"></div>
             </ui:repeat>
      </div>



Just reduce the height coordinate and width coordinate values by 6 before you put them in the view part.

Regards.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/802701#802701]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Zhao Lu
2013-03-17 01:27:14 UTC
Permalink
Zhao Lu [https://community.jboss.org/people/tiandaochouqin] created the discussion

"Re: How track JBPM5 flow diagram?"

To view the discussion, visit: https://community.jboss.org/message/803116#803116

--------------------------------------------------------------
Dear https://community.jboss.org/people/roxy1987 Shobhit Tyagi





Best wishes.
                                              Zhao
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/803116#803116]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Zhao Lu
2013-03-17 01:45:30 UTC
Permalink
Zhao Lu [https://community.jboss.org/people/tiandaochouqin] created the discussion

"Re: How track JBPM5 flow diagram?"

To view the discussion, visit: https://community.jboss.org/message/803120#803120

--------------------------------------------------------------
Dear  Shobhit
     Thank you very much.

Best wishes.

          Zhao
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/803120#803120]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Loading...