In JBPM, we can see such test code in many places:
Pd = new processdefinition (new string "{NEW STRING [] {
"Start-State Start",
"State First",
"State Second",
"State Third",
End-state end
}, new string [] {
"Start --left -> first",
"Start --right -> SECOND",
"First -> Third",
"SECOND -> Third",
"third -> end"
});
The first parameter of this method is the Node array in the process definition, and the second parameter is the expression of Transition.
Such as: second -> third represents a transition from Second Node to Third Node
Start --Left -> first represents a transition from Start to First, its name is Left
The code that implements this string is in the processFactory.cuttransitionText () method, and this method is completely for testing.
Written, thereby we can see the importance of unit testing.