cpee 1.4.18 → 1.4.20

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.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/cockpit/testsets/Subprocess.xml +52 -0
  3. data/cockpit/testsets/Take_5.xml +44 -0
  4. data/cockpit/testsets/testsets.xml +1 -0
  5. data/cpee.gemspec +1 -1
  6. data/lib/cpee/controller.rb +7 -31
  7. data/lib/cpee/empty_workflow.rb +8 -4
  8. data/lib/cpee/implementation.rb +9 -1
  9. data/lib/cpee/instantiation.rb +40 -17
  10. data/lib/cpee/value_helper.rb +32 -0
  11. data/lib/engine.xml +1 -1
  12. data/log/display.rb +46 -0
  13. data/log/logs/27d46c68-d457-4ca8-808a-094585842aea.xes.yaml +130 -0
  14. data/log/logs/292ee7f7-fab8-438d-b251-5fc4d13b3d5b.xes.yaml +171 -0
  15. data/log/logs/546a855f-6223-49ed-bc7d-c256b391663b.xes.yaml +74 -0
  16. data/log/logs/5673f24b-5ac0-4bd6-b315-16992f02ddbb.xes.yaml +336 -0
  17. data/log/logs/7a4ad7e9-2fdb-41da-a623-094f5eaca9ce.xes.yaml +74 -0
  18. data/log/logs/7d24f231-44db-4d0b-8193-4601ede4591e.xes.yaml +167 -0
  19. data/log/logs/8abdeac5-a28a-4aad-9fad-e47e47f58f0a.xes.yaml +171 -0
  20. data/log/logs/a6ff458b-8e56-4411-a552-9b943ed69d6b.xes.yaml +128 -0
  21. data/log/logs/ccb051e7-639f-4b51-a1e3-3fd5a55f2c02.xes.yaml +128 -0
  22. data/log/logs/fbc5fa87-ba3c-40b9-9605-e1bb1cc7e0d9.xes.yaml +130 -0
  23. data/log/sic.rb +51 -0
  24. data/log/template.xes_yaml +3 -1
  25. data/log/xes_xml.rb +1 -1
  26. data/log/xes_yaml.pid +1 -0
  27. data/log/xes_yaml.rb +1 -1
  28. data/server/dev.rb +33 -0
  29. data/server/handlerwrappers/default.rb +5 -2
  30. data/server/{resources → instances/1}/notifications/ruleengine/consumer-secret +0 -0
  31. data/server/{resources → instances/1}/notifications/ruleengine/producer-secret +0 -0
  32. data/server/{resources → instances/1}/notifications/ruleengine/subscription.xml +0 -0
  33. data/server/instances/1/properties.xml +31 -0
  34. data/server/instances/10/notifications/1b735894fe9c3cc45308d1ed4cd6b930/consumer-secret +1 -0
  35. data/server/instances/10/notifications/1b735894fe9c3cc45308d1ed4cd6b930/producer-secret +1 -0
  36. data/server/instances/10/notifications/1b735894fe9c3cc45308d1ed4cd6b930/subscription.xml +5 -0
  37. data/server/instances/10/notifications/logging/consumer-secret +1 -0
  38. data/server/instances/10/notifications/logging/producer-secret +1 -0
  39. data/server/instances/10/notifications/logging/subscription.xml +16 -0
  40. data/server/instances/10/properties.xml +80 -0
  41. data/server/instances/11/notifications/logging/consumer-secret +1 -0
  42. data/server/instances/11/notifications/logging/producer-secret +1 -0
  43. data/server/instances/11/notifications/logging/subscription.xml +16 -0
  44. data/server/instances/11/properties.xml +97 -0
  45. data/server/instances/12/notifications/2678055be8f23525a98b5c031fe2ee46/consumer-secret +1 -0
  46. data/server/instances/12/notifications/2678055be8f23525a98b5c031fe2ee46/producer-secret +1 -0
  47. data/server/instances/12/notifications/2678055be8f23525a98b5c031fe2ee46/subscription.xml +5 -0
  48. data/server/instances/12/notifications/logging/consumer-secret +1 -0
  49. data/server/instances/12/notifications/logging/producer-secret +1 -0
  50. data/server/instances/12/notifications/logging/subscription.xml +16 -0
  51. data/server/instances/12/properties.xml +80 -0
  52. data/server/instances/13/notifications/90d34985542a88c3071d176f6400efe7/consumer-secret +1 -0
  53. data/server/instances/13/notifications/90d34985542a88c3071d176f6400efe7/producer-secret +1 -0
  54. data/server/instances/13/notifications/90d34985542a88c3071d176f6400efe7/subscription.xml +38 -0
  55. data/server/instances/13/notifications/logging/consumer-secret +1 -0
  56. data/server/instances/13/notifications/logging/producer-secret +1 -0
  57. data/server/instances/13/notifications/logging/subscription.xml +16 -0
  58. data/server/instances/13/properties.xml +97 -0
  59. data/server/instances/14/notifications/fa408cd6922b14cb1bfeee36e895f636/consumer-secret +1 -0
  60. data/server/instances/14/notifications/fa408cd6922b14cb1bfeee36e895f636/producer-secret +1 -0
  61. data/server/instances/14/notifications/fa408cd6922b14cb1bfeee36e895f636/subscription.xml +5 -0
  62. data/server/instances/14/notifications/logging/consumer-secret +1 -0
  63. data/server/instances/14/notifications/logging/producer-secret +1 -0
  64. data/server/instances/14/notifications/logging/subscription.xml +16 -0
  65. data/server/instances/14/properties.xml +80 -0
  66. data/server/instances/2/notifications/ruleengine/consumer-secret +1 -0
  67. data/server/instances/2/notifications/ruleengine/producer-secret +1 -0
  68. data/server/instances/2/notifications/ruleengine/subscription.xml +16 -0
  69. data/server/instances/2/properties.xml +31 -0
  70. data/server/instances/3/notifications/ruleengine/consumer-secret +1 -0
  71. data/server/instances/3/notifications/ruleengine/producer-secret +1 -0
  72. data/server/instances/3/notifications/ruleengine/subscription.xml +16 -0
  73. data/server/instances/3/properties.xml +31 -0
  74. data/server/instances/4/notifications/ruleengine/consumer-secret +1 -0
  75. data/server/instances/4/notifications/ruleengine/producer-secret +1 -0
  76. data/server/instances/4/notifications/ruleengine/subscription.xml +16 -0
  77. data/server/instances/4/properties.xml +31 -0
  78. data/server/instances/5/notifications/logging/consumer-secret +1 -0
  79. data/server/instances/5/notifications/logging/producer-secret +1 -0
  80. data/server/instances/5/notifications/logging/subscription.xml +16 -0
  81. data/server/instances/5/properties.xml +97 -0
  82. data/server/instances/6/notifications/ae6d58eba25c66a57b41181de8935442/consumer-secret +1 -0
  83. data/server/instances/6/notifications/ae6d58eba25c66a57b41181de8935442/producer-secret +1 -0
  84. data/server/instances/6/notifications/ae6d58eba25c66a57b41181de8935442/subscription.xml +5 -0
  85. data/server/instances/6/notifications/logging/consumer-secret +1 -0
  86. data/server/instances/6/notifications/logging/producer-secret +1 -0
  87. data/server/instances/6/notifications/logging/subscription.xml +16 -0
  88. data/server/instances/6/properties.xml +78 -0
  89. data/server/instances/7/notifications/d83173e3a3f5d1e05f5182042d5b627e/consumer-secret +1 -0
  90. data/server/instances/7/notifications/d83173e3a3f5d1e05f5182042d5b627e/producer-secret +1 -0
  91. data/server/instances/7/notifications/d83173e3a3f5d1e05f5182042d5b627e/subscription.xml +5 -0
  92. data/server/instances/7/notifications/logging/consumer-secret +1 -0
  93. data/server/instances/7/notifications/logging/producer-secret +1 -0
  94. data/server/instances/7/notifications/logging/subscription.xml +16 -0
  95. data/server/instances/7/properties.xml +78 -0
  96. data/server/instances/8/notifications/d6eb404431e5643fdbcf3a3ead0bdec5/consumer-secret +1 -0
  97. data/server/instances/8/notifications/d6eb404431e5643fdbcf3a3ead0bdec5/producer-secret +1 -0
  98. data/server/instances/8/notifications/d6eb404431e5643fdbcf3a3ead0bdec5/subscription.xml +5 -0
  99. data/server/instances/8/notifications/logging/consumer-secret +1 -0
  100. data/server/instances/8/notifications/logging/producer-secret +1 -0
  101. data/server/instances/8/notifications/logging/subscription.xml +16 -0
  102. data/server/instances/8/properties.xml +80 -0
  103. data/server/instances/9/notifications/e242ccf30f3878511aaf390e20e42d5d/consumer-secret +1 -0
  104. data/server/instances/9/notifications/e242ccf30f3878511aaf390e20e42d5d/producer-secret +1 -0
  105. data/server/instances/9/notifications/e242ccf30f3878511aaf390e20e42d5d/subscription.xml +38 -0
  106. data/server/instances/9/notifications/logging/consumer-secret +1 -0
  107. data/server/instances/9/notifications/logging/producer-secret +1 -0
  108. data/server/instances/9/notifications/logging/subscription.xml +16 -0
  109. data/server/instances/9/properties.xml +97 -0
  110. data/server/resources/notifications/logging/consumer-secret +1 -0
  111. data/server/resources/notifications/logging/producer-secret +1 -0
  112. data/server/resources/notifications/logging/subscription.xml +16 -0
  113. data/server/resources/transformation_dslx.xsl +2 -2
  114. data/server/server.pid +1 -0
  115. data/tools/cpee +22 -8
  116. metadata +103 -5
@@ -0,0 +1,128 @@
1
+ ---
2
+ log:
3
+ extension:
4
+ time: http://www.xes-standard.org/time.xesext
5
+ concept: http://www.xes-standard.org/concept.xesext
6
+ organisational: http://www.xes-standard.org/org.xesext
7
+ lifecycle: http://www.xes-standard.org/lifecycle.xesext
8
+ cpee: http://cpee.org/cpee.xesext
9
+ global:
10
+ trace:
11
+ concept:name: __INVALID__
12
+ cpee:name: __INVALID__
13
+ event:
14
+ concept:name: __INVALID__
15
+ concept:endpoint: ''
16
+ id:id: ''
17
+ lifecycle:transition: complete
18
+ cpee:lifecycle:transition: activity/calling
19
+ time:timestamp: ''
20
+ classifier:
21
+ Data: data_send data_received data_changed data_values
22
+ Data_Received: data_receiver
23
+ Data_Send: data_send
24
+ Data_Changed: data_changer
25
+ Data_Values: data_values
26
+ trace:
27
+ concept:name: '8'
28
+ cpee:name: Take Time
29
+ cpee:uuid: ccb051e7-639f-4b51-a1e3-3fd5a55f2c02
30
+ ---
31
+ event:
32
+ trace:id: '8'
33
+ concept:name: external
34
+ id:id: external
35
+ cpee:uuid: ccb051e7-639f-4b51-a1e3-3fd5a55f2c02
36
+ lifecycle:transition: unknown
37
+ cpee:lifecycle:transition: endpoints/change
38
+ list:
39
+ data_changer:
40
+ - timeout
41
+ data_values:
42
+ timeout: http://gruppe.wst.univie.ac.at/~mangler/services/timeout.php
43
+ time:timestamp: '2019-02-12T22:59:47.469+01:00'
44
+ ---
45
+ event:
46
+ trace:id: '8'
47
+ concept:name: external
48
+ id:id: external
49
+ cpee:uuid: ccb051e7-639f-4b51-a1e3-3fd5a55f2c02
50
+ lifecycle:transition: unknown
51
+ cpee:lifecycle:transition: dataelements/change
52
+ time:timestamp: '2019-02-12T22:59:47.482+01:00'
53
+ ---
54
+ event:
55
+ trace:id: '8'
56
+ concept:name: external
57
+ id:id: external
58
+ cpee:uuid: ccb051e7-639f-4b51-a1e3-3fd5a55f2c02
59
+ lifecycle:transition: unknown
60
+ cpee:lifecycle:transition: attributes/change
61
+ list:
62
+ data_changer:
63
+ - info
64
+ - modeltype
65
+ - theme
66
+ - customer
67
+ - status
68
+ data_values:
69
+ info: Take Time
70
+ modeltype: CPEE
71
+ theme: default
72
+ customer: pilotfabrik
73
+ status: development
74
+ time:timestamp: '2019-02-12T22:59:47.491+01:00'
75
+ ---
76
+ event:
77
+ trace:id: '8'
78
+ concept:name: ''
79
+ concept:endpoint: http://gruppe.wst.univie.ac.at/~mangler/services/timeout.php
80
+ id:id: a1
81
+ cpee:uuid: ccb051e7-639f-4b51-a1e3-3fd5a55f2c02
82
+ lifecycle:transition: start
83
+ cpee:lifecycle:transition: activity/calling
84
+ list:
85
+ data_send:
86
+ - name: timeout
87
+ value: '5'
88
+ time:timestamp: '2019-02-12T22:59:48.251+01:00'
89
+ ---
90
+ event:
91
+ trace:id: '8'
92
+ concept:name: ''
93
+ concept:endpoint: http://gruppe.wst.univie.ac.at/~mangler/services/timeout.php
94
+ id:id: a1
95
+ cpee:uuid: ccb051e7-639f-4b51-a1e3-3fd5a55f2c02
96
+ lifecycle:transition: unknown
97
+ cpee:lifecycle:transition: activity/receiving
98
+ list:
99
+ data_receiver:
100
+ - name: result
101
+ mimetype: text/html
102
+ data: 'Timeout: 5'
103
+ time:timestamp: '2019-02-12T22:59:53.315+01:00'
104
+ ---
105
+ event:
106
+ trace:id: '8'
107
+ concept:name: ''
108
+ concept:endpoint: http://gruppe.wst.univie.ac.at/~mangler/services/timeout.php
109
+ id:id: a1
110
+ cpee:uuid: ccb051e7-639f-4b51-a1e3-3fd5a55f2c02
111
+ lifecycle:transition: complete
112
+ cpee:lifecycle:transition: activity/done
113
+ time:timestamp: '2019-02-12T22:59:53.336+01:00'
114
+ ---
115
+ event:
116
+ trace:id: '8'
117
+ concept:name: ''
118
+ concept:endpoint: http://gruppe.wst.univie.ac.at/~mangler/services/timeout.php
119
+ id:id: a1
120
+ cpee:uuid: ccb051e7-639f-4b51-a1e3-3fd5a55f2c02
121
+ lifecycle:transition: unknown
122
+ cpee:lifecycle:transition: dataelements/change
123
+ list:
124
+ data_changer:
125
+ - a
126
+ data_values:
127
+ a: 17
128
+ time:timestamp: '2019-02-12T22:59:53.348+01:00'
@@ -0,0 +1,130 @@
1
+ ---
2
+ log:
3
+ extension:
4
+ time: http://www.xes-standard.org/time.xesext
5
+ concept: http://www.xes-standard.org/concept.xesext
6
+ organisational: http://www.xes-standard.org/org.xesext
7
+ lifecycle: http://www.xes-standard.org/lifecycle.xesext
8
+ cpee: http://cpee.org/cpee.xesext
9
+ global:
10
+ trace:
11
+ concept:name: __INVALID__
12
+ cpee:name: __INVALID__
13
+ event:
14
+ trace:id: -1
15
+ concept:name: __INVALID__
16
+ concept:endpoint: ''
17
+ id:id: ''
18
+ cpee:uuid: ''
19
+ lifecycle:transition: complete
20
+ cpee:lifecycle:transition: activity/calling
21
+ time:timestamp: ''
22
+ classifier:
23
+ Data: data_send data_received data_changed data_values
24
+ Data_Received: data_receiver
25
+ Data_Send: data_send
26
+ Data_Changed: data_changer
27
+ Data_Values: data_values
28
+ trace:
29
+ concept:name: '12'
30
+ cpee:name: Take Time
31
+ cpee:uuid: fbc5fa87-ba3c-40b9-9605-e1bb1cc7e0d9
32
+ ---
33
+ event:
34
+ trace:id: '12'
35
+ concept:name: external
36
+ id:id: external
37
+ cpee:uuid: fbc5fa87-ba3c-40b9-9605-e1bb1cc7e0d9
38
+ lifecycle:transition: unknown
39
+ cpee:lifecycle:transition: dataelements/change
40
+ time:timestamp: '2019-02-12T23:14:08.020+01:00'
41
+ ---
42
+ event:
43
+ trace:id: '12'
44
+ concept:name: external
45
+ id:id: external
46
+ cpee:uuid: fbc5fa87-ba3c-40b9-9605-e1bb1cc7e0d9
47
+ lifecycle:transition: unknown
48
+ cpee:lifecycle:transition: endpoints/change
49
+ list:
50
+ data_changer:
51
+ - timeout
52
+ data_values:
53
+ timeout: http://gruppe.wst.univie.ac.at/~mangler/services/timeout.php
54
+ time:timestamp: '2019-02-12T23:14:08.033+01:00'
55
+ ---
56
+ event:
57
+ trace:id: '12'
58
+ concept:name: external
59
+ id:id: external
60
+ cpee:uuid: fbc5fa87-ba3c-40b9-9605-e1bb1cc7e0d9
61
+ lifecycle:transition: unknown
62
+ cpee:lifecycle:transition: attributes/change
63
+ list:
64
+ data_changer:
65
+ - info
66
+ - modeltype
67
+ - theme
68
+ - customer
69
+ - status
70
+ data_values:
71
+ info: Take Time
72
+ modeltype: CPEE
73
+ theme: default
74
+ customer: pilotfabrik
75
+ status: development
76
+ time:timestamp: '2019-02-12T23:14:08.057+01:00'
77
+ ---
78
+ event:
79
+ trace:id: '12'
80
+ concept:name: ''
81
+ concept:endpoint: http://gruppe.wst.univie.ac.at/~mangler/services/timeout.php
82
+ id:id: a1
83
+ cpee:uuid: fbc5fa87-ba3c-40b9-9605-e1bb1cc7e0d9
84
+ lifecycle:transition: start
85
+ cpee:lifecycle:transition: activity/calling
86
+ list:
87
+ data_send:
88
+ - name: timeout
89
+ value: '5'
90
+ time:timestamp: '2019-02-12T23:14:08.835+01:00'
91
+ ---
92
+ event:
93
+ trace:id: '12'
94
+ concept:name: ''
95
+ concept:endpoint: http://gruppe.wst.univie.ac.at/~mangler/services/timeout.php
96
+ id:id: a1
97
+ cpee:uuid: fbc5fa87-ba3c-40b9-9605-e1bb1cc7e0d9
98
+ lifecycle:transition: unknown
99
+ cpee:lifecycle:transition: activity/receiving
100
+ list:
101
+ data_receiver:
102
+ - name: result
103
+ mimetype: text/html
104
+ data: 'Timeout: 5'
105
+ time:timestamp: '2019-02-12T23:14:13.846+01:00'
106
+ ---
107
+ event:
108
+ trace:id: '12'
109
+ concept:name: ''
110
+ concept:endpoint: http://gruppe.wst.univie.ac.at/~mangler/services/timeout.php
111
+ id:id: a1
112
+ cpee:uuid: fbc5fa87-ba3c-40b9-9605-e1bb1cc7e0d9
113
+ lifecycle:transition: complete
114
+ cpee:lifecycle:transition: activity/done
115
+ time:timestamp: '2019-02-12T23:14:13.867+01:00'
116
+ ---
117
+ event:
118
+ trace:id: '12'
119
+ concept:name: ''
120
+ concept:endpoint: http://gruppe.wst.univie.ac.at/~mangler/services/timeout.php
121
+ id:id: a1
122
+ cpee:uuid: fbc5fa87-ba3c-40b9-9605-e1bb1cc7e0d9
123
+ lifecycle:transition: unknown
124
+ cpee:lifecycle:transition: dataelements/change
125
+ list:
126
+ data_changer:
127
+ - a
128
+ data_values:
129
+ a: 17
130
+ time:timestamp: '2019-02-12T23:14:13.879+01:00'
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/ruby
2
+ require 'yaml'
3
+ require 'typhoeus'
4
+ require 'xml/smart'
5
+
6
+ # concept:endpoint: https://centurio.work/flow/start/url/
7
+ # id:id: a17
8
+ # cpee:uuid: bf93adcd-9421-495b-bafa-d34de608fc6c
9
+ # lifecycle:transition: unknown
10
+ # cpee:lifecycle:transition: activity/receiving
11
+ # list:
12
+ # data_receiver:
13
+ # - name: dataelements
14
+ # mimetype: application/json
15
+ # data:
16
+ # CPEE-INSTANCE: https://centurio.work/flow/engine/547
17
+ # qr: "*269MFA466*TZHZE 000"
18
+ # queue: ''
19
+ # machine: MaxxTurn45
20
+ # program: _N_LOWERHOUSING2_MPF
21
+ # label: Lowerhousing Turn 2
22
+ # finished: no good
23
+ # time:timestamp: '2019-01-16T11:24:41.162+01:00'
24
+
25
+ def follow(fname,deep=0)
26
+ io = File.open(fname)
27
+ YAML.load_stream(io) do |e|
28
+ if name = e.dig('log','trace','cpee:name')
29
+ FileUtils.cp(File.join(__dir__,'logs',File.basename(fname,'.xes.yaml') + '.xes.yaml'),'.') if ARGV[1] == 'copy'
30
+ puts " " * deep + name + " (#{File.basename(fname,'.xes.yaml')})"
31
+ end
32
+ if e.dig('event','concept:endpoint') == 'https://centurio.work/flow/start/url/' && e.dig('event','cpee:lifecycle:transition') == 'activity/receiving'
33
+ val = e.dig('event','list','data_receiver',0,'data','CPEE-INSTANCE')
34
+ res = Typhoeus.get(File.join(val,'/properties/values/attributes/uuid/'))
35
+ if res.success?
36
+ uuid = XML::Smart.string(res.body).find('string(/*)')
37
+ follow File.dirname(fname) + "/#{uuid}.xes.yaml",deep + 2
38
+ end
39
+ end
40
+ end
41
+ end
42
+
43
+ fname = File.join(__dir__,'logs',(ARGV[0].strip rescue '') + '.xes.yaml')
44
+ if File.exists? fname
45
+ follow fname
46
+ else
47
+ puts 'Copies log files tree to current directory.'
48
+ puts
49
+ puts ' Example: sic.rb UUID'
50
+ puts ' Example: sic.rb UUID copy'
51
+ end
@@ -11,11 +11,13 @@ log:
11
11
  concept:name: __INVALID__
12
12
  cpee:name: __INVALID__
13
13
  event:
14
+ trace:id: -1
14
15
  concept:name: __INVALID__
15
16
  concept:endpoint: ''
16
17
  id:id: ''
18
+ cpee:uuid: ''
17
19
  lifecycle:transition: complete
18
- cpee:lifecycle:transition: activity/call
20
+ cpee:lifecycle:transition: activity/calling
19
21
  time:timestamp: ''
20
22
  classifier:
21
23
  Data: data_send data_received data_changed data_values
@@ -99,7 +99,7 @@ class Logging < Riddl::Implementation #{{{
99
99
  topic = @p[1].value
100
100
  event_name = @p[2].value
101
101
  log_dir = @a[0]
102
- instancenr = @h['CPEE_INSTANCE'].split('/').last
102
+ instancenr = @h['CPEE_INSTANCE_URL'].split('/').last
103
103
  notification = JSON.parse(@p[3].value)
104
104
  doc(event_name,log_dir,instancenr,notification)
105
105
  end
@@ -0,0 +1 @@
1
+ 27395
@@ -73,7 +73,7 @@ class Logging < Riddl::Implementation #{{{
73
73
  event_name = @p[2].value
74
74
  log_dir = @a[0]
75
75
  template = @a[1]
76
- instancenr = @h['CPEE_INSTANCE'].split('/').last
76
+ instancenr = @h['CPEE_INSTANCE_URL'].split('/').last
77
77
  notification = JSON.parse(@p[3].value)
78
78
  doc topic, event_name, log_dir, template, instancenr, notification
79
79
  end
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/ruby
2
+ #
3
+ # This file is part of CPEE.
4
+ #
5
+ # CPEE is free software: you can redistribute it and/or modify it under the terms
6
+ # of the GNU General Public License as published by the Free Software Foundation,
7
+ # either version 3 of the License, or (at your option) any later version.
8
+ #
9
+ # CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
10
+ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11
+ # PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU General Public License along with
14
+ # CPEE (file COPYING in the main directory). If not, see
15
+ # <http://www.gnu.org/licenses/>.
16
+
17
+ module CPEE
18
+ module DEVELOP
19
+ RIDDL = "/home/mangler/Projects/riddl/lib/ruby"
20
+ WEEL = "/home/mangler/Projects/weel/lib/"
21
+ end
22
+ end
23
+
24
+ require 'rubygems'
25
+ gem 'nokogiri'
26
+ require File.expand_path(File.dirname(__FILE__) + '/../lib/cpee/implementation')
27
+
28
+ Riddl::Server.new(CPEE::SERVER, :port => 8298) do |opts|
29
+ accessible_description true
30
+ cross_site_xhr true
31
+
32
+ use CPEE::implementation(opts)
33
+ end.loop!
@@ -50,7 +50,7 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
50
50
  @label = parameters[:label]
