28 lines
846 B
Plaintext
28 lines
846 B
Plaintext
|
module SimplePDL2PetriNet;
|
|||
|
create OUT: petrinet from IN: simplepdl;
|
|||
|
|
|||
|
-- Obtenir le processus qui contient ce process element.
|
|||
|
-- Remarque: Ce helper ne serait pas utile si une r<>f<EFBFBD>rence opposite
|
|||
|
-- avait <20>t<EFBFBD> plac<61>e entre Process et ProcessElement
|
|||
|
helper context simplepdl!ProcessElement
|
|||
|
def: getProcess(): simplepdl!Process =
|
|||
|
simplepdl!Process.allInstances()
|
|||
|
->select(p | p.processElements->includes(self))
|
|||
|
->asSequence()->first();
|
|||
|
|
|||
|
-- Traduire un Process en un PetriNet de m<>me nom
|
|||
|
rule Process2PetriNet {
|
|||
|
from p: simplepdl!Process
|
|||
|
to pn: petrinet!Network (name <- p.name)
|
|||
|
}
|
|||
|
|
|||
|
-- Traduire une WorkDefinition en un motif sur le r<>seau de Petri
|
|||
|
rule WorkDefinition2PetriNet {
|
|||
|
from wd: simplepdl!WorkDefinition
|
|||
|
to
|
|||
|
-- PLACES d'une WorkDefinition
|
|||
|
p_ready: petrinet!Place(
|
|||
|
name <- wd.name + '_ready',
|
|||
|
tokens <- 1)
|
|||
|
}
|