Skip to content

Commit 0617a3e

Browse files
authored
Merge pull request #94 from controlm/fix-bugs-10-24
update Control-M Python Client documentation Chaining Jobs
2 parents 4c064e6 + b74159f commit 0617a3e

File tree

14 files changed

+1157
-41848
lines changed

14 files changed

+1157
-41848
lines changed
Lines changed: 66 additions & 0 deletions
Loading

docs/_sources/notebooks/hello.ipynb.txt

Lines changed: 135 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
{
2020
"cell_type": "code",
21-
"execution_count": 1,
21+
"execution_count": 18,
2222
"metadata": {},
2323
"outputs": [],
2424
"source": [
@@ -29,7 +29,7 @@
2929
},
3030
{
3131
"cell_type": "code",
32-
"execution_count": 2,
32+
"execution_count": 19,
3333
"metadata": {},
3434
"outputs": [],
3535
"source": [
@@ -54,7 +54,7 @@
5454
},
5555
{
5656
"cell_type": "code",
57-
"execution_count": 3,
57+
"execution_count": 20,
5858
"metadata": {},
5959
"outputs": [],
6060
"source": [
@@ -78,7 +78,7 @@
7878
},
7979
{
8080
"cell_type": "code",
81-
"execution_count": 4,
81+
"execution_count": 21,
8282
"metadata": {},
8383
"outputs": [
8484
{
@@ -87,7 +87,7 @@
8787
"'MyFirstFolder/MyFirstJob'"
8888
]
8989
},
90-
"execution_count": 4,
90+
"execution_count": 21,
9191
"metadata": {},
9292
"output_type": "execute_result"
9393
}
@@ -111,7 +111,7 @@
111111
},
112112
{
113113
"cell_type": "code",
114-
"execution_count": 5,
114+
"execution_count": 22,
115115
"metadata": {},
116116
"outputs": [
117117
{
@@ -138,7 +138,7 @@
138138
},
139139
{
140140
"cell_type": "code",
141-
"execution_count": 6,
141+
"execution_count": 23,
142142
"metadata": {},
143143
"outputs": [
144144
{
@@ -167,7 +167,7 @@
167167
},
168168
{
169169
"cell_type": "code",
170-
"execution_count": 7,
170+
"execution_count": 24,
171171
"metadata": {},
172172
"outputs": [],
173173
"source": [
@@ -178,7 +178,7 @@
178178
},
179179
{
180180
"cell_type": "code",
181-
"execution_count": 8,
181+
"execution_count": 25,
182182
"metadata": {},
183183
"outputs": [
184184
{
@@ -223,7 +223,7 @@
223223
},
224224
{
225225
"cell_type": "code",
226-
"execution_count": 9,
226+
"execution_count": 26,
227227
"metadata": {},
228228
"outputs": [],
229229
"source": [
@@ -255,7 +255,7 @@
255255
},
256256
{
257257
"cell_type": "code",
258-
"execution_count": 10,
258+
"execution_count": 27,
259259
"metadata": {},
260260
"outputs": [
261261
{
@@ -293,10 +293,10 @@
293293
"</svg>\n"
294294
],
295295
"text/plain": [
296-
"<graphviz.graphs.Digraph at 0x2ef3e70af40>"
296+
"<graphviz.graphs.Digraph at 0x28d6ba39e20>"
297297
]
298298
},
299-
"execution_count": 10,
299+
"execution_count": 27,
300300
"metadata": {},
301301
"output_type": "execute_result"
302302
}
@@ -323,7 +323,7 @@
323323
},
324324
{
325325
"cell_type": "code",
326-
"execution_count": 11,
326+
"execution_count": 28,
327327
"metadata": {},
328328
"outputs": [
329329
{
@@ -341,7 +341,7 @@
341341
},
342342
{
343343
"cell_type": "code",
344-
"execution_count": 12,
344+
"execution_count": 29,
345345
"metadata": {},
346346
"outputs": [
347347
{
@@ -385,10 +385,10 @@
385385
"</svg>\n"
386386
],
387387
"text/plain": [
388-
"<graphviz.graphs.Digraph at 0x2ef3e75f940>"
388+
"<graphviz.graphs.Digraph at 0x28d6ebda3a0>"
389389
]
390390
},
391-
"execution_count": 12,
391+
"execution_count": 29,
392392
"metadata": {},
393393
"output_type": "execute_result"
394394
}
@@ -409,7 +409,7 @@
409409
},
410410
{
411411
"cell_type": "code",
412-
"execution_count": 13,
412+
"execution_count": 30,
413413
"metadata": {},
414414
"outputs": [
415415
{
@@ -465,10 +465,10 @@
465465
"</svg>\n"
466466
],
467467
"text/plain": [
468-
"<graphviz.graphs.Digraph at 0x2ef3e7e8520>"
468+
"<graphviz.graphs.Digraph at 0x28d6ecb58b0>"
469469
]
470470
},
471-
"execution_count": 13,
471+
"execution_count": 30,
472472
"metadata": {},
473473
"output_type": "execute_result"
474474
}
@@ -500,7 +500,7 @@
500500
},
501501
{
502502
"cell_type": "code",
503-
"execution_count": 14,
503+
"execution_count": 32,
504504
"metadata": {},
505505
"outputs": [
506506
{
@@ -574,10 +574,120 @@
574574
"</svg>\n"
575575
],
576576
"text/plain": [
577-
"<graphviz.graphs.Digraph at 0x2ef3e805220>"
577+
"<graphviz.graphs.Digraph at 0x28d6ec1b880>"
578578
]
579579
},
580-
"execution_count": 14,
580+
"execution_count": 32,
581+
"metadata": {},
582+
"output_type": "execute_result"
583+
}
584+
],
585+
"source": [
586+
"workflow.clear_all()\n",
587+
"\n",
588+
"def chain_jobs(jobs, inpath='ChainedJobs'):\n",
589+
" workflow.chain(jobs, inpath=inpath)\n",
590+
"\n",
591+
"chains = [\n",
592+
" [JobCommand('Job1', command='echo Hello1'), JobCommand('Job2', command='echo Hello2')],\n",
593+
" [JobCommand('Job1', command='echo Hello1'), JobCommand('Job3', command='echo Hello3')],\n",
594+
" [JobCommand('Job2', command='echo Hello2'), JobCommand('Job4', command='echo Hello4')],\n",
595+
" [JobCommand('Job3', command='echo Hello3'), JobCommand('Job4', command='echo Hello4')]\n",
596+
"]\n",
597+
"\n",
598+
"for job_chain in chains:\n",
599+
" chain_jobs(job_chain)\n",
600+
"\n",
601+
"get_graph(workflow)"
602+
]
603+
},
604+
{
605+
"cell_type": "markdown",
606+
"metadata": {},
607+
"source": [
608+
"Here’s an example for the same scenario using separate triggers:"
609+
]
610+
},
611+
{
612+
"cell_type": "code",
613+
"execution_count": 33,
614+
"metadata": {},
615+
"outputs": [
616+
{
617+
"data": {
618+
"image/svg+xml": [
619+
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
620+
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
621+
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
622+
"<!-- Generated by graphviz version 8.0.2 (20230410.1723)\n",
623+
" -->\n",
624+
"<!-- Title: root Pages: 1 -->\n",
625+
"<svg width=\"284pt\" height=\"153pt\"\n",
626+
" viewBox=\"0.00 0.00 283.58 153.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
627+
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 149)\">\n",
628+
"<title>root</title>\n",
629+
"<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-149 279.58,-149 279.58,4 -4,4\"/>\n",
630+
"<g id=\"clust1\" class=\"cluster\">\n",
631+
"<title>cluster_0</title>\n",
632+
"<polygon fill=\"none\" stroke=\"black\" points=\"8,-8 8,-137 267.58,-137 267.58,-8 8,-8\"/>\n",
633+
"<text text-anchor=\"middle\" x=\"137.79\" y=\"-121.8\" font-family=\"Times New Roman,serif\" font-size=\"14.00\">ChainedJobs</text>\n",
634+
"</g>\n",
635+
"<!-- ChainedJobs/Job1 -->\n",
636+
"<g id=\"node1\" class=\"node\">\n",
637+
"<title>ChainedJobs/Job1</title>\n",
638+
"<ellipse fill=\"none\" stroke=\"black\" cx=\"44.6\" cy=\"-61\" rx=\"28.7\" ry=\"18\"/>\n",
639+
"<text text-anchor=\"middle\" x=\"44.6\" y=\"-57.3\" font-family=\"Times New Roman,serif\" font-size=\"14.00\">Job1</text>\n",
640+
"</g>\n",
641+
"<!-- ChainedJobs/Job2 -->\n",
642+
"<g id=\"node2\" class=\"node\">\n",
643+
"<title>ChainedJobs/Job2</title>\n",
644+
"<ellipse fill=\"none\" stroke=\"black\" cx=\"137.79\" cy=\"-34\" rx=\"28.7\" ry=\"18\"/>\n",
645+
"<text text-anchor=\"middle\" x=\"137.79\" y=\"-30.3\" font-family=\"Times New Roman,serif\" font-size=\"14.00\">Job2</text>\n",
646+
"</g>\n",
647+
"<!-- ChainedJobs/Job1&#45;&gt;ChainedJobs/Job2 -->\n",
648+
"<g id=\"edge1\" class=\"edge\">\n",
649+
"<title>ChainedJobs/Job1&#45;&gt;ChainedJobs/Job2</title>\n",
650+
"<path fill=\"none\" stroke=\"black\" d=\"M71,-53.48C80.21,-50.75 90.8,-47.62 100.75,-44.67\"/>\n",
651+
"<polygon fill=\"black\" stroke=\"black\" points=\"101.61,-47.77 110.21,-41.57 99.63,-41.06 101.61,-47.77\"/>\n",
652+
"</g>\n",
653+
"<!-- ChainedJobs/Job3 -->\n",
654+
"<g id=\"node3\" class=\"node\">\n",
655+
"<title>ChainedJobs/Job3</title>\n",
656+
"<ellipse fill=\"none\" stroke=\"black\" cx=\"137.79\" cy=\"-88\" rx=\"28.7\" ry=\"18\"/>\n",
657+
"<text text-anchor=\"middle\" x=\"137.79\" y=\"-84.3\" font-family=\"Times New Roman,serif\" font-size=\"14.00\">Job3</text>\n",
658+
"</g>\n",
659+
"<!-- ChainedJobs/Job1&#45;&gt;ChainedJobs/Job3 -->\n",
660+
"<g id=\"edge2\" class=\"edge\">\n",
661+
"<title>ChainedJobs/Job1&#45;&gt;ChainedJobs/Job3</title>\n",
662+
"<path fill=\"none\" stroke=\"black\" d=\"M71,-68.52C80.21,-71.25 90.8,-74.38 100.75,-77.33\"/>\n",
663+
"<polygon fill=\"black\" stroke=\"black\" points=\"99.63,-80.94 110.21,-80.43 101.61,-74.23 99.63,-80.94\"/>\n",
664+
"</g>\n",
665+
"<!-- ChainedJobs/Job4 -->\n",
666+
"<g id=\"node4\" class=\"node\">\n",
667+
"<title>ChainedJobs/Job4</title>\n",
668+
"<ellipse fill=\"none\" stroke=\"black\" cx=\"230.99\" cy=\"-61\" rx=\"28.7\" ry=\"18\"/>\n",
669+
"<text text-anchor=\"middle\" x=\"230.99\" y=\"-57.3\" font-family=\"Times New Roman,serif\" font-size=\"14.00\">Job4</text>\n",
670+
"</g>\n",
671+
"<!-- ChainedJobs/Job2&#45;&gt;ChainedJobs/Job4 -->\n",
672+
"<g id=\"edge3\" class=\"edge\">\n",
673+
"<title>ChainedJobs/Job2&#45;&gt;ChainedJobs/Job4</title>\n",
674+
"<path fill=\"none\" stroke=\"black\" d=\"M164.2,-41.52C173.41,-44.25 184,-47.38 193.95,-50.33\"/>\n",
675+
"<polygon fill=\"black\" stroke=\"black\" points=\"192.82,-53.94 203.4,-53.43 194.81,-47.23 192.82,-53.94\"/>\n",
676+
"</g>\n",
677+
"<!-- ChainedJobs/Job3&#45;&gt;ChainedJobs/Job4 -->\n",
678+
"<g id=\"edge4\" class=\"edge\">\n",
679+
"<title>ChainedJobs/Job3&#45;&gt;ChainedJobs/Job4</title>\n",
680+
"<path fill=\"none\" stroke=\"black\" d=\"M164.2,-80.48C173.41,-77.75 184,-74.62 193.95,-71.67\"/>\n",
681+
"<polygon fill=\"black\" stroke=\"black\" points=\"194.81,-74.77 203.4,-68.57 192.82,-68.06 194.81,-74.77\"/>\n",
682+
"</g>\n",
683+
"</g>\n",
684+
"</svg>\n"
685+
],
686+
"text/plain": [
687+
"<graphviz.graphs.Digraph at 0x28d6ecd0880>"
688+
]
689+
},
690+
"execution_count": 33,
581691
"metadata": {},
582692
"output_type": "execute_result"
583693
}
@@ -636,7 +746,7 @@
636746
},
637747
{
638748
"cell_type": "code",
639-
"execution_count": 15,
749+
"execution_count": 34,
640750
"metadata": {},
641751
"outputs": [
642752
{
@@ -687,7 +797,7 @@
687797
},
688798
{
689799
"cell_type": "code",
690-
"execution_count": 16,
800+
"execution_count": 35,
691801
"metadata": {},
692802
"outputs": [
693803
{

0 commit comments

Comments
 (0)