defWD2PN.tex 1.7 KB

12345678910111213141516171819202122232425262728293031
  1. %\lstinputlisting[name=wd2pn,numberstyle=\tiny,numbers=left,numberblanklines=true,frame=tb,firstnumber=1,firstline=89,lastline=118,caption=TODO,label=code:wd2pn,captionpos=b]{code/simplepdltopetrinet/SimplePDLToPetriNet.t}%style=codesource,
  2. %
  3. \begin{tomcode3}[caption=\texttt{WD2PN :} Code de la définition \emph{WorkDefinitionToPetriNet},label=code:wd2pn]
  4. definition WD2PN traversal `TopDown(WD2PN(tom__linkClass,pn)) {
  5. wd@WorkDefinition[name=name] -> {
  6. Place WDp_ready = `Place(name+"_ready", pn, 1);
  7. %tracelink(WDp_started:Place, `Place(name+"_started", pn, 0));
  8. Place WDp_running = `Place(name+"_running", pn, 0);
  9. %tracelink(WDp_finished:Place, `Place(name+"_finished", pn, 0));
  10. %tracelink(WDt_start:Transition, `Transition(name+"_start", pn, 1, 1));
  11. %tracelink(WDt_finish:Transition, `Transition(name+"_finish", pn, 1, 1));
  12. `Arc(WDt_start, WDp_ready, pn, ArcKindnormal(), 1);
  13. `Arc(WDp_started, WDt_start, pn, ArcKindnormal(), 1);
  14. `Arc(WDp_running, WDt_start, pn, ArcKindnormal(), 1);
  15. `Arc(WDt_finish, WDp_running, pn, ArcKindnormal(), 1);
  16. `Arc(WDp_finished, WDt_finish, pn, ArcKindnormal(), 1);
  17. SimplePDLSemantics.DDMMSimplePDL.Process parent = `wd.getParent();
  18. /* Pt_start et Pt_finish : transitions de l'image d'un processus, par
  19. exemple P#\colcode{black}{$_{root}$}# dans la figure#\colcode{black}{~\ref{fig:petrinetusecase}}# */
  20. Transition source = %resolve(parent:Process, Pt_start:Transition);
  21. source.setNet(pn);
  22. Arc tmpDistribute = `Arc(WDp_ready, source, pn, ArcKindnormal(), 1);
  23. Transition target = %resolve(parent:Process, Pt_finish:Transition);
  24. target.setNet(pn);
  25. Arc tmpRejoin = `Arc(target, WDp_finished, pn, ArcKindread_arc(), 1);
  26. }
  27. }
  28. \end{tomcode3}