cpee 2.0.25 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/cockpit/css/ui.css +27 -4
- data/cockpit/css/wfadaptor.css +11 -0
- data/cockpit/edit.html +10 -10
- data/cockpit/graph.html +3 -3
- data/cockpit/index.html +9 -6
- data/cockpit/js/details.js +0 -1
- data/cockpit/js/instance.js +26 -19
- data/cockpit/js/model.js +6 -11
- data/cockpit/js/parameters.js +6 -4
- data/cockpit/js/wfadaptor.js +2 -0
- data/cockpit/model.html +4 -3
- data/cockpit/replay.html +3 -2
- data/cockpit/templates.legacy/Async.xml +12 -12
- data/cockpit/templates.legacy/BCO.xml +9 -11
- data/cockpit/templates.legacy/BCS.xml +9 -11
- data/cockpit/templates.legacy/Centurio.xml +7 -7
- data/cockpit/templates.legacy/Concurrent.xml +7 -7
- data/cockpit/templates.legacy/Coopis Testset.xml +7 -7
- data/cockpit/templates.legacy/Endpoints and Data Manipulation.xml +6 -7
- data/cockpit/templates.legacy/ICSOC Testset.xml +7 -7
- data/cockpit/templates.legacy/Infinity.xml +7 -7
- data/cockpit/templates.legacy/Lego Boxer.xml +13 -13
- data/cockpit/templates.legacy/Lego Conveyor.xml +13 -13
- data/cockpit/templates.legacy/Lego Crane.xml +16 -16
- data/cockpit/templates.legacy/Lego Ejector.xml +16 -16
- data/cockpit/templates.legacy/Lego Full.xml +12 -12
- data/cockpit/templates.legacy/Lego Liddy.xml +13 -13
- data/cockpit/templates.legacy/Lego Plate.xml +13 -13
- data/cockpit/templates.legacy/Lego Transporter.xml +14 -14
- data/cockpit/templates.legacy/Lego_Part_1.xml +12 -12
- data/cockpit/templates.legacy/LgLinear.xml +7 -10
- data/cockpit/templates.legacy/Linear.xml +11 -14
- data/cockpit/templates.legacy/Log.xml +11 -12
- data/cockpit/templates.legacy/Mangler 1.xml +7 -7
- data/cockpit/templates.legacy/Mangler 2.xml +7 -7
- data/cockpit/templates.legacy/Manuel Labels.xml +11 -11
- data/cockpit/templates.legacy/Promise.xml +30 -30
- data/cockpit/templates.legacy/SOPROMO Test Sonification.xml +7 -7
- data/cockpit/templates.legacy/Subprocess.xml +15 -15
- data/cockpit/templates.legacy/Syncing P34 1.xml +8 -11
- data/cockpit/templates.legacy/Syncing P34 2.xml +8 -11
- data/cockpit/templates.legacy/Syncing P34 3.xml +8 -11
- data/cockpit/templates.legacy/Syncing P34.xml +8 -11
- data/cockpit/templates.legacy/TEST - Bad Loop.xml +7 -7
- data/cockpit/templates.legacy/TEST - Wrong Positions.xml +7 -7
- data/cockpit/templates.legacy/Take_5.xml +14 -14
- data/cockpit/templates.legacy/Update.xml +11 -11
- data/cockpit/templates.legacy/Worklist Parallel.xml +17 -17
- data/cockpit/templates.legacy/Worklist Test CPEE.xml +14 -14
- data/cockpit/templates.legacy/Worklist Test.xml +14 -14
- data/cockpit/templates.legacy/Worklist Test2.xml +14 -14
- data/cockpit/templates/Coopis 2010.xml +7 -7
- data/cockpit/templates/IUPC arXiv:1104.3609 P34 1.xml +9 -12
- data/cockpit/templates/IUPC arXiv:1104.3609 P34 2.xml +9 -12
- data/cockpit/templates/IUPC arXiv:1104.3609 P34 3.xml +9 -12
- data/cockpit/templates/Track Test Local.xml +8 -4
- data/cockpit/templates/Track Test.xml +6 -2
- data/cockpit/templates/UR-VUE 2020 Manual Adjust.xml +6 -2
- data/cockpit/templates/UR-VUE 2020 Solution Baseline.xml +9 -5
- data/cockpit/templates/UR-VUE 2020 Solution NN.xml +9 -5
- data/cockpit/templates/UR-VUE 2020 Solution View.xml +9 -5
- data/cockpit/templates/UR-VUE 2020.xml +9 -5
- data/cockpit/templates/Worklist.xml +14 -14
- data/cockpit/templates/instantiate.local/Take_Sub.xml +2 -2
- data/cockpit/templates/instantiate/Take_Perf.xml +1 -1
- data/cockpit/templates/instantiate/Take_Sub.xml +2 -2
- data/cockpit/templates/instantiate/Take_X.xml +2 -2
- data/cockpit/themes/compact/rngs/parallel.rng +6 -0
- data/cockpit/themes/compact/rngs/start.rng +83 -0
- data/cockpit/themes/compact/symbols/parallel_branch_event.svg +2 -2
- data/cockpit/themes/compact/symbols/parallel_eventbased_exclusive.svg +9 -0
- data/cockpit/themes/compact/symbols/parallel_eventbased_parallel.svg +8 -0
- data/cockpit/themes/compact/symbols/start.svg +1 -1
- data/cockpit/themes/compact/theme.js +45 -2
- data/cockpit/themes/control/rngs/parallel.rng +6 -0
- data/cockpit/themes/control/rngs/start.rng +83 -0
- data/cockpit/themes/control/symbols/parallel_branch_event.svg +2 -2
- data/cockpit/themes/control/symbols/parallel_eventbased_exclusive.svg +9 -0
- data/cockpit/themes/control/symbols/parallel_eventbased_parallel.svg +8 -0
- data/cockpit/themes/control/symbols/start.svg +1 -1
- data/cockpit/themes/control/theme.js +45 -2
- data/cockpit/themes/default/rngs/parallel.rng +6 -0
- data/cockpit/themes/default/rngs/start.rng +83 -0
- data/cockpit/themes/default/symbols/parallel_branch_event.svg +2 -2
- data/cockpit/themes/default/symbols/parallel_eventbased_exclusive.svg +9 -0
- data/cockpit/themes/default/symbols/parallel_eventbased_parallel.svg +8 -0
- data/cockpit/themes/default/symbols/start.svg +1 -1
- data/cockpit/themes/default/theme.js +46 -3
- data/cockpit/themes/extended/rngs/parallel.rng +6 -0
- data/cockpit/themes/extended/rngs/start.rng +83 -0
- data/cockpit/themes/extended/symbols/parallel_branch_event.svg +2 -2
- data/cockpit/themes/extended/symbols/parallel_eventbased_exclusive.svg +9 -0
- data/cockpit/themes/extended/symbols/parallel_eventbased_parallel.svg +8 -0
- data/cockpit/themes/extended/symbols/start.svg +1 -1
- data/cockpit/themes/extended/theme.js +45 -2
- data/cockpit/themes/model/symbols/parallel_branch_event.svg +2 -2
- data/cockpit/themes/model/symbols/parallel_eventbased_exclusive.svg +9 -0
- data/cockpit/themes/model/symbols/parallel_eventbased_parallel.svg +8 -0
- data/cockpit/themes/model/symbols/start.svg +1 -1
- data/cockpit/themes/model/theme.js +45 -2
- data/cockpit/themes/packed/rngs/parallel.rng +6 -0
- data/cockpit/themes/packed/rngs/start.rng +83 -0
- data/cockpit/themes/packed/symbols/parallel_branch_event.svg +2 -2
- data/cockpit/themes/packed/symbols/parallel_eventbased_exclusive.svg +9 -0
- data/cockpit/themes/packed/symbols/parallel_eventbased_parallel.svg +8 -0
- data/cockpit/themes/packed/symbols/start.svg +1 -1
- data/cockpit/themes/packed/theme.js +45 -2
- data/cockpit/themes/preset/rngs/parallel.rng +6 -0
- data/cockpit/themes/preset/rngs/start.rng +83 -0
- data/cockpit/themes/preset/symbols/parallel_branch_event.svg +2 -2
- data/cockpit/themes/preset/symbols/parallel_eventbased_exclusive.svg +9 -0
- data/cockpit/themes/preset/symbols/parallel_eventbased_parallel.svg +8 -0
- data/cockpit/themes/preset/symbols/start.svg +1 -1
- data/cockpit/themes/preset/theme.js +46 -3
- data/cockpit/track.html +3 -3
- data/cpee.gemspec +3 -3
- data/lib/cpee/attributes_helper.rb +14 -0
- data/lib/cpee/implementation.rb +10 -8
- data/lib/cpee/implementation_callbacks.rb +28 -7
- data/lib/cpee/implementation_notifications.rb +20 -2
- data/lib/cpee/implementation_properties.rb +128 -24
- data/lib/cpee/persistence.rb +0 -27
- data/lib/cpee/statemachine.rb +14 -0
- data/lib/cpee/value_helper.rb +14 -0
- data/lib/properties.xml +4 -4
- data/lib/properties/{handlerwrapper.rng → executionhandler.rng} +2 -2
- data/lib/properties/properties.rng +2 -2
- data/lib/properties/set-properties.rng +2 -2
- data/lib/properties/set-some-properties.rng +2 -2
- data/server/{resources → executionhandlers/ruby}/backend/README.md +0 -0
- data/server/{resources → executionhandlers/ruby}/backend/instance.template +2 -4
- data/server/{resources → executionhandlers/ruby}/backend/opts.yaml +2 -2
- data/server/executionhandlers/ruby/backend/run +37 -0
- data/server/{handlerwrappers/default.rb → executionhandlers/ruby/connection.rb} +7 -3
- data/server/executionhandlers/ruby/controller.rb +195 -0
- data/server/{resources/transformation_dslx.xsl → executionhandlers/ruby/dsl_to_dslx.xsl} +57 -8
- data/server/executionhandlers/ruby/execution.rb +81 -0
- data/server/resources/properties.empty +1 -1
- data/server/resources/properties.init +1 -1
- data/server/resources/topics.xml +2 -2
- data/server/routing/end.rb +1 -0
- data/server/routing/forward-votes.rb +6 -5
- data/server/routing/persist.rb +4 -4
- data/tools/cpee +9 -3
- data/tools/server/cpee +1 -1
- data/tools/server/resources/properties.init +1 -1
- metadata +35 -239
- data/cockpit/templates.legacy/convert_cpee2.rb +0 -15
- data/lib/cpee/controller.rb +0 -199
- data/lib/cpee/transform.rb +0 -95
- data/server/resources/backend/instance.rb +0 -23
- data/server/resources/backend/run +0 -33
- data/server/routing/end.pid +0 -1
- data/server/routing/forward-events.pid +0 -1
- data/server/routing/forward-votes.pid +0 -1
- data/server/routing/persist.pid +0 -1
- data/server/server.pid +0 -1
- data/tools/test/README +0 -4
- data/tools/test/config.json +0 -3
- data/tools/test/contrib/graph_example.svg +0 -1166
- data/tools/test/contrib/legend.svg +0 -817
- data/tools/test/contrib/symbols.svg +0 -224
- data/tools/test/contrib/transformation1.xsl +0 -264
- data/tools/test/contrib/transformation2.xsl +0 -10
- data/tools/test/contrib/tree_example.svg +0 -788
- data/tools/test/css/model.css +0 -24
- data/tools/test/css/track.css +0 -60
- data/tools/test/css/ui.css +0 -214
- data/tools/test/css/wfadaptor.css +0 -422
- data/tools/test/edit.html +0 -258
- data/tools/test/graph.html +0 -69
- data/tools/test/index.html +0 -258
- data/tools/test/js/details.js +0 -109
- data/tools/test/js/instance.js +0 -1344
- data/tools/test/js/model.js +0 -41
- data/tools/test/js/parameters.js +0 -82
- data/tools/test/js/track.js +0 -18
- data/tools/test/js/ui.js +0 -104
- data/tools/test/js/wfadaptor.js +0 -763
- data/tools/test/js_libs.zip +0 -0
- data/tools/test/js_libs/Makefile +0 -2
- data/tools/test/js_libs/ansi_up.js +0 -333
- data/tools/test/js_libs/console.js +0 -80
- data/tools/test/js_libs/custommenu.css +0 -84
- data/tools/test/js_libs/custommenu.js +0 -104
- data/tools/test/js_libs/experiments1/relaxngui.css +0 -185
- data/tools/test/js_libs/experiments1/relaxngui.js +0 -488
- data/tools/test/js_libs/experiments1/rngtest9.html +0 -60
- data/tools/test/js_libs/experiments1/rngtest9.rng +0 -35
- data/tools/test/js_libs/experiments1/rngtest9.xml +0 -8
- data/tools/test/js_libs/jquery-2.2.4.min.js +0 -4
- data/tools/test/js_libs/jquery-3.2.1.min.js +0 -4
- data/tools/test/js_libs/jquery-3.3.1.min.js +0 -2
- data/tools/test/js_libs/jquery.browser.js +0 -40
- data/tools/test/js_libs/jquery.caret.min.js +0 -10
- data/tools/test/js_libs/jquery.cookie.js +0 -117
- data/tools/test/js_libs/jquery.min.js +0 -1
- data/tools/test/js_libs/jquery.svg.min.js +0 -6
- data/tools/test/js_libs/jquery.svgdom.min.js +0 -6
- data/tools/test/js_libs/markdown.min.js +0 -1
- data/tools/test/js_libs/parsequery.js +0 -21
- data/tools/test/js_libs/printf.js +0 -368
- data/tools/test/js_libs/relaxngui.css +0 -213
- data/tools/test/js_libs/relaxngui.js +0 -543
- data/tools/test/js_libs/strftime.min.js +0 -1
- data/tools/test/js_libs/tests/dataelements.html +0 -59
- data/tools/test/js_libs/tests/dataelements.rng +0 -8
- data/tools/test/js_libs/tests/dataelements.xml +0 -3
- data/tools/test/js_libs/tests/relaxngui.css +0 -203
- data/tools/test/js_libs/tests/relaxngui.js +0 -502
- data/tools/test/js_libs/tests/rngtest1.html +0 -66
- data/tools/test/js_libs/tests/rngtest1.rng +0 -147
- data/tools/test/js_libs/tests/rngtest1.xml +0 -13
- data/tools/test/js_libs/tests/rngtest2.html +0 -60
- data/tools/test/js_libs/tests/rngtest2.rng +0 -6
- data/tools/test/js_libs/tests/rngtest2.xml +0 -3
- data/tools/test/js_libs/tests/rngtest3.html +0 -60
- data/tools/test/js_libs/tests/rngtest3.rng +0 -23
- data/tools/test/js_libs/tests/rngtest3.xml +0 -9
- data/tools/test/js_libs/tests/rngtest4.html +0 -60
- data/tools/test/js_libs/tests/rngtest4.rng +0 -19
- data/tools/test/js_libs/tests/rngtest4.xml +0 -12
- data/tools/test/js_libs/tests/rngtest5.html +0 -60
- data/tools/test/js_libs/tests/rngtest5.rng +0 -75
- data/tools/test/js_libs/tests/rngtest5.xml +0 -40
- data/tools/test/js_libs/tests/rngtest6.html +0 -60
- data/tools/test/js_libs/tests/rngtest6.rng +0 -24
- data/tools/test/js_libs/tests/rngtest6.xml +0 -6
- data/tools/test/js_libs/tests/rngtest8.html +0 -60
- data/tools/test/js_libs/tests/rngtest8.rng +0 -13
- data/tools/test/js_libs/tests/rngtest8.xml +0 -2
- data/tools/test/js_libs/tests/rngtest9.html +0 -60
- data/tools/test/js_libs/tests/rngtest9.rng +0 -31
- data/tools/test/js_libs/tests/rngtest9.xml +0 -8
- data/tools/test/js_libs/ui.css +0 -333
- data/tools/test/js_libs/ui.html +0 -168
- data/tools/test/js_libs/ui.js +0 -177
- data/tools/test/js_libs/underscore.min.js +0 -27
- data/tools/test/js_libs/util.js +0 -81
- data/tools/test/js_libs/vkbeautify.0.99.00.beta.js +0 -358
- data/tools/test/js_libs/vkbeautify.js +0 -1
- data/tools/test/js_libs/webcomponents.min.js +0 -196
- data/tools/test/model.html +0 -192
- data/tools/test/rngs/attributes.rng +0 -8
- data/tools/test/rngs/dataelements.rng +0 -8
- data/tools/test/rngs/endpoints.rng +0 -8
- data/tools/test/templates.legacy/Async.xml +0 -46
- data/tools/test/templates.legacy/BCO.xml +0 -70
- data/tools/test/templates.legacy/BCS.xml +0 -70
- data/tools/test/templates.legacy/Centurio.xml +0 -75
- data/tools/test/templates.legacy/Concurrent.xml +0 -40
- data/tools/test/templates.legacy/Coopis Testset.xml +0 -76
- data/tools/test/templates.legacy/Endpoints and Data Manipulation.xml +0 -30
- data/tools/test/templates.legacy/ICSOC Testset.xml +0 -95
- data/tools/test/templates.legacy/Infinity.xml +0 -28
- data/tools/test/templates.legacy/Lego Boxer.xml +0 -31
- data/tools/test/templates.legacy/Lego Conveyor.xml +0 -31
- data/tools/test/templates.legacy/Lego Crane.xml +0 -87
- data/tools/test/templates.legacy/Lego Ejector.xml +0 -55
- data/tools/test/templates.legacy/Lego Full.xml +0 -142
- data/tools/test/templates.legacy/Lego Liddy.xml +0 -40
- data/tools/test/templates.legacy/Lego Plate.xml +0 -31
- data/tools/test/templates.legacy/Lego Transporter.xml +0 -43
- data/tools/test/templates.legacy/Lego_Part_1.xml +0 -85
- data/tools/test/templates.legacy/LgLinear.xml +0 -65
- data/tools/test/templates.legacy/Linear.xml +0 -77
- data/tools/test/templates.legacy/Log.xml +0 -117
- data/tools/test/templates.legacy/Mangler 1.xml +0 -87
- data/tools/test/templates.legacy/Mangler 2.xml +0 -103
- data/tools/test/templates.legacy/Manuel Labels.xml +0 -55
- data/tools/test/templates.legacy/Promise.xml +0 -275
- data/tools/test/templates.legacy/SOPROMO Test Sonification.xml +0 -83
- data/tools/test/templates.legacy/Subprocess.xml +0 -56
- data/tools/test/templates.legacy/Syncing P34 1.xml +0 -77
- data/tools/test/templates.legacy/Syncing P34 2.xml +0 -77
- data/tools/test/templates.legacy/Syncing P34 3.xml +0 -77
- data/tools/test/templates.legacy/Syncing P34.xml +0 -77
- data/tools/test/templates.legacy/TEST - Bad Loop.xml +0 -173
- data/tools/test/templates.legacy/TEST - Wrong Positions.xml +0 -174
- data/tools/test/templates.legacy/Take_5.xml +0 -48
- data/tools/test/templates.legacy/Update.xml +0 -32
- data/tools/test/templates.legacy/Worklist Parallel.xml +0 -104
- data/tools/test/templates.legacy/Worklist Test CPEE.xml +0 -40
- data/tools/test/templates.legacy/Worklist Test.xml +0 -42
- data/tools/test/templates.legacy/Worklist Test2.xml +0 -43
- data/tools/test/templates.legacy/convert_cpee2.rb +0 -15
- data/tools/test/templates.legacy/convert_preset.rb +0 -32
- data/tools/test/templates.legacy/testsets.xml +0 -37
- data/tools/test/templates.legacy/transformations.xml +0 -4
- data/tools/test/templates/Coopis 2010.xml +0 -76
- data/tools/test/templates/IUPC arXiv:1104.3609 P34 1.xml +0 -77
- data/tools/test/templates/IUPC arXiv:1104.3609 P34 2.xml +0 -77
- data/tools/test/templates/IUPC arXiv:1104.3609 P34 3.xml +0 -77
- data/tools/test/templates/Track Test Local.xml +0 -82
- data/tools/test/templates/Track Test.xml +0 -82
- data/tools/test/templates/UR-VUE 2020 Manual Adjust.xml +0 -182
- data/tools/test/templates/UR-VUE 2020 Solution Baseline.xml +0 -203
- data/tools/test/templates/UR-VUE 2020 Solution NN.xml +0 -197
- data/tools/test/templates/UR-VUE 2020 Solution View.xml +0 -151
- data/tools/test/templates/UR-VUE 2020.xml +0 -26
- data/tools/test/templates/Worklist.xml +0 -42
- data/tools/test/templates/instantiate.local/Take_Sub.xml +0 -59
- data/tools/test/templates/instantiate/Take_Perf.xml +0 -46
- data/tools/test/templates/instantiate/Take_Sub.xml +0 -58
- data/tools/test/templates/instantiate/Take_X.xml +0 -48
- data/tools/test/themes/compact/theme.js +0 -1285
- data/tools/test/themes/diana/theme.js +0 -1650
- data/tools/test/themes/extended/theme.js +0 -1325
- data/tools/test/themes/model/rngs/alternative.rng +0 -1
- data/tools/test/themes/model/rngs/call.rng +0 -67
- data/tools/test/themes/model/rngs/callmanipulate.rng +0 -72
- data/tools/test/themes/model/rngs/choose.rng +0 -1
- data/tools/test/themes/model/rngs/critical.rng +0 -1
- data/tools/test/themes/model/rngs/escape.rng +0 -1
- data/tools/test/themes/model/rngs/group.rng +0 -1
- data/tools/test/themes/model/rngs/loop.rng +0 -1
- data/tools/test/themes/model/rngs/manipulate.rng +0 -1
- data/tools/test/themes/model/rngs/otherwise.rng +0 -1
- data/tools/test/themes/model/rngs/parallel.rng +0 -1
- data/tools/test/themes/model/rngs/parallel_branch.rng +0 -1
- data/tools/test/themes/model/rngs/scripts.rng +0 -7
- data/tools/test/themes/model/rngs/stop.rng +0 -1
- data/tools/test/themes/model/rngs/terminate.rng +0 -1
- data/tools/test/themes/model/theme.js +0 -1268
- data/tools/test/themes/packed/theme.js +0 -1286
- data/tools/test/themes/preset/rngs/alternative.rng +0 -25
- data/tools/test/themes/preset/rngs/call.rng +0 -122
- data/tools/test/themes/preset/rngs/callmanipulate.rng +0 -145
- data/tools/test/themes/preset/rngs/choose.rng +0 -14
- data/tools/test/themes/preset/rngs/closed_loop.rng +0 -62
- data/tools/test/themes/preset/rngs/closed_loop_cancel.rng +0 -5
- data/tools/test/themes/preset/rngs/closed_loop_control.rng +0 -31
- data/tools/test/themes/preset/rngs/closed_loop_measuring.rng +0 -12
- data/tools/test/themes/preset/rngs/critical.rng +0 -5
- data/tools/test/themes/preset/rngs/escape.rng +0 -1
- data/tools/test/themes/preset/rngs/group.rng +0 -3
- data/tools/test/themes/preset/rngs/loop.rng +0 -22
- data/tools/test/themes/preset/rngs/manipulate.rng +0 -9
- data/tools/test/themes/preset/rngs/otherwise.rng +0 -22
- data/tools/test/themes/preset/rngs/parallel.rng +0 -21
- data/tools/test/themes/preset/rngs/parallel_branch.rng +0 -8
- data/tools/test/themes/preset/rngs/scripts.rng +0 -23
- data/tools/test/themes/preset/rngs/stop.rng +0 -5
- data/tools/test/themes/preset/rngs/terminate.rng +0 -1
- data/tools/test/themes/preset/symbols/alternative.svg +0 -5
- data/tools/test/themes/preset/symbols/arrow.svg +0 -3
- data/tools/test/themes/preset/symbols/call.svg +0 -6
- data/tools/test/themes/preset/symbols/callmanipulate.svg +0 -8
- data/tools/test/themes/preset/symbols/choose.svg +0 -5
- data/tools/test/themes/preset/symbols/choose_exclusive.svg +0 -5
- data/tools/test/themes/preset/symbols/choose_inclusive.svg +0 -4
- data/tools/test/themes/preset/symbols/closed_loop.svg +0 -5
- data/tools/test/themes/preset/symbols/closed_loop_cancel.svg +0 -5
- data/tools/test/themes/preset/symbols/closed_loop_control.svg +0 -5
- data/tools/test/themes/preset/symbols/closed_loop_measuring.svg +0 -6
- data/tools/test/themes/preset/symbols/complex.svg +0 -8
- data/tools/test/themes/preset/symbols/critical.svg +0 -4
- data/tools/test/themes/preset/symbols/end.svg +0 -3
- data/tools/test/themes/preset/symbols/escape.svg +0 -5
- data/tools/test/themes/preset/symbols/event_end.svg +0 -3
- data/tools/test/themes/preset/symbols/loop.svg +0 -5
- data/tools/test/themes/preset/symbols/manipulate.svg +0 -4
- data/tools/test/themes/preset/symbols/otherwise.svg +0 -5
- data/tools/test/themes/preset/symbols/parallel.svg +0 -5
- data/tools/test/themes/preset/symbols/parallel_branch.svg +0 -5
- data/tools/test/themes/preset/symbols/parallel_branch_compact.svg +0 -4
- data/tools/test/themes/preset/symbols/parallel_branch_event.svg +0 -14
- data/tools/test/themes/preset/symbols/parallel_branch_normal.svg +0 -5
- data/tools/test/themes/preset/symbols/scripts.svg +0 -4
- data/tools/test/themes/preset/symbols/start.svg +0 -3
- data/tools/test/themes/preset/symbols/stop.svg +0 -5
- data/tools/test/themes/preset/symbols/terminate.svg +0 -4
- data/tools/test/themes/preset/theme.js +0 -1287
- data/tools/test/track.html +0 -142
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# This file is part of CPEE.
|
|
2
|
+
#
|
|
3
|
+
# CPEE is free software: you can redistribute it and/or modify it under the terms
|
|
4
|
+
# of the GNU General Public License as published by the Free Software Foundation,
|
|
5
|
+
# either version 3 of the License, or (at your option) any later version.
|
|
6
|
+
#
|
|
7
|
+
# CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
8
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
9
|
+
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
10
|
+
#
|
|
11
|
+
# You should have received a copy of the GNU General Public License along with
|
|
12
|
+
# CPEE (file COPYING in the main directory). If not, see
|
|
13
|
+
# <http://www.gnu.org/licenses/>.
|
|
14
|
+
|
|
1
15
|
require 'json'
|
|
2
16
|
|
|
3
17
|
module CPEE
|
|
@@ -169,8 +183,12 @@ module CPEE
|
|
|
169
183
|
conn.psubscribe('forward:*','event:state/change') do |on|
|
|
170
184
|
on.pmessage do |pat, what, message|
|
|
171
185
|
if pat == 'forward:*'
|
|
172
|
-
|
|
173
|
-
opts.dig(:sse_connections,id.to_i,key)
|
|
186
|
+
id, key = what.match(/forward:([^\/]+)\/(.+)/).captures
|
|
187
|
+
if sse = opts.dig(:sse_connections,id.to_i,key)
|
|
188
|
+
sse.send message
|
|
189
|
+
else
|
|
190
|
+
DeleteSubscription::set(id,opts,key)
|
|
191
|
+
end
|
|
174
192
|
elsif pat == 'event:state/change'
|
|
175
193
|
mess = JSON.parse(message[message.index(' ')+1..-1])
|
|
176
194
|
state = mess.dig('content','state')
|
|
@@ -1,6 +1,19 @@
|
|
|
1
|
+
# This file is part of CPEE.
|
|
2
|
+
#
|
|
3
|
+
# CPEE is free software: you can redistribute it and/or modify it under the terms
|
|
4
|
+
# of the GNU General Public License as published by the Free Software Foundation,
|
|
5
|
+
# either version 3 of the License, or (at your option) any later version.
|
|
6
|
+
#
|
|
7
|
+
# CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
8
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
9
|
+
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
10
|
+
#
|
|
11
|
+
# You should have received a copy of the GNU General Public License along with
|
|
12
|
+
# CPEE (file COPYING in the main directory). If not, see
|
|
13
|
+
# <http://www.gnu.org/licenses/>.
|
|
14
|
+
|
|
1
15
|
require_relative 'attributes_helper'
|
|
2
16
|
require_relative 'value_helper'
|
|
3
|
-
require_relative 'transform'
|
|
4
17
|
require 'json'
|
|
5
18
|
require 'erb'
|
|
6
19
|
require 'yaml'
|
|
@@ -31,9 +44,9 @@ module CPEE
|
|
|
31
44
|
run CPEE::Properties::GetStatusMessage, id, opts if get
|
|
32
45
|
end
|
|
33
46
|
end
|
|
34
|
-
on resource '
|
|
35
|
-
run CPEE::Properties::
|
|
36
|
-
run CPEE::Properties::
|
|
47
|
+
on resource 'executionhandler' do
|
|
48
|
+
run CPEE::Properties::GetExecutionHandler, id, opts if get
|
|
49
|
+
run CPEE::Properties::PutExecutionHandler, id, opts if put 'executionhandler'
|
|
37
50
|
end
|
|
38
51
|
on resource 'positions' do
|
|
39
52
|
run CPEE::Properties::GetPositions, id, opts if get
|
|
@@ -128,8 +141,8 @@ module CPEE
|
|
|
128
141
|
if (node = doc.find('/p:properties/p:status')).any?
|
|
129
142
|
CPEE::Properties::PutStatus::set id, opts, node.first.dump
|
|
130
143
|
end
|
|
131
|
-
if (node = doc.find('/p:properties/p:
|
|
132
|
-
CPEE::Properties::
|
|
144
|
+
if (node = doc.find('/p:properties/p:executionhandler')).any?
|
|
145
|
+
CPEE::Properties::PutExecutionHandler::set id, opts, node.first.text
|
|
133
146
|
end
|
|
134
147
|
|
|
135
148
|
%w{dataelements endpoints attributes}.each do |item|
|
|
@@ -169,8 +182,8 @@ module CPEE
|
|
|
169
182
|
if (node = doc.find('/p:properties/p:status')).any?
|
|
170
183
|
CPEE::Properties::PutStatus::set id, opts, node.first.dump
|
|
171
184
|
end
|
|
172
|
-
if (node = doc.find('/p:properties/p:
|
|
173
|
-
CPEE::Properties::
|
|
185
|
+
if (node = doc.find('/p:properties/p:executionhandler')).any?
|
|
186
|
+
CPEE::Properties::PutExecutionHandler::set id, opts, node.first.text
|
|
174
187
|
end
|
|
175
188
|
|
|
176
189
|
%w{dataelements endpoints attributes}.each do |item|
|
|
@@ -211,19 +224,14 @@ module CPEE
|
|
|
211
224
|
end
|
|
212
225
|
|
|
213
226
|
def self::run(id,opts,state)
|
|
214
|
-
exe = File.join(opts[:instances],id.to_s,File.basename(opts[:backend_run]))
|
|
215
227
|
case state
|
|
216
228
|
when 'running'
|
|
217
|
-
CPEE::Persistence::
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
File.write(exe + '.pid',pid)
|
|
229
|
+
seh = Object.const_get('CPEE::ExecutionHandler::' + CPEE::Persistence::extract_item(id,opts,'executionhandler').capitalize)
|
|
230
|
+
seh::prepare(id,opts)
|
|
231
|
+
seh::run(id,opts)
|
|
221
232
|
when 'stopping'
|
|
222
|
-
|
|
223
|
-
if
|
|
224
|
-
Process.kill('HUP', pid.to_i) rescue nil
|
|
225
|
-
else
|
|
226
|
-
File.unlink(exe + '.pid') rescue nil
|
|
233
|
+
seh = Object.const_get('CPEE::ExecutionHandler::' + CPEE::Persistence::extract_item(id,opts,'executionhandler').capitalize)
|
|
234
|
+
if seh::stop(id,opts) # process is not running anyway, so change redis
|
|
227
235
|
PutState::set id, opts, 'stopped'
|
|
228
236
|
end
|
|
229
237
|
else
|
|
@@ -302,16 +310,16 @@ module CPEE
|
|
|
302
310
|
Riddl::Parameter::Simple.new('value',CPEE::Persistence::extract_item(id,opts,'status/message'))
|
|
303
311
|
end
|
|
304
312
|
end #}}}
|
|
305
|
-
class
|
|
313
|
+
class GetExecutionHandler < Riddl::Implementation #{{{
|
|
306
314
|
def response
|
|
307
315
|
id = @a[0]
|
|
308
316
|
opts = @a[1]
|
|
309
|
-
Riddl::Parameter::Simple.new('value',CPEE::Persistence::extract_item(id,opts,'
|
|
317
|
+
Riddl::Parameter::Simple.new('value',CPEE::Persistence::extract_item(id,opts,'executionhandler'))
|
|
310
318
|
end
|
|
311
319
|
end #}}}
|
|
312
|
-
class
|
|
320
|
+
class PutExecutionHandler < Riddl::Implementation #{{{
|
|
313
321
|
def self::set(id,opts,hw)
|
|
314
|
-
CPEE::Persistence::set_item(id,opts,'
|
|
322
|
+
CPEE::Persistence::set_item(id,opts,'executionhandler',:executionhandler => hw)
|
|
315
323
|
end
|
|
316
324
|
def response
|
|
317
325
|
id = @a[0]
|
|
@@ -319,7 +327,7 @@ module CPEE
|
|
|
319
327
|
if opts[:statemachine].readonly? id
|
|
320
328
|
@status = 423
|
|
321
329
|
else
|
|
322
|
-
|
|
330
|
+
PutExecutionHandler::set(id,opts,@p[0].value)
|
|
323
331
|
end
|
|
324
332
|
nil
|
|
325
333
|
end
|
|
@@ -633,8 +641,103 @@ module CPEE
|
|
|
633
641
|
end #}}}
|
|
634
642
|
|
|
635
643
|
class PutDescription < Riddl::Implementation #{{{
|
|
644
|
+
def self::transform(descxml,tdesc,tdesctype,tdata,tdatatype,tendp,tendptype,hw,opts) #{{{
|
|
645
|
+
desc = XML::Smart::string(descxml)
|
|
646
|
+
desc.register_namespace 'p', 'http://cpee.org/ns/description/1.0'
|
|
647
|
+
|
|
648
|
+
dslx = nil
|
|
649
|
+
dsl = nil
|
|
650
|
+
de = {}
|
|
651
|
+
ep = {}
|
|
652
|
+
|
|
653
|
+
if desc.root.children.empty?
|
|
654
|
+
tdesctype = tdatatype = tendptype = 'clean'
|
|
655
|
+
end
|
|
656
|
+
|
|
657
|
+
### description transformation, including dslx to dsl
|
|
658
|
+
addit = if tdesctype == 'copy' || tdesc.empty?
|
|
659
|
+
desc
|
|
660
|
+
elsif tdesctype == 'rest' && !tdesc.empty?
|
|
661
|
+
srv = Riddl::Client.interface(tdesc,opts[:transformation_service])
|
|
662
|
+
status, res = srv.post [
|
|
663
|
+
Riddl::Parameter::Complex.new("description","text/xml",descxml),
|
|
664
|
+
Riddl::Parameter::Simple.new("type","description")
|
|
665
|
+
]
|
|
666
|
+
if status >= 200 && status < 300
|
|
667
|
+
XML::Smart::string(res[0].value.read).root
|
|
668
|
+
else
|
|
669
|
+
raise 'Could not extract dslx'
|
|
670
|
+
end
|
|
671
|
+
elsif tdesctype == 'xslt' && !tdesc.empty?
|
|
672
|
+
trans = XML::Smart::open_unprotected(tdesc)
|
|
673
|
+
desc.transform_with(trans).root
|
|
674
|
+
elsif tdesctype == 'clean'
|
|
675
|
+
XML::Smart::open_unprotected(opts[:empty_dslx]).root
|
|
676
|
+
else
|
|
677
|
+
nil
|
|
678
|
+
end
|
|
679
|
+
unless addit.nil?
|
|
680
|
+
dslx = addit.to_s
|
|
681
|
+
dsl = Object.const_get('CPEE::ExecutionHandler::' + hw.capitalize)::dslx_to_dsl(addit)
|
|
682
|
+
end
|
|
683
|
+
|
|
684
|
+
### dataelements extraction
|
|
685
|
+
addit = if tdatatype == 'rest' && !tdata.empty?
|
|
686
|
+
srv = Riddl::Client.interface(tdata,@opts[:transformation_service])
|
|
687
|
+
status, res = srv.post [
|
|
688
|
+
Riddl::Parameter::Complex.new("description","text/xml",descxml),
|
|
689
|
+
Riddl::Parameter::Simple.new("type","dataelements")
|
|
690
|
+
]
|
|
691
|
+
if status >= 200 && status < 300
|
|
692
|
+
res
|
|
693
|
+
else
|
|
694
|
+
raise 'Could not extract dataelements'
|
|
695
|
+
end
|
|
696
|
+
elsif tdatatype == 'xslt' && !tdata.empty?
|
|
697
|
+
trans = XML::Smart::open_unprotected(tdata)
|
|
698
|
+
desc.transform_with(trans)
|
|
699
|
+
elsif tdatatype == 'clean'
|
|
700
|
+
[]
|
|
701
|
+
else
|
|
702
|
+
nil
|
|
703
|
+
end
|
|
704
|
+
unless addit.nil?
|
|
705
|
+
addit.each_slice(2).each do |k,v|
|
|
706
|
+
de[k.value.to_sym] = v.value
|
|
707
|
+
end
|
|
708
|
+
end
|
|
709
|
+
|
|
710
|
+
### endpoints extraction
|
|
711
|
+
addit = if tendptype == 'rest' && !tdata.empty?
|
|
712
|
+
srv = Riddl::Client.interface(tendp,@opts[:transformation_service])
|
|
713
|
+
status, res = srv.post [
|
|
714
|
+
Riddl::Parameter::Complex.new("description","text/xml",descxml),
|
|
715
|
+
Riddl::Parameter::Simple.new("type","endpoints")
|
|
716
|
+
]
|
|
717
|
+
if status >= 200 && status < 300
|
|
718
|
+
res
|
|
719
|
+
else
|
|
720
|
+
raise 'Could not extract endpoints'
|
|
721
|
+
end
|
|
722
|
+
elsif tendptype == 'xslt' && !tdata.empty?
|
|
723
|
+
trans = XML::Smart::open_unprotected(tendp.text)
|
|
724
|
+
desc.transform_with(trans)
|
|
725
|
+
elsif tendptype == 'clean'
|
|
726
|
+
[]
|
|
727
|
+
else
|
|
728
|
+
nil
|
|
729
|
+
end
|
|
730
|
+
unless addit.nil?
|
|
731
|
+
addit.each_slice(2).each do |k,v|
|
|
732
|
+
ep[k.value.to_sym] = v.value
|
|
733
|
+
end
|
|
734
|
+
end
|
|
735
|
+
|
|
736
|
+
[dslx, dsl, de, ep]
|
|
737
|
+
end #}}}
|
|
738
|
+
|
|
636
739
|
def self::set(id,opts,xml)
|
|
637
|
-
dslx, dsl, de, ep = transform(
|
|
740
|
+
dslx, dsl, de, ep = PutDescription::transform(
|
|
638
741
|
xml,
|
|
639
742
|
CPEE::Persistence::extract_item(id,opts,'transformation/description'),
|
|
640
743
|
CPEE::Persistence::extract_item(id,opts,'transformation/description/@type'),
|
|
@@ -642,6 +745,7 @@ module CPEE
|
|
|
642
745
|
CPEE::Persistence::extract_item(id,opts,'transformation/dataelements/@type'),
|
|
643
746
|
CPEE::Persistence::extract_item(id,opts,'transformation/endpoints'),
|
|
644
747
|
CPEE::Persistence::extract_item(id,opts,'transformation/endpoints/@type'),
|
|
748
|
+
CPEE::Persistence::extract_item(id,opts,'executionhandler'),
|
|
645
749
|
opts
|
|
646
750
|
)
|
|
647
751
|
CPEE::Persistence::set_item(id,opts,'description',
|
data/lib/cpee/persistence.rb
CHANGED
|
@@ -15,33 +15,6 @@
|
|
|
15
15
|
module CPEE
|
|
16
16
|
|
|
17
17
|
module Persistence
|
|
18
|
-
def self::write_instance(id,opts) #{{{
|
|
19
|
-
Dir.mkdir(File.join(opts[:instances],id.to_s)) rescue nil
|
|
20
|
-
FileUtils.copy(opts[:backend_run],File.join(opts[:instances],id.to_s))
|
|
21
|
-
dsl = CPEE::Persistence::extract_item(id,opts,'dsl')
|
|
22
|
-
hw = CPEE::Persistence::extract_item(id,opts,'handlerwrapper')
|
|
23
|
-
endpoints = CPEE::Persistence::extract_list(id,opts,'endpoints')
|
|
24
|
-
dataelements = CPEE::Persistence::extract_list(id,opts,'dataelements')
|
|
25
|
-
positions = CPEE::Persistence::extract_set(id,opts,'positions')
|
|
26
|
-
positions.map! do |k, v|
|
|
27
|
-
[ k, v, CPEE::Persistence::extract_item(id,opts,File.join('positions',k,'@passthrough')) ]
|
|
28
|
-
end
|
|
29
|
-
File.open(File.join(opts[:instances],id.to_s,opts[:backend_opts]),'w') do |f|
|
|
30
|
-
YAML::dump({
|
|
31
|
-
:host => opts[:host],
|
|
32
|
-
:url => opts[:url],
|
|
33
|
-
:redis_url => opts[:redis_url],
|
|
34
|
-
:redis_path => File.join(opts[:basepath],opts[:redis_path]),
|
|
35
|
-
:redis_db => opts[:redis_db],
|
|
36
|
-
:global_handlerwrappers => opts[:global_handlerwrappers],
|
|
37
|
-
:handlerwrappers => opts[:handlerwrappers]
|
|
38
|
-
},f)
|
|
39
|
-
end
|
|
40
|
-
template = ERB.new(File.read(opts[:backend_template]), trim_mode: '-')
|
|
41
|
-
res = template.result_with_hash(dsl: dsl, handlerwrapper: hw, dataelements: dataelements, endpoints: endpoints, positions: positions)
|
|
42
|
-
File.write(File.join(opts[:instances],id.to_s,opts[:backend_instance]),res)
|
|
43
|
-
end #}}}
|
|
44
|
-
|
|
45
18
|
def self::set_list(id,opts,item,values,deleted=[]) #{{{
|
|
46
19
|
ah = AttributesHelper.new
|
|
47
20
|
attributes = Persistence::extract_list(id,opts,'attributes').to_h
|
data/lib/cpee/statemachine.rb
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# This file is part of CPEE.
|
|
2
|
+
#
|
|
3
|
+
# CPEE is free software: you can redistribute it and/or modify it under the terms
|
|
4
|
+
# of the GNU General Public License as published by the Free Software Foundation,
|
|
5
|
+
# either version 3 of the License, or (at your option) any later version.
|
|
6
|
+
#
|
|
7
|
+
# CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
8
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
9
|
+
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
10
|
+
#
|
|
11
|
+
# You should have received a copy of the GNU General Public License along with
|
|
12
|
+
# CPEE (file COPYING in the main directory). If not, see
|
|
13
|
+
# <http://www.gnu.org/licenses/>.
|
|
14
|
+
|
|
1
15
|
module CPEE
|
|
2
16
|
|
|
3
17
|
class StateMachine
|
data/lib/cpee/value_helper.rb
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# This file is part of CPEE.
|
|
2
|
+
#
|
|
3
|
+
# CPEE is free software: you can redistribute it and/or modify it under the terms
|
|
4
|
+
# of the GNU General Public License as published by the Free Software Foundation,
|
|
5
|
+
# either version 3 of the License, or (at your option) any later version.
|
|
6
|
+
#
|
|
7
|
+
# CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
8
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
9
|
+
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
10
|
+
#
|
|
11
|
+
# You should have received a copy of the GNU General Public License along with
|
|
12
|
+
# CPEE (file COPYING in the main directory). If not, see
|
|
13
|
+
# <http://www.gnu.org/licenses/>.
|
|
14
|
+
|
|
1
15
|
require 'json'
|
|
2
16
|
require 'time'
|
|
3
17
|
|
data/lib/properties.xml
CHANGED
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
<parameter name="value" type="string"/>
|
|
64
64
|
</message> <!--}}}-->
|
|
65
65
|
|
|
66
|
-
<message name="
|
|
66
|
+
<message name="executionhandler"> <!--{{{-->
|
|
67
67
|
<parameter name="value" type="string">
|
|
68
68
|
<param name="pattern">[A-Z][a-zA-Z]*</param>
|
|
69
69
|
</parameter>
|
|
@@ -165,9 +165,9 @@
|
|
|
165
165
|
<get out="string"/>
|
|
166
166
|
</resource>
|
|
167
167
|
</resource> <!--}}}-->
|
|
168
|
-
<resource relative="
|
|
169
|
-
<put in="
|
|
170
|
-
<get out="
|
|
168
|
+
<resource relative="executionhandler"> <!--{{{-->
|
|
169
|
+
<put in="executionhandler"/>
|
|
170
|
+
<get out="executionhandler"/>
|
|
171
171
|
</resource> <!--}}}-->
|
|
172
172
|
<resource relative="positions"> <!--{{{-->
|
|
173
173
|
<get out="positions"/>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
|
2
|
-
<define name="
|
|
3
|
-
<element name="
|
|
2
|
+
<define name="executionhandler">
|
|
3
|
+
<element name="executionhandler" ns="http://cpee.org/ns/properties/2.0">
|
|
4
4
|
<data type="string">
|
|
5
5
|
<param name="pattern">[A-Z][a-zA-Z]*</param>
|
|
6
6
|
</data>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
|
2
2
|
<include href="state.rng"/>
|
|
3
3
|
<include href="status.rng"/>
|
|
4
|
-
<include href="
|
|
4
|
+
<include href="executionhandler.rng"/>
|
|
5
5
|
<include href="positions.rng"/>
|
|
6
6
|
<include href="dataelements.rng"/>
|
|
7
7
|
<include href="endpoints.rng"/>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<element name="properties" ns="http://cpee.org/ns/properties/2.0">
|
|
16
16
|
<ref name="state"/>
|
|
17
17
|
<ref name="status"/>
|
|
18
|
-
<ref name="
|
|
18
|
+
<ref name="executionhandler"/>
|
|
19
19
|
<ref name="positions"/>
|
|
20
20
|
<ref name="dataelements"/>
|
|
21
21
|
<ref name="endpoints"/>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
|
2
2
|
<include href="state.rng"/>
|
|
3
3
|
<include href="status.rng"/>
|
|
4
|
-
<include href="
|
|
4
|
+
<include href="executionhandler.rng"/>
|
|
5
5
|
<include href="positions.rng"/>
|
|
6
6
|
<include href="dataelements.rng"/>
|
|
7
7
|
<include href="endpoints.rng"/>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<element name="properties" ns="http://cpee.org/ns/properties/2.0">
|
|
14
14
|
<ref name="set-state"/>
|
|
15
15
|
<ref name="status"/>
|
|
16
|
-
<ref name="
|
|
16
|
+
<ref name="executionhandler"/>
|
|
17
17
|
<ref name="positions"/>
|
|
18
18
|
<ref name="dataelements"/>
|
|
19
19
|
<ref name="endpoints"/>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
|
2
2
|
<include href="state.rng"/>
|
|
3
3
|
<include href="status.rng"/>
|
|
4
|
-
<include href="
|
|
4
|
+
<include href="executionhandler.rng"/>
|
|
5
5
|
<include href="positions.rng"/>
|
|
6
6
|
<include href="dataelements.rng"/>
|
|
7
7
|
<include href="endpoints.rng"/>
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
<ref name="status"/>
|
|
20
20
|
</optional>
|
|
21
21
|
<optional>
|
|
22
|
-
<ref name="
|
|
22
|
+
<ref name="executionhandler"/>
|
|
23
23
|
</optional>
|
|
24
24
|
<optional>
|
|
25
25
|
<ref name="positions"/>
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
class Instance < WEEL
|
|
2
|
-
|
|
2
|
+
connectionwrapper ConnectionWrapper
|
|
3
3
|
|
|
4
4
|
<% for key, value in endpoints -%>
|
|
5
5
|
endpoint :<%= key %> => <%= CPEE::ValueHelper::parse(value).inspect %>
|
|
@@ -13,7 +13,5 @@ class Instance < WEEL
|
|
|
13
13
|
search <% positions.each_with_index { |de,i| %><%= (i > 0 ? ', ' : '') %>Position.new(:<%= de[0] %>, :<%=de[1] %>, <%= de[2].nil? || de[2].strip.empty? ? 'nil' : '"' + de[2] + '"' %>)<% } %>
|
|
14
14
|
<% end -%>
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
<%= dsl.strip.gsub(/\n/,"\n ") %>
|
|
18
|
-
end
|
|
16
|
+
<%= dsl.strip.gsub(/\n/,"\n ") %>
|
|
19
17
|
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/ruby
|
|
2
|
+
require 'yaml'
|
|
3
|
+
opts = YAML::load_file(File.join(__dir__,'opts.yaml'))
|
|
4
|
+
opts[:pidf] = __FILE__ + '.pid'
|
|
5
|
+
opts[:pid] = Process.pid
|
|
6
|
+
|
|
7
|
+
global_controller = File.join(opts[:global_executionhandlers],opts[:executionhandler],'controller.rb')
|
|
8
|
+
controller = File.join(opts[:executionhandlers], opts[:executionhandler],'controller.rb')
|
|
9
|
+
if File.exists? global_controller
|
|
10
|
+
require global_controller
|
|
11
|
+
elsif File.exists? controller
|
|
12
|
+
require controller
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
global_connectionhandler = File.join(opts[:global_executionhandlers],opts[:executionhandler],'connection.rb')
|
|
16
|
+
connectionhandler = File.join(opts[:executionhandlers], opts[:executionhandler],'connection.rb')
|
|
17
|
+
if File.exists? global_connectionhandler
|
|
18
|
+
require global_connectionhandler
|
|
19
|
+
elsif File.exists? connectionhandler
|
|
20
|
+
require connectionhandler
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
require_relative 'instance'
|
|
24
|
+
controller = Controller.new(File.basename(__dir__).to_i, __dir__, opts)
|
|
25
|
+
controller.instance = Instance.new controller
|
|
26
|
+
|
|
27
|
+
File.write(opts[:pidf],opts[:pid])
|
|
28
|
+
|
|
29
|
+
%w{TERM HUP INT}.each do |sig|
|
|
30
|
+
Signal.trap(sig) do
|
|
31
|
+
puts "Caught #{sig}!"
|
|
32
|
+
controller.stop
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
controller.start
|
|
37
|
+
File.unlink(opts[:pidf])
|