oc-schedulerd/docs/uml/generating_graph_branches.puml

71 lines
2.3 KiB
Plaintext
Raw Permalink Normal View History

2024-05-02 09:52:28 +02:00
@startuml
actor oc_scheduler as oc
participant graph as graph
oc -> graph : loadFrom(worflow_name)
activate graph
activate oc
graph --> oc: Graph
group if g.Links size > 0
oc -> graph: generateArgo()
graph -> graph: create slice of end links (strings)
loop link in links
alt link is not a DC Link && destination id IS NOT a source id in any other link
graph -> graph: add link to list of endLinks
note right : exemple\n If current link is A-->B\n we look for another link like C-->A
end
end
2024-05-03 10:58:06 +02:00
graph -> graph : get list branches (end_lists, unvisited_links, current_branch)
note left: unvisited links and current branch\n are nilfor the first entry
2024-05-02 09:52:28 +02:00
loop link in endLinks
2024-05-03 10:58:06 +02:00
graph -> graph : create a new list representing the current branch
2024-05-02 09:52:28 +02:00
graph -> graph : copy Links id on a list
2024-05-03 10:58:06 +02:00
graph -> graph : get list previous links
2024-05-02 09:52:28 +02:00
2024-05-03 10:58:06 +02:00
group if len(previous_links) == 0
graph -> graph : add current list
end
2024-05-02 09:52:28 +02:00
2024-05-03 10:58:06 +02:00
loop for link in previous_links
graph -> graph : add the link to the current branch
graph -> graph : remove current link from unvisited links list
graph -> graph : get list branches (end_lists, unvisited_links, current_branch)
note right: for each link we retrieve the branch that\nprecedes it recursively,\n so once we hit the end of a branch\n the entire branch is returned\n to the node where a split happened\nor that is its source
2024-05-02 09:52:28 +02:00
end
end
end
@enduml
créer une liste sans les liens composant - DC
// selectionner toutes les fins de branches :
creer une liste d'identifiant
pour chaque lien
si dst n'est pas source on ajoute l'id du lien a la liste
// recréer chaque branche
pour chaque id de fin de branche
copier les liens dans un nouvel objet
declarer une variable pour controller s'il y'a encore un lien parent
tant qu'il y'a un lien parent
iterer dans la liste des liens
si un lien a en dst le même id que la source actuelle :
afficher "{id_src} s'execute une fois que {id_dst_trouve} est fini"
changer l'id de la source actuelle par celui de la source du lien trouvé
sinon
lien parent = faux