cpee 1.5.24 → 2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{FEATURES → FEATURES.md} +7 -6
- data/INSTALL.md +1 -0
- data/{README → README.md} +3 -3
- data/Rakefile +1 -0
- data/cockpit/index.html +8 -8
- data/cockpit/js/details.js +13 -14
- data/cockpit/js/instance.js +192 -290
- data/cockpit/js/parameters.js +13 -3
- data/cockpit/js/ui.js +2 -2
- data/cockpit/rngs/attributes.rng +3 -3
- data/cockpit/rngs/dataelements.rng +3 -3
- data/cockpit/rngs/endpoints.rng +3 -3
- data/cockpit/{testsets → templates.legacy}/Async.xml +7 -7
- data/cockpit/{testsets → templates.legacy}/BCO.xml +7 -10
- data/cockpit/{testsets → templates.legacy}/BCS.xml +7 -10
- data/cockpit/{testsets → templates.legacy}/Centurio.xml +6 -6
- data/cockpit/{testsets → templates.legacy}/Concurrent.xml +6 -6
- data/cockpit/{testsets → templates.legacy}/Coopis Testset.xml +6 -6
- data/cockpit/{testsets → templates.legacy}/Endpoints and Data Manipulation.xml +6 -6
- data/cockpit/{testsets → templates.legacy}/ICSOC Testset.xml +6 -6
- data/cockpit/{testsets → templates.legacy}/Infinity.xml +3 -3
- data/cockpit/{testsets → templates.legacy}/Lego Boxer.xml +7 -7
- data/cockpit/{testsets → templates.legacy}/Lego Conveyor.xml +7 -7
- data/cockpit/{testsets → templates.legacy}/Lego Crane.xml +7 -7
- data/cockpit/{testsets → templates.legacy}/Lego Ejector.xml +7 -7
- data/cockpit/{testsets → templates.legacy}/Lego Full.xml +7 -7
- data/cockpit/{testsets → templates.legacy}/Lego Liddy.xml +7 -7
- data/cockpit/{testsets → templates.legacy}/Lego Plate.xml +7 -7
- data/cockpit/{testsets → templates.legacy}/Lego Transporter.xml +7 -7
- data/cockpit/{testsets → templates.legacy}/Lego_Part_1.xml +7 -7
- data/cockpit/{testsets → templates.legacy}/LgLinear.xml +6 -10
- data/cockpit/{testsets → templates.legacy}/Linear.xml +7 -7
- data/cockpit/{testsets → templates.legacy}/Log.xml +7 -7
- data/cockpit/{testsets → templates.legacy}/Mangler 1.xml +6 -6
- data/cockpit/{testsets → templates.legacy}/Mangler 2.xml +6 -6
- data/cockpit/{testsets → templates.legacy}/Manuel Labels.xml +7 -7
- data/cockpit/{testsets → templates.legacy}/Promise.xml +7 -7
- data/cockpit/{testsets → templates.legacy}/SOPROMO Test Sonification.xml +6 -6
- data/cockpit/{testsets → templates.legacy}/Subprocess.xml +7 -7
- data/cockpit/{testsets → templates.legacy}/Syncing P34 1.xml +8 -11
- data/cockpit/{testsets → templates.legacy}/Syncing P34 2.xml +8 -11
- data/cockpit/{testsets → templates.legacy}/Syncing P34 3.xml +8 -11
- data/cockpit/{testsets → templates.legacy}/Syncing P34.xml +8 -11
- data/cockpit/{testsets → templates.legacy}/TEST - Bad Loop.xml +6 -6
- data/cockpit/{testsets → templates.legacy}/TEST - Wrong Positions.xml +6 -6
- data/cockpit/{testsets → templates.legacy}/Take_5.xml +7 -7
- data/cockpit/{testsets → templates.legacy}/Update.xml +7 -7
- data/cockpit/{testsets → templates.legacy}/Worklist Parallel.xml +7 -7
- data/cockpit/{testsets → templates.legacy}/Worklist Test CPEE.xml +7 -7
- data/cockpit/{testsets → templates.legacy}/Worklist Test.xml +7 -7
- data/cockpit/{testsets → templates.legacy}/Worklist Test2.xml +7 -7
- data/cockpit/templates.legacy/convert_cpee2.rb +15 -0
- data/cockpit/{testsets → templates.legacy}/convert_preset.rb +0 -0
- data/cockpit/{testsets → templates.legacy}/testsets.xml +1 -1
- data/cockpit/{testsets → templates.legacy}/transformations.xml +0 -0
- data/cockpit/templates/BPM 2020 Manual Adjust.xml +182 -0
- data/cockpit/templates/BPM 2020 Solution Baseline.xml +196 -0
- data/cockpit/templates/BPM 2020 Solution NN.xml +197 -0
- data/cockpit/templates/BPM 2020 Solution View.xml +144 -0
- data/cockpit/templates/BPM 2020.xml +26 -0
- data/cockpit/templates/Coopis 2010.xml +85 -0
- data/cockpit/templates/IUPC arXiv:1104.3609 P34 1.xml +77 -0
- data/cockpit/templates/IUPC arXiv:1104.3609 P34 2.xml +77 -0
- data/cockpit/templates/IUPC arXiv:1104.3609 P34 3.xml +77 -0
- data/cockpit/templates/Worklist.xml +42 -0
- data/cockpit/templates/convert_cpee2.rb +15 -0
- data/cockpit/themes/compact/rngs/alternative.rng +25 -0
- data/cockpit/themes/compact/rngs/call.rng +20 -14
- data/cockpit/themes/compact/rngs/callmanipulate.rng +28 -22
- data/cockpit/themes/compact/rngs/choose.rng +14 -0
- data/cockpit/themes/compact/rngs/critical.rng +5 -0
- data/cockpit/themes/compact/rngs/escape.rng +1 -0
- data/cockpit/themes/compact/rngs/group.rng +3 -0
- data/cockpit/themes/compact/rngs/loop.rng +22 -0
- data/cockpit/themes/compact/rngs/manipulate.rng +9 -0
- data/cockpit/themes/compact/rngs/otherwise.rng +22 -0
- data/cockpit/themes/compact/rngs/parallel.rng +21 -0
- data/cockpit/themes/compact/rngs/parallel_branch.rng +8 -0
- data/cockpit/themes/compact/rngs/scripts.rng +10 -11
- data/cockpit/themes/compact/rngs/stop.rng +5 -0
- data/cockpit/themes/compact/rngs/terminate.rng +1 -0
- data/cockpit/themes/compact/theme.js +1 -1
- data/cockpit/themes/convert_cpee2.rb +8 -0
- data/cockpit/themes/default/rngs/alternative.rng +8 -8
- data/cockpit/themes/default/rngs/call.rng +85 -49
- data/cockpit/themes/default/rngs/callmanipulate.rng +103 -64
- data/cockpit/themes/default/rngs/choose.rng +5 -3
- data/cockpit/themes/default/rngs/critical.rng +2 -2
- data/cockpit/themes/default/rngs/escape.rng +1 -1
- data/cockpit/themes/default/rngs/group.rng +3 -3
- data/cockpit/themes/default/rngs/loop.rng +8 -8
- data/cockpit/themes/default/rngs/manipulate.rng +3 -3
- data/cockpit/themes/default/rngs/otherwise.rng +8 -8
- data/cockpit/themes/default/rngs/parallel.rng +14 -6
- data/cockpit/themes/default/rngs/parallel_branch.rng +2 -2
- data/cockpit/themes/default/rngs/scripts.rng +23 -0
- data/cockpit/themes/default/rngs/stop.rng +2 -2
- data/cockpit/themes/default/rngs/terminate.rng +1 -1
- data/cockpit/themes/extended/rngs/alternative.rng +25 -0
- data/cockpit/themes/extended/rngs/call.rng +20 -14
- data/cockpit/themes/extended/rngs/callmanipulate.rng +28 -22
- data/cockpit/themes/extended/rngs/choose.rng +14 -0
- data/cockpit/themes/extended/rngs/critical.rng +5 -0
- data/cockpit/themes/extended/rngs/escape.rng +1 -0
- data/cockpit/themes/extended/rngs/group.rng +3 -0
- data/cockpit/themes/extended/rngs/loop.rng +22 -0
- data/cockpit/themes/extended/rngs/manipulate.rng +9 -0
- data/cockpit/themes/extended/rngs/otherwise.rng +22 -0
- data/cockpit/themes/extended/rngs/parallel.rng +21 -0
- data/cockpit/themes/extended/rngs/parallel_branch.rng +8 -0
- data/cockpit/themes/extended/rngs/scripts.rng +10 -11
- data/cockpit/themes/extended/rngs/stop.rng +5 -0
- data/cockpit/themes/extended/rngs/terminate.rng +1 -0
- data/cockpit/themes/extended/theme.js +14 -28
- data/cockpit/themes/model/rngs/alternative.rng +1 -1
- data/cockpit/themes/model/rngs/call.rng +16 -16
- data/cockpit/themes/model/rngs/callmanipulate.rng +17 -17
- data/cockpit/themes/model/rngs/choose.rng +1 -1
- data/cockpit/themes/model/rngs/critical.rng +1 -1
- data/cockpit/themes/model/rngs/escape.rng +1 -1
- data/cockpit/themes/model/rngs/group.rng +1 -1
- data/cockpit/themes/model/rngs/loop.rng +1 -1
- data/cockpit/themes/model/rngs/manipulate.rng +1 -1
- data/cockpit/themes/model/rngs/otherwise.rng +1 -1
- data/cockpit/themes/model/rngs/parallel.rng +1 -1
- data/cockpit/themes/model/rngs/parallel_branch.rng +1 -1
- data/cockpit/themes/model/rngs/scripts.rng +3 -4
- data/cockpit/themes/model/rngs/stop.rng +1 -1
- data/cockpit/themes/model/rngs/terminate.rng +1 -1
- data/cockpit/themes/model/theme.js +8 -7
- data/cockpit/themes/packed/rngs/alternative.rng +25 -0
- data/cockpit/themes/packed/rngs/call.rng +20 -14
- data/cockpit/themes/packed/rngs/callmanipulate.rng +28 -22
- data/cockpit/themes/packed/rngs/choose.rng +14 -0
- data/cockpit/themes/packed/rngs/critical.rng +5 -0
- data/cockpit/themes/packed/rngs/escape.rng +1 -0
- data/cockpit/themes/packed/rngs/group.rng +3 -0
- data/cockpit/themes/packed/rngs/loop.rng +22 -0
- data/cockpit/themes/packed/rngs/manipulate.rng +9 -0
- data/cockpit/themes/packed/rngs/otherwise.rng +22 -0
- data/cockpit/themes/packed/rngs/parallel.rng +21 -0
- data/cockpit/themes/packed/rngs/parallel_branch.rng +8 -0
- data/cockpit/themes/packed/rngs/scripts.rng +10 -11
- data/cockpit/themes/packed/rngs/stop.rng +5 -0
- data/cockpit/themes/packed/rngs/terminate.rng +1 -0
- data/cockpit/themes/packed/theme.js +8 -7
- data/cockpit/themes/preset/rngs/alternative.rng +25 -0
- data/cockpit/themes/preset/rngs/call.rng +20 -14
- data/cockpit/themes/preset/rngs/callmanipulate.rng +28 -22
- data/cockpit/themes/preset/rngs/choose.rng +14 -0
- data/cockpit/themes/preset/rngs/critical.rng +5 -0
- data/cockpit/themes/preset/rngs/escape.rng +1 -0
- data/cockpit/themes/preset/rngs/group.rng +3 -0
- data/cockpit/themes/preset/rngs/loop.rng +22 -0
- data/cockpit/themes/preset/rngs/manipulate.rng +9 -0
- data/cockpit/themes/preset/rngs/otherwise.rng +22 -0
- data/cockpit/themes/preset/rngs/parallel.rng +21 -0
- data/cockpit/themes/preset/rngs/parallel_branch.rng +8 -0
- data/cockpit/themes/preset/rngs/scripts.rng +10 -11
- data/cockpit/themes/preset/rngs/stop.rng +5 -0
- data/cockpit/themes/preset/rngs/terminate.rng +1 -0
- data/cockpit/themes/preset/theme.js +8 -7
- data/cpee.gemspec +9 -10
- data/{log/topics.xml → lib/callbacks.xml} +16 -6
- data/lib/{engine → callbacks}/callbacks.rng +2 -8
- data/lib/cpee.xml +10 -4
- data/lib/cpee/attributes_helper.rb +27 -0
- data/lib/cpee/controller.rb +113 -596
- data/lib/cpee/implementation.rb +152 -191
- data/lib/cpee/implementation_callbacks.rb +77 -0
- data/lib/cpee/implementation_notifications.rb +189 -0
- data/lib/cpee/implementation_properties.rb +707 -0
- data/lib/cpee/{callback.rb → message.rb} +20 -18
- data/lib/cpee/persistence.rb +135 -0
- data/lib/cpee/statemachine.rb +20 -0
- data/lib/cpee/transform.rb +95 -0
- data/lib/engine.xml +1 -59
- data/lib/properties.xml +236 -0
- data/lib/properties/arbitrary.rng +26 -0
- data/lib/properties/attributes.rng +10 -0
- data/lib/properties/dataelements.rng +10 -0
- data/lib/properties/description.rng +8 -0
- data/lib/properties/dsl.rng +7 -0
- data/lib/properties/dslx.rng +8 -0
- data/lib/properties/endpoints.rng +10 -0
- data/lib/properties/handlerwrapper.rng +9 -0
- data/lib/properties/position.rng +15 -0
- data/lib/properties/positions.rng +10 -0
- data/lib/properties/properties.rng +29 -0
- data/lib/properties/set-properties.rng +25 -0
- data/lib/properties/set-some-properties.rng +45 -0
- data/lib/properties/simple.rng +8 -0
- data/lib/properties/state.rng +33 -0
- data/lib/properties/status.rng +12 -0
- data/lib/properties/t_attributes.rng +7 -0
- data/lib/properties/t_dataelements.rng +7 -0
- data/lib/properties/t_endpoints.rng +7 -0
- data/lib/properties/t_position.rng +7 -0
- data/lib/properties/t_positions.rng +7 -0
- data/lib/properties/t_simple.rng +7 -0
- data/lib/properties/t_status.rng +7 -0
- data/lib/properties/t_transformation.rng +7 -0
- data/lib/properties/transformation.rng +40 -0
- data/server/dev.rb +1 -0
- data/server/handlerwrappers/default.rb +40 -38
- data/server/resources/backend/README.md +17 -0
- data/server/resources/backend/instance.rb +23 -0
- data/server/resources/backend/instance.template +19 -0
- data/server/resources/backend/opts.yaml +6 -0
- data/server/resources/backend/run +29 -0
- data/server/resources/notifications/logging/subscription.xml +1 -1
- data/server/resources/properties.empty +38 -0
- data/server/resources/properties.init +11 -11
- data/server/resources/states.dot +19 -0
- data/server/resources/states.xml +49 -0
- data/server/routing/end.rb +44 -0
- data/server/routing/forward-events.rb +59 -0
- data/server/routing/forward-votes.rb +108 -0
- data/server/routing/persist.rb +155 -0
- data/server/server.rb +1 -0
- data/tools/cpee +19 -15
- metadata +126 -176
- data/INSTALL +0 -23
- data/cockpit/test.html +0 -40
- data/cockpit/themes/compact/rngs/alternative.rng +0 -1
- data/cockpit/themes/compact/rngs/choose.rng +0 -1
- data/cockpit/themes/compact/rngs/critical.rng +0 -1
- data/cockpit/themes/compact/rngs/escape.rng +0 -1
- data/cockpit/themes/compact/rngs/group.rng +0 -1
- data/cockpit/themes/compact/rngs/loop.rng +0 -1
- data/cockpit/themes/compact/rngs/manipulate.rng +0 -1
- data/cockpit/themes/compact/rngs/otherwise.rng +0 -1
- data/cockpit/themes/compact/rngs/parallel.rng +0 -1
- data/cockpit/themes/compact/rngs/parallel_branch.rng +0 -1
- data/cockpit/themes/compact/rngs/stop.rng +0 -1
- data/cockpit/themes/compact/rngs/terminate.rng +0 -1
- data/cockpit/themes/default/rngs/finalize.rng +0 -6
- data/cockpit/themes/default/rngs/update.rng +0 -6
- data/cockpit/themes/default/theme.js +0 -1286
- data/cockpit/themes/extended/rngs/alternative.rng +0 -1
- data/cockpit/themes/extended/rngs/choose.rng +0 -1
- data/cockpit/themes/extended/rngs/critical.rng +0 -1
- data/cockpit/themes/extended/rngs/escape.rng +0 -1
- data/cockpit/themes/extended/rngs/group.rng +0 -1
- data/cockpit/themes/extended/rngs/loop.rng +0 -1
- data/cockpit/themes/extended/rngs/manipulate.rng +0 -1
- data/cockpit/themes/extended/rngs/otherwise.rng +0 -1
- data/cockpit/themes/extended/rngs/parallel.rng +0 -1
- data/cockpit/themes/extended/rngs/parallel_branch.rng +0 -1
- data/cockpit/themes/extended/rngs/stop.rng +0 -1
- data/cockpit/themes/extended/rngs/terminate.rng +0 -1
- data/cockpit/themes/labels/rngs/alternative.rng +0 -25
- data/cockpit/themes/labels/rngs/call.rng +0 -81
- data/cockpit/themes/labels/rngs/callmanipulate.rng +0 -101
- data/cockpit/themes/labels/rngs/choose.rng +0 -12
- data/cockpit/themes/labels/rngs/critical.rng +0 -5
- data/cockpit/themes/labels/rngs/escape.rng +0 -1
- data/cockpit/themes/labels/rngs/finalize.rng +0 -6
- data/cockpit/themes/labels/rngs/group.rng +0 -3
- data/cockpit/themes/labels/rngs/loop.rng +0 -22
- data/cockpit/themes/labels/rngs/manipulate.rng +0 -9
- data/cockpit/themes/labels/rngs/otherwise.rng +0 -22
- data/cockpit/themes/labels/rngs/parallel.rng +0 -13
- data/cockpit/themes/labels/rngs/parallel_branch.rng +0 -8
- data/cockpit/themes/labels/rngs/stop.rng +0 -5
- data/cockpit/themes/labels/rngs/terminate.rng +0 -1
- data/cockpit/themes/labels/rngs/update.rng +0 -6
- data/cockpit/themes/labels/symbols/alternative.svg +0 -5
- data/cockpit/themes/labels/symbols/arrow.svg +0 -3
- data/cockpit/themes/labels/symbols/call.svg +0 -6
- data/cockpit/themes/labels/symbols/callmanipulate.svg +0 -8
- data/cockpit/themes/labels/symbols/choose.svg +0 -5
- data/cockpit/themes/labels/symbols/choose_exclusive.svg +0 -5
- data/cockpit/themes/labels/symbols/choose_inclusive.svg +0 -4
- data/cockpit/themes/labels/symbols/complex.svg +0 -8
- data/cockpit/themes/labels/symbols/critical.svg +0 -4
- data/cockpit/themes/labels/symbols/end.svg +0 -3
- data/cockpit/themes/labels/symbols/escape.svg +0 -5
- data/cockpit/themes/labels/symbols/event_end.svg +0 -3
- data/cockpit/themes/labels/symbols/loop.svg +0 -5
- data/cockpit/themes/labels/symbols/manipulate.svg +0 -4
- data/cockpit/themes/labels/symbols/otherwise.svg +0 -5
- data/cockpit/themes/labels/symbols/parallel.svg +0 -5
- data/cockpit/themes/labels/symbols/parallel_branch.svg +0 -5
- data/cockpit/themes/labels/symbols/parallel_branch_compact.svg +0 -4
- data/cockpit/themes/labels/symbols/parallel_branch_event.svg +0 -14
- data/cockpit/themes/labels/symbols/parallel_branch_normal.svg +0 -5
- data/cockpit/themes/labels/symbols/scripts.svg +0 -4
- data/cockpit/themes/labels/symbols/start.svg +0 -3
- data/cockpit/themes/labels/symbols/stop.svg +0 -5
- data/cockpit/themes/labels/symbols/terminate.svg +0 -4
- data/cockpit/themes/packed/rngs/alternative.rng +0 -1
- data/cockpit/themes/packed/rngs/choose.rng +0 -1
- data/cockpit/themes/packed/rngs/critical.rng +0 -1
- data/cockpit/themes/packed/rngs/escape.rng +0 -1
- data/cockpit/themes/packed/rngs/group.rng +0 -1
- data/cockpit/themes/packed/rngs/loop.rng +0 -1
- data/cockpit/themes/packed/rngs/manipulate.rng +0 -1
- data/cockpit/themes/packed/rngs/otherwise.rng +0 -1
- data/cockpit/themes/packed/rngs/parallel.rng +0 -1
- data/cockpit/themes/packed/rngs/parallel_branch.rng +0 -1
- data/cockpit/themes/packed/rngs/stop.rng +0 -1
- data/cockpit/themes/packed/rngs/terminate.rng +0 -1
- data/cockpit/themes/preset/rngs/alternative.rng +0 -1
- data/cockpit/themes/preset/rngs/choose.rng +0 -1
- data/cockpit/themes/preset/rngs/critical.rng +0 -1
- data/cockpit/themes/preset/rngs/escape.rng +0 -1
- data/cockpit/themes/preset/rngs/group.rng +0 -1
- data/cockpit/themes/preset/rngs/loop.rng +0 -1
- data/cockpit/themes/preset/rngs/manipulate.rng +0 -1
- data/cockpit/themes/preset/rngs/otherwise.rng +0 -1
- data/cockpit/themes/preset/rngs/parallel.rng +0 -1
- data/cockpit/themes/preset/rngs/parallel_branch.rng +0 -1
- data/cockpit/themes/preset/rngs/stop.rng +0 -1
- data/cockpit/themes/preset/rngs/terminate.rng +0 -1
- data/lib/cpee/empty_workflow.rb +0 -28
- data/lib/cpee/handler_notifications.rb +0 -47
- data/lib/cpee/handler_properties.rb +0 -50
- data/lib/cpee/instantiation.rb +0 -369
- data/lib/cpee/processtransformation/bpel/Repository/booking.bpel +0 -125
- data/lib/cpee/processtransformation/bpel/Repository/booking.wsdl +0 -72
- data/lib/cpee/processtransformation/bpel/Repository/booking/airline.wsdl +0 -71
- data/lib/cpee/processtransformation/bpel/Repository/booking/hotel.wsdl +0 -64
- data/lib/cpee/processtransformation/bpel/Repository/booking/report.wsdl +0 -71
- data/lib/cpee/processtransformation/bpel/bpel2wee.rb +0 -34
- data/lib/cpee/processtransformation/bpel/bpelserver.ru +0 -64
- data/lib/cpee/processtransformation/bpel/bpelserver.xml +0 -70
- data/lib/cpee/processtransformation/bpel/lib/BPEL_Transform.rb +0 -367
- data/lib/cpee/processtransformation/bpmn2.rb +0 -297
- data/lib/cpee/processtransformation/cpee.rb +0 -119
- data/lib/cpee/processtransformation/structures.rb +0 -465
- data/lib/cpee/processtransformation/target.rb +0 -50
- data/log/azure.rb +0 -10
- data/log/azure_logger.rb +0 -136
- data/log/chain.xml +0 -27
- data/log/elasticsearch.rb +0 -15
- data/log/elasticsearch_logging.rb +0 -377
- data/log/legacy/test_es.rb +0 -26
- data/log/legacy/test_split.rb +0 -211
- data/log/log.xml +0 -13
- data/log/non_tamp.rb +0 -156
- data/log/sic.rb +0 -63
- data/log/template.xes_xml +0 -23
- data/log/template.xes_yaml +0 -28
- data/log/trace.yaml +0 -17717
- data/log/trace_sic.yaml +0 -18343
- data/log/xes_xml.rb +0 -121
- data/log/xes_yaml.rb +0 -96
- data/server/handlerwrappers/soap.rb +0 -146
- data/server/resources/notifications/logging/consumer-secret +0 -1
- data/server/resources/notifications/logging/producer-secret +0 -1
- data/server/resources/properties.schema.active +0 -139
- data/server/resources/properties.schema.finished +0 -139
- data/server/resources/properties.schema.inactive +0 -136
- data/server/resources/test1.xml +0 -58
- data/server/resources/test2.xml +0 -60
- data/server/resources/test3.xml +0 -217
- data/test/callback.rb +0 -9
@@ -1,5 +0,0 @@
|
|
1
|
-
<svg class="clickable" xmlns="http://www.w3.org/2000/svg">
|
2
|
-
<rect transform="rotate(45,14,12)" x="7" y="3" width="21" height="21" class="cline hfill stand"/>
|
3
|
-
<line x1="10.5" y1="20.5" x2="20.5" y2="10.5" class="stand"/>
|
4
|
-
<line x1="10.5" y1="10.5" x2="20.5" y2="20.5" class="stand"/>
|
5
|
-
</svg>
|
@@ -1,5 +0,0 @@
|
|
1
|
-
<svg class="clickable" xmlns="http://www.w3.org/2000/svg">
|
2
|
-
<rect x="11" y="6" width="9" height="18" rx="0" class="hline white"/>
|
3
|
-
<path class="cline hfill stand" d="M 11,5 C 2,9 2,21 11,25 M 20,5 C 29,9 29,21 20,25" style="stroke-dasharray:1,4;"/>
|
4
|
-
<line x1="15.6" y1="4" x2="15.6" y2="27" class="ourline"/>
|
5
|
-
</svg>
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<svg class="clickable" xmlns="http://www.w3.org/2000/svg">
|
2
|
-
<rect x="1" y="3" width="24" height="24" rx="4" class="hfill rfill cline stand"/>
|
3
|
-
|
4
|
-
<circle cx="24" cy="15" r="10" class="cline rfill stand" style="stroke-dasharray: 1,3"/>
|
5
|
-
<circle cx="24" cy="15" r="7" class="cline rfill stand" style="stroke-dasharray: 1,3"/>
|
6
|
-
<line x1="24" y1="11" x2="20" y2="18" class="stand"/>
|
7
|
-
<line x1="20" y1="18" x2="28" y2="18" class="stand"/>
|
8
|
-
<line x1="28" y1="18" x2="24" y2="11" class="stand"/>
|
9
|
-
|
10
|
-
<circle cx="55.5" cy="15" r="14" class="cline hfill rfill stand"/>
|
11
|
-
<line x1="55.5" y1="11" x2="51.5" y2="18" class="stand"/>
|
12
|
-
<line x1="51.5" y1="18" x2="59.5" y2="18" class="stand"/>
|
13
|
-
<line x1="59.5" y1="18" x2="55.5" y2="11" class="stand"/>
|
14
|
-
</svg>
|
@@ -1,5 +0,0 @@
|
|
1
|
-
<svg class="clickable" xmlns="http://www.w3.org/2000/svg">
|
2
|
-
<rect x="11" y="6" width="9" height="18" rx="0" class="hline white"/>
|
3
|
-
<path class="cline hfill stand" d="M 11,5 C 2,9 2,21 11,25 M 20,5 C 29,9 29,21 20,25" style="stroke-dasharray:1,4;"/>
|
4
|
-
<line x1="15.6" y1="4" x2="15.6" y2="27" class="ourline"/>
|
5
|
-
</svg>
|
@@ -1 +0,0 @@
|
|
1
|
-
../../default/rngs/alternative.rng
|
@@ -1 +0,0 @@
|
|
1
|
-
../../default/rngs/choose.rng
|
@@ -1 +0,0 @@
|
|
1
|
-
../../default/rngs/critical.rng
|
@@ -1 +0,0 @@
|
|
1
|
-
../../default/rngs/escape.rng
|
@@ -1 +0,0 @@
|
|
1
|
-
../../default/rngs/group.rng
|
@@ -1 +0,0 @@
|
|
1
|
-
../../default/rngs/loop.rng
|
@@ -1 +0,0 @@
|
|
1
|
-
../../default/rngs/manipulate.rng
|
@@ -1 +0,0 @@
|
|
1
|
-
../../default/rngs/otherwise.rng
|
@@ -1 +0,0 @@
|
|
1
|
-
../../default/rngs/parallel.rng
|
@@ -1 +0,0 @@
|
|
1
|
-
../../default/rngs/parallel_branch.rng
|
@@ -1 +0,0 @@
|
|
1
|
-
../../default/rngs/stop.rng
|
@@ -1 +0,0 @@
|
|
1
|
-
../../default/rngs/terminate.rng
|
@@ -1 +0,0 @@
|
|
1
|
-
../../default/rngs/alternative.rng
|
@@ -1 +0,0 @@
|
|
1
|
-
../../default/rngs/choose.rng
|
@@ -1 +0,0 @@
|
|
1
|
-
../../default/rngs/critical.rng
|
@@ -1 +0,0 @@
|
|
1
|
-
../../default/rngs/escape.rng
|
@@ -1 +0,0 @@
|
|
1
|
-
../../default/rngs/group.rng
|
@@ -1 +0,0 @@
|
|
1
|
-
../../default/rngs/loop.rng
|
@@ -1 +0,0 @@
|
|
1
|
-
../../default/rngs/manipulate.rng
|
@@ -1 +0,0 @@
|
|
1
|
-
../../default/rngs/otherwise.rng
|
@@ -1 +0,0 @@
|
|
1
|
-
../../default/rngs/parallel.rng
|
@@ -1 +0,0 @@
|
|
1
|
-
../../default/rngs/parallel_branch.rng
|
@@ -1 +0,0 @@
|
|
1
|
-
../../default/rngs/stop.rng
|
@@ -1 +0,0 @@
|
|
1
|
-
../../default/rngs/terminate.rng
|
data/lib/cpee/empty_workflow.rb
DELETED
@@ -1,28 +0,0 @@
|
|
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
|
-
|
15
|
-
if Module.const_defined?(:CPEE) && CPEE.const_defined?(:DEVELOP) && CPEE::DEVELOP.const_defined?(:WEEL)
|
16
|
-
require File.join(CPEE::DEVELOP::WEEL,'weel')
|
17
|
-
else
|
18
|
-
require 'weel'
|
19
|
-
end
|
20
|
-
require ::File.dirname(__FILE__) + '/../../server/handlerwrappers/default'
|
21
|
-
|
22
|
-
class EmptyWorkflow < WEEL
|
23
|
-
handlerwrapper DefaultHandlerWrapper
|
24
|
-
|
25
|
-
control flow do
|
26
|
-
# control flow will be set externally
|
27
|
-
end
|
28
|
-
end
|
@@ -1,47 +0,0 @@
|
|
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
|
-
|
15
|
-
class NotificationsHandler < Riddl::Utils::Notifications::Producer::HandlerBase
|
16
|
-
def ws_open(socket)
|
17
|
-
@data.add_websocket(@key,socket)
|
18
|
-
end
|
19
|
-
def ws_close
|
20
|
-
@data.unserialize_notifications!(:del,@key)
|
21
|
-
@data.notify('handler/change', :instance => @data.instance)
|
22
|
-
end
|
23
|
-
def ws_message(data)
|
24
|
-
begin
|
25
|
-
doc = XML::Smart::string(data)
|
26
|
-
callback = doc.find("string(/vote/@id)")
|
27
|
-
result = doc.find("string(/vote)")
|
28
|
-
@data.callbacks[callback].callback(result == 'true' ? true : false)
|
29
|
-
@data.callbacks.delete(callback)
|
30
|
-
rescue
|
31
|
-
puts "Invalid message over websocket"
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def create
|
36
|
-
@data.unserialize_notifications!(:cre,@key)
|
37
|
-
@data.notify('handler/change', :instance => @data.instance)
|
38
|
-
end
|
39
|
-
def delete
|
40
|
-
@data.unserialize_notifications!(:del,@key)
|
41
|
-
@data.notify('handler/change', :instance => @data.instance)
|
42
|
-
end
|
43
|
-
def update
|
44
|
-
@data.unserialize_notifications!(:upd,@key)
|
45
|
-
@data.notify('handler/change', :instance => @data.instance)
|
46
|
-
end
|
47
|
-
end
|
@@ -1,50 +0,0 @@
|
|
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
|
-
|
15
|
-
class PropertiesHandler < Riddl::Utils::Properties::HandlerBase
|
16
|
-
def sync
|
17
|
-
case @property
|
18
|
-
when 'handlerwrapper'
|
19
|
-
@data.unserialize_handlerwrapper!
|
20
|
-
@data.notify('handlerwrapper/change', :instance => @data.instance)
|
21
|
-
when 'description'
|
22
|
-
nots = @data.unserialize_description!
|
23
|
-
nots.uniq.each do |noti|
|
24
|
-
@data.notify(*noti)
|
25
|
-
end
|
26
|
-
when 'endpoints'
|
27
|
-
@data.unserialize_endpoints!
|
28
|
-
@data.notify('endpoints/change', :label => 'external', :instance => @data.instance, :instance_name => @data.info, :instance_uuid => @data.uuid, :changed => @data.endpoints.keys, :values => @data.endpoints)
|
29
|
-
when 'dataelements'
|
30
|
-
@data.unserialize_dataelements!
|
31
|
-
@data.notify('dataelements/change', :label => 'external', :instance => @data.instance, :instance_name => @data.info, :instance_uuid => @data.uuid, :changed => @data.dataelements.keys, :values => @data.dataelements)
|
32
|
-
when 'attributes'
|
33
|
-
@data.unserialize_attributes!
|
34
|
-
@data.notify('attributes/change', :label => 'external', :instance => @data.instance, :instance_name => @data.info, :instance_uuid => @data.uuid, :changed => @data.attributes.keys, :values => @data.attributes)
|
35
|
-
when 'positions'
|
36
|
-
@data.unserialize_positions!
|
37
|
-
@data.notify('position/change', :instance => @data.instance)
|
38
|
-
when 'transformation'
|
39
|
-
@data.notify('transformation/change', :instance => @data.instance)
|
40
|
-
when 'state'
|
41
|
-
@data.unserialize_state!
|
42
|
-
else
|
43
|
-
nil
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
def create; sync; end
|
48
|
-
def update; sync; end
|
49
|
-
def delete; sync; end
|
50
|
-
end
|
data/lib/cpee/instantiation.rb
DELETED
@@ -1,369 +0,0 @@
|
|
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
|
-
|
15
|
-
require 'riddl/server'
|
16
|
-
require 'securerandom'
|
17
|
-
require 'xml/smart'
|
18
|
-
require 'base64'
|
19
|
-
require 'uri'
|
20
|
-
require 'redis'
|
21
|
-
require 'json'
|
22
|
-
require ::File.dirname(__FILE__) + '/value_helper'
|
23
|
-
|
24
|
-
module CPEE
|
25
|
-
module Instantiation
|
26
|
-
|
27
|
-
SERVER = File.expand_path(__dir__ + '/../instantiation.xml')
|
28
|
-
|
29
|
-
module Helpers #{{{
|
30
|
-
def load_testset(tdoc,cpee,name=nil,stream=nil) #{{{
|
31
|
-
ins = -1
|
32
|
-
uuid = nil
|
33
|
-
XML::Smart.string(tdoc) do |doc|
|
34
|
-
doc.register_namespace 'desc', 'http://cpee.org/ns/description/1.0'
|
35
|
-
doc.register_namespace 'prop', 'http://riddl.org/ns/common-patterns/properties/1.0'
|
36
|
-
|
37
|
-
srv = Riddl::Client.new(cpee, cpee + "?riddl-description")
|
38
|
-
res = srv.resource("/")
|
39
|
-
if name
|
40
|
-
doc.find("/testset/attributes/prop:info").each do |e|
|
41
|
-
e.text = name
|
42
|
-
end
|
43
|
-
end
|
44
|
-
if stream && !stream.empty?
|
45
|
-
JSON.parse(stream).each do |e|
|
46
|
-
begin
|
47
|
-
stream = Typhoeus.get e['url']
|
48
|
-
if stream.success?
|
49
|
-
XML::Smart::string(stream.response_body) do |str|
|
50
|
-
doc.find("//desc:call[@id=\"#{e['id']}\"]/desc:parameters/desc:stream").each do |ele|
|
51
|
-
ele.replace_by str.root
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
rescue => e
|
56
|
-
puts e.message
|
57
|
-
puts e.backtrace
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
status, response, headers = res.post Riddl::Parameter::Simple.new("info",doc.find("string(/testset/attributes/prop:info)"))
|
63
|
-
|
64
|
-
if status == 200
|
65
|
-
ins = response.first.value
|
66
|
-
uuid = headers['CPEE_INSTANCE_UUID']
|
67
|
-
params = []
|
68
|
-
|
69
|
-
res = srv.resource("/#{ins}/properties/values")
|
70
|
-
["handlerwrapper","positions","dataelements","endpoints","attributes","transformation"].each do |item|
|
71
|
-
if doc.find("/testset/#{item}").any?
|
72
|
-
params << Riddl::Parameter::Simple.new("name",item)
|
73
|
-
params << Riddl::Parameter::Simple.new("content",doc.find("/testset/#{item}").first.dump)
|
74
|
-
end
|
75
|
-
end
|
76
|
-
["description"].each do |item|
|
77
|
-
if doc.find("/testset/#{item}").any?
|
78
|
-
params << Riddl::Parameter::Simple.new("name",item)
|
79
|
-
params << Riddl::Parameter::Simple.new("content","<content>" + doc.find("/testset/#{item}/desc:*").first.dump + "</content>")
|
80
|
-
end
|
81
|
-
end
|
82
|
-
status, response = res.put params
|
83
|
-
["handlers"].each do |item|
|
84
|
-
doc.find("/testset/#{item}/handler").each do |han|
|
85
|
-
#pp han.children.first
|
86
|
-
url = han.attributes['url']
|
87
|
-
inp = "url=" + URI.encode_www_form_component(url)
|
88
|
-
inp = inp + "&topic=" + han.children.first.attributes['topic']
|
89
|
-
inp = inp + "&" + han.children.first.qname.to_s + "=" + han.children.first.to_s
|
90
|
-
status,body = Riddl::Client::new(cpee+ins+"/notifications/subscriptions/").post(
|
91
|
-
[
|
92
|
-
Riddl::Parameter::Simple.new("url",han.attributes['url']),
|
93
|
-
Riddl::Parameter::Simple.new("topic",han.children.first.attributes['topic']),
|
94
|
-
Riddl::Parameter::Simple.new(han.children.first.qname.to_s,han.children.first.to_s)
|
95
|
-
]
|
96
|
-
)
|
97
|
-
end
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
101
|
-
[ins, uuid]
|
102
|
-
end #}}}
|
103
|
-
private :load_testset
|
104
|
-
def handle_waiting(cpee,instance,uuid,behavior,selfurl,cblist) #{{{
|
105
|
-
if behavior =~ /^wait/
|
106
|
-
condition = behavior.match(/_([^_]+)_/)&.[](1) || 'finished'
|
107
|
-
@headers << Riddl::Header.new('CPEE-CALLBACK','true')
|
108
|
-
cb = @h['CPEE_CALLBACK']
|
109
|
-
|
110
|
-
if cb
|
111
|
-
cbk = SecureRandom.uuid
|
112
|
-
srv = Riddl::Client.new(cpee, cpee + "?riddl-description")
|
113
|
-
status, response = srv.resource("/#{instance}/notifications/subscriptions/").post [
|
114
|
-
Riddl::Parameter::Simple.new("url",File.join(selfurl,'callback',cbk)),
|
115
|
-
Riddl::Parameter::Simple.new("topic","state"),
|
116
|
-
Riddl::Parameter::Simple.new("events","change")
|
117
|
-
]
|
118
|
-
cblist.rpush(cbk, cb)
|
119
|
-
cblist.rpush(cbk, condition)
|
120
|
-
cblist.rpush(cbk, instance)
|
121
|
-
cblist.rpush(cbk, uuid)
|
122
|
-
cblist.rpush(cbk, File.join(cpee,instance))
|
123
|
-
end
|
124
|
-
end
|
125
|
-
end #}}}
|
126
|
-
private :handle_waiting
|
127
|
-
def handle_starting(cpee,instance,behavior) #{{{
|
128
|
-
if behavior =~ /_running$/
|
129
|
-
srv = Riddl::Client.new(cpee, cpee + "?riddl-description")
|
130
|
-
res = srv.resource("/#{instance}/properties/values")
|
131
|
-
status, response = res.put [
|
132
|
-
Riddl::Parameter::Simple.new('name', 'state'),
|
133
|
-
Riddl::Parameter::Simple.new('value','running')
|
134
|
-
]
|
135
|
-
end
|
136
|
-
end #}}}
|
137
|
-
private :handle_starting
|
138
|
-
def handle_data(cpee,instance,data) #{{{
|
139
|
-
if data && !data.empty?
|
140
|
-
content = XML::Smart.string('<content/>')
|
141
|
-
JSON::parse(data).each do |k,v|
|
142
|
-
content.root.add(k,v)
|
143
|
-
end
|
144
|
-
srv = Riddl::Client.new(cpee, cpee + "?riddl-description")
|
145
|
-
res = srv.resource("/#{instance}/properties/values/dataelements/")
|
146
|
-
status, response = res.patch [
|
147
|
-
Riddl::Parameter::Complex.new('content','text/xml',content.to_s)
|
148
|
-
]
|
149
|
-
end rescue nil
|
150
|
-
end #}}}
|
151
|
-
def handle_endpoints(cpee,instance,data) #{{{
|
152
|
-
if data && !data.empty?
|
153
|
-
content = XML::Smart.string('<content/>')
|
154
|
-
JSON::parse(data).each do |k,v|
|
155
|
-
content.root.add(k,v)
|
156
|
-
end
|
157
|
-
srv = Riddl::Client.new(cpee, cpee + "?riddl-description")
|
158
|
-
res = srv.resource("/#{instance}/properties/values/endpoints/")
|
159
|
-
status, response = res.patch [
|
160
|
-
Riddl::Parameter::Complex.new('content','text/xml',content.to_s)
|
161
|
-
]
|
162
|
-
end rescue nil
|
163
|
-
end #}}}
|
164
|
-
end #}}}
|
165
|
-
|
166
|
-
class InstantiateGit < Riddl::Implementation #{{{
|
167
|
-
include Helpers
|
168
|
-
|
169
|
-
def response
|
170
|
-
cpee = @h['X_CPEE'] || @a[0]
|
171
|
-
selfurl = @a[1]
|
172
|
-
cblist = @a[2]
|
173
|
-
|
174
|
-
status, res = Riddl::Client.new(File.join(@p[1].value,'raw',@p[2].value,@p[3].value).gsub(/ /,'%20')).get
|
175
|
-
tdoc = if status >= 200 && status < 300
|
176
|
-
res[0].value.read
|
177
|
-
else
|
178
|
-
(@status = 500) && return
|
179
|
-
end
|
180
|
-
stream = @p.find{ |e| e.name == 'stream' }&.value
|
181
|
-
if (instance, uuid = load_testset(tdoc,cpee,nil,stream)).first == -1
|
182
|
-
@status = 500
|
183
|
-
else
|
184
|
-
handle_data cpee, instance, @p[4]&.value if @p[4]&.name == 'init'
|
185
|
-
handle_endpoints cpee, instance, @p[4]&.value if @p[4]&.name == 'endpoints'
|
186
|
-
handle_endpoints cpee, instance, @p[5]&.value if @p[5]&.name == 'endpoints'
|
187
|
-
|
188
|
-
handle_waiting cpee, instance, uuid, @p[0].value, selfurl, cblist
|
189
|
-
handle_starting cpee, instance, @p[0].value
|
190
|
-
|
191
|
-
send = {
|
192
|
-
'CPEE-INSTANCE' => instance,
|
193
|
-
'CPEE-INSTANCE-URL' => File.join(cpee,instance),
|
194
|
-
'CPEE-INSTANCE-UUID' => uuid,
|
195
|
-
'CPEE-BEHAVIOR' => @p[0].value
|
196
|
-
}
|
197
|
-
@headers << Riddl::Header.new('CPEE-INSTANTIATION',JSON::generate(send))
|
198
|
-
Riddl::Parameter::Complex.new('instance','application/json',JSON::generate(send))
|
199
|
-
end
|
200
|
-
end
|
201
|
-
end #}}}
|
202
|
-
|
203
|
-
class InstantiateUrl < Riddl::Implementation #{{{
|
204
|
-
include Helpers
|
205
|
-
|
206
|
-
def response
|
207
|
-
cpee = @h['X_CPEE'] || @a[0]
|
208
|
-
selfurl = @a[1]
|
209
|
-
cblist = @a[2]
|
210
|
-
name = @a[3] ? @p.shift.value : nil
|
211
|
-
|
212
|
-
status, res = Riddl::Client.new(@p[1].value.gsub(/ /,'%20')).get
|
213
|
-
tdoc = if status >= 200 && status < 300
|
214
|
-
res[0].value.read
|
215
|
-
else
|
216
|
-
(@status = 500) && return
|
217
|
-
end
|
218
|
-
stream = @p.find{ |e| e.name == 'stream' }&.value
|
219
|
-
if (instance, uuid = load_testset(tdoc,cpee,name,stream)).first == -1
|
220
|
-
@status = 500
|
221
|
-
else
|
222
|
-
handle_data cpee, instance, @p[2]&.value if @p[2]&.name == 'init'
|
223
|
-
handle_endpoints cpee, instance, @p[2]&.value if @p[2]&.name == 'endpoints'
|
224
|
-
handle_endpoints cpee, instance, @p[3]&.value if @p[3]&.name == 'endpoints'
|
225
|
-
|
226
|
-
handle_waiting cpee, instance, uuid, @p[0].value, selfurl, cblist
|
227
|
-
handle_starting cpee, instance, @p[0].value
|
228
|
-
|
229
|
-
send = {
|
230
|
-
'CPEE-INSTANCE' => instance,
|
231
|
-
'CPEE-INSTANCE-URL' => File.join(cpee,instance),
|
232
|
-
'CPEE-INSTANCE-UUID' => uuid,
|
233
|
-
'CPEE-BEHAVIOR' => @p[0].value
|
234
|
-
}
|
235
|
-
@headers << Riddl::Header.new('CPEE-INSTANTIATION',JSON::generate(send))
|
236
|
-
Riddl::Parameter::Complex.new('instance','application/json',JSON::generate(send))
|
237
|
-
end
|
238
|
-
end
|
239
|
-
end #}}}
|
240
|
-
|
241
|
-
class InstantiateXML < Riddl::Implementation #{{{
|
242
|
-
include Helpers
|
243
|
-
|
244
|
-
def response
|
245
|
-
cpee = @h['X_CPEE'] || @a[0]
|
246
|
-
behavior = @a[1] ? 'fork_ready' : @p[0].value
|
247
|
-
data = @a[1] ? 0 : 1
|
248
|
-
selfurl = @a[2]
|
249
|
-
cblist = @a[3]
|
250
|
-
tdoc = if @p[data].additional =~ /base64/
|
251
|
-
Base64.decode64(@p[data].value.read)
|
252
|
-
else
|
253
|
-
@p[data].value.read
|
254
|
-
end
|
255
|
-
|
256
|
-
if (instance, uuid = load_testset(tdoc,cpee)).first == -1
|
257
|
-
@status = 500
|
258
|
-
else
|
259
|
-
handle_data cpee, instance, @p[data+1]&.value
|
260
|
-
handle_waiting cpee, instance, uuid, behavior, selfurl, cblist
|
261
|
-
handle_starting cpee, instance, behavior
|
262
|
-
|
263
|
-
send = {
|
264
|
-
'CPEE-INSTANCE' => instance,
|
265
|
-
'CPEE-INSTANCE-URL' => File.join(cpee,instance),
|
266
|
-
'CPEE-INSTANCE-UUID' => uuid,
|
267
|
-
'CPEE-BEHAVIOR' => behavior
|
268
|
-
}
|
269
|
-
Riddl::Parameter::Complex.new('instance','application/json',JSON::generate(send))
|
270
|
-
end
|
271
|
-
end
|
272
|
-
end #}}}
|
273
|
-
|
274
|
-
class HandleInstance < Riddl::Implementation #{{{
|
275
|
-
include Helpers
|
276
|
-
|
277
|
-
def response
|
278
|
-
cpee = @h['X_CPEE'] || @a[0]
|
279
|
-
selfurl = @a[1]
|
280
|
-
cblist = @a[2]
|
281
|
-
instance = @p[1].value
|
282
|
-
|
283
|
-
srv = Riddl::Client.new(cpee, cpee + "?riddl-description")
|
284
|
-
res = srv.resource("/#{instance}/properties/values/attributes/uuid")
|
285
|
-
status, response = res.get
|
286
|
-
|
287
|
-
if status >= 200 && status < 300
|
288
|
-
uuid = XML::Smart::string(response.first.value).root.text
|
289
|
-
handle_data cpee, instance, @p[2]&.value
|
290
|
-
handle_waiting cpee, instance, uuid, @p[0].value, selfurl, cblist
|
291
|
-
handle_starting cpee, instance, @p[0].value
|
292
|
-
return Riddl::Parameter::Simple.new("url",cpee + instance)
|
293
|
-
end
|
294
|
-
end
|
295
|
-
end #}}}
|
296
|
-
|
297
|
-
class ContinueTask < Riddl::Implementation #{{{
|
298
|
-
def response
|
299
|
-
cblist = @a[1]
|
300
|
-
topic = @p[1].value
|
301
|
-
event_name = @p[2].value
|
302
|
-
notification = JSON.parse(@p[3].value)
|
303
|
-
|
304
|
-
key = @r.last
|
305
|
-
cb, condition, instance, uuid, instance_url = cblist.lrange(key,0,-1)
|
306
|
-
|
307
|
-
cpee = File.dirname(instance_url)
|
308
|
-
|
309
|
-
orisend = {
|
310
|
-
'CPEE-INSTANCE' => instance,
|
311
|
-
'CPEE-INSTANCE-URL' => instance_url,
|
312
|
-
'CPEE-INSTANCE-UUID' => uuid,
|
313
|
-
'CPEE-STATE' => notification['state']
|
314
|
-
}
|
315
|
-
send = orisend.dup
|
316
|
-
|
317
|
-
if notification['state'] == condition
|
318
|
-
cblist.del(key)
|
319
|
-
srv = Riddl::Client.new(cpee, cpee + "?riddl-description")
|
320
|
-
res = srv.resource("/#{instance}/properties/values/dataelements")
|
321
|
-
status, response = res.get
|
322
|
-
if status >= 200 && status < 300
|
323
|
-
doc = XML::Smart.string(response[0].value.read)
|
324
|
-
doc.register_namespace 'p', 'http://riddl.org/ns/common-patterns/properties/1.0'
|
325
|
-
doc.find('/p:value/*').each do |e|
|
326
|
-
send[e.qname.name] = CPEE::ValueHelper::parse(e.text)
|
327
|
-
end
|
328
|
-
end
|
329
|
-
Riddl::Client.new(cb).put Riddl::Parameter::Complex.new('dataelements','application/json',JSON::generate(send))
|
330
|
-
else
|
331
|
-
Riddl::Client.new(cb).put [
|
332
|
-
Riddl::Header.new('CPEE-UPDATE','true'),
|
333
|
-
Riddl::Parameter::Complex.new('dataelements','application/json',JSON::generate(send))
|
334
|
-
]
|
335
|
-
end
|
336
|
-
end
|
337
|
-
end #}}}
|
338
|
-
|
339
|
-
def self::implementation(opts)
|
340
|
-
opts[:cpee] ||= 'http://localhost:9298/'
|
341
|
-
opts[:self] ||= "http#{opts[:secure] ? 's' : ''}://#{opts[:host]}:#{opts[:port]}/"
|
342
|
-
opts[:cblist] = Redis.new(path: "/tmp/redis.sock", db: 14)
|
343
|
-
Proc.new do
|
344
|
-
on resource do
|
345
|
-
run InstantiateXML, opts[:cpee], true if post 'xmlsimple'
|
346
|
-
on resource 'xml' do
|
347
|
-
run InstantiateXML, opts[:cpee], false if post 'xml'
|
348
|
-
end
|
349
|
-
on resource 'url' do
|
350
|
-
run InstantiateUrl, opts[:cpee], opts[:self], opts[:cblist], false if post 'url'
|
351
|
-
run InstantiateUrl, opts[:cpee], opts[:self], opts[:cblist], true if post 'url_info'
|
352
|
-
end
|
353
|
-
on resource 'git' do
|
354
|
-
run InstantiateGit, opts[:cpee], opts[:self], opts[:cblist] if post 'git'
|
355
|
-
end
|
356
|
-
on resource 'instance' do
|
357
|
-
run HandleInstance, opts[:cpee] if post 'instance'
|
358
|
-
end
|
359
|
-
on resource 'callback' do
|
360
|
-
on resource do
|
361
|
-
run ContinueTask, opts[:cpee], opts[:cblist] if post
|
362
|
-
end
|
363
|
-
end
|
364
|
-
end
|
365
|
-
end
|
366
|
-
end
|
367
|
-
|
368
|
-
end
|
369
|
-
end
|