]
Thomas Diesler updated JBPM-1375:
---------------------------------
Fix Version/s: jBPM 3.3.2 GA
Revisit issues that have votes
Provide a way to determine the node type
----------------------------------------
Key: JBPM-1375
URL:
https://jira.jboss.org/jira/browse/JBPM-1375
Project: JBoss jBPM
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Components: Core Engine
Affects Versions: jBPM 3.2.3
Reporter: Mauro Molinari
Fix For: jBPM 3.3.2 GA
If you need to iterate over the nodes of a ProcessDefinition:
final List processNodes = processDefinition.getNodes ();
for (int x = 0; x < processNodes.size (); x++) {
final org.jbpm.graph.def.Node node = (org.jbpm.graph.def.Node) processNodes.get (x);
// ...
}
and you need to determine the actual type of a node, you cannot use instanceof because of
the potential use of CGLIB proxies.
So, there's no *clean* way to determine the actual type of a node!!
Using the HibernateProxy workaround cited in the JBoss Forum reference attached, is not
acceptable IMHO, because you're loosing the transparency against the underlying
persistence technology. Moreover, it doesn't seem to work in the tests we're
doing.
Using the alternative toString() workaround is also a dirty trick, because the toString()
implementation might change and toString() shouldn't be used for this kind of things.
In another discussion:
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4156233
another user is experiencing our exact problem with the StartState: but we're not
guaranteed that the same issue doesn't happen with other node types.
I can hardly accept the fact that a XXNode instance can't be cast to an XXNode object
reference, however if this is the case, I think a clean way to determine the type of a
node should then be provided by the jBPM API.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: