We're updating the issue view to help you get more done. 

Deactivating a node could impact proceeding

Description

Steps to reproduce :
Log in System and goto workflow window.
Select Process Bank Statement (for instance) and deactivate "DocPrepare" node.
It has no impact (the node is still used in Start node transition).

Now, complete a bank statement. It will fail. Have a look into the log and you'll see :

MWFActivity.run: MWFNode[240-(Start),Action=Sleep:WaitTime=0] [132]
java.lang.NullPointerException
at org.compiere.wf.MWorkflow.addNodesSF(MWorkflow.java:433)
at org.compiere.wf.MWorkflow.getNodesInOrder(MWorkflow.java:356)

Seems that m_nodes loads only all actives nodes of the workflow (which seems correct).
When you use the getNode (int AD_WF_Node_ID) method, if it doesn't found the corresponding node, it will return null.

Here what should be done :
1 - When deactivating a node, deactivate also the transitions where it is used.
2 - Modify MWorkflow.getTransitions (int AD_Client_ID) so that it will add the node to the list only if it is activated.

WDYT ?

Regards,

Nicolas

Environment

None

Status

Assignee

Carlos Ruiz

Reporter

Nicolas Micoud

Labels

Tested By

None

Priority

Major