Scénario de test & Cas d'usage
Network analysis and graph algorithms.
Discover all actions of optNetworkCreation of an IT map containing a Self-Loop (Service A -> Service A) and a short loop (B <-> C).
| 1 | |
| 2 | DATA mycas.services; |
| 3 | INPUT srv_source $ srv_target $; |
| 4 | DATALINES; |
| 5 | Srv_A Srv_A Srv_B Srv_C Srv_C Srv_B Srv_D Srv_E; |
| 6 | |
| 7 | RUN; |
| 8 |
| 1 | |
| 2 | PROC CAS; |
| 3 | optNetwork.cycle RESULT=r STATUS=s / direction="DIRECTED" links={name="services"} linksVar={from="srv_source", to="srv_target"} selfLinks=TRUE maxCycles=1 deterministic=TRUE out={name="CriticalDeadlocks", replace=true}; |
| 4 | |
| 5 | RUN; |
| 6 |
| 1 | |
| 2 | PROC CAS; |
| 3 | TABLE.recordCount TABLE={name="CriticalDeadlocks"}; |
| 4 | |
| 5 | RUN; |
| 6 |
The action returns exactly one cycle (either the self-loop A->A or the loop B->C->B) because maxCycles=1. The presence of the self-loop is detected thanks to `selfLinks=TRUE`.