51
51
  @sensors = parameters[:sensors]
52
52
  @controller.notify("activity/calling", :instance => @controller.instance, :instance_uuid => @controller.uuid, :label => @label, :instance_name => @controller.info, :activity => @handler_position, :passthrough => passthrough, :endpoint => @handler_endpoint, :parameters => parameters, :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"), :attributes => @controller.attributes_translated)
53
- if passthrough.nil?
53
+ if passthrough.to_s.empty?
54
54
  params = []
55
55
  callback = Digest::MD5.hexdigest(Kernel::rand().to_s)
56
56
  (parameters[:arguments] || []).each do |s|
@@ -62,7 +62,9 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
62
62
  end
63
63
 
64
64
  params << Riddl::Header.new("CPEE-BASE",@controller.base_url)
65
- params << Riddl::Header.new("CPEE-INSTANCE",@controller.instance_url)
65
+ params << Riddl::Header.new("CPEE-INSTANCE",@controller.instance)
66
+ params << Riddl::Header.new("CPEE-INSTANCE-URL",@controller.instance_url)
67
+ params << Riddl::Header.new("CPEE-INSTANCE-UUID",@controller.uuid)
66
68
  params << Riddl::Header.new("CPEE-CALLBACK",@controller.instance_url + '/callbacks/' + callback)
67
69
  params << Riddl::Header.new("CPEE-CALLBACK-ID",callback)
68
70
  params << Riddl::Header.new("CPEE-ACTIVITY",@handler_position)
@@ -82,6 +84,7 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
82
84
  @handler_passthrough = callback
83
85
 
84
86
  status, result, headers = client.request type => params
87
+
85
88
  raise "Could not #{parameters[:method] || 'post'} #{@handler_endpoint} - status: #{status}: #{result&.dig(0)&.value&.read}" if status < 200 || status >= 300
86
89
 
87
90
  unless headers["CPEE_CALLBACK"] && headers["CPEE_CALLBACK"] == 'true'
@@ -0,0 +1,31 @@
1
+ <properties xmlns="http://riddl.org/ns/common-patterns/properties/1.0">
2
+ <attributes>
3
+ <uuid>8504eda1-b832-480c-8e77-c4b7610b18dc</uuid>
4
+ <info/>
5
+ <modeltype>CPEE</modeltype>
6
+ <theme>default</theme>
7
+ </attributes>
8
+ <state>ready</state>
9
+ <handlerwrapper>DefaultHandlerWrapper</handlerwrapper>
10
+ <positions/>
11
+ <dataelements/>
12
+ <endpoints>
13
+ <timeout>http://gruppe.wst.univie.ac.at/~mangler/services/timeout.php</timeout>
14
+ </endpoints>
15
+ <dsl/>
16
+ <dslx>
17
+ <description xmlns="http://cpee.org/ns/description/1.0"/>
18
+ </dslx>
19
+ <status>
20
+ <id>0</id>
21
+ <message>undefined</message>
22
+ </status>
23
+ <description>
24
+ <description xmlns="http://cpee.org/ns/description/1.0"/>
25
+ </description>
26
+ <transformation>
27
+ <description type="copy"/>
28
+ <dataelements type="none"/>
29
+ <endpoints type="none"/>
30
+ </transformation>
31
+ </properties>