cpee 2.1.134 → 2.1.136
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/README.md +1 -1
- data/cockpit/compliance-view.html +12 -13
- data/cockpit/compliance.html +12 -13
- data/cockpit/css/llm.css +3 -3
- data/cockpit/css/llmmodel.css +140 -0
- data/cockpit/css/model.css +0 -1
- data/cockpit/css/ui.css +13 -7
- data/cockpit/css/wfadaptor.css +15 -10
- data/cockpit/edit.html +17 -13
- data/cockpit/graph.html +8 -8
- data/cockpit/index.html +12 -13
- data/cockpit/js/build-bpmn2.js +302 -0
- data/cockpit/js/details.js +27 -10
- data/cockpit/js/instance.js +193 -203
- data/cockpit/js/llm-ui-bubble.js +36 -0
- data/cockpit/js/llm-ui-status.js +34 -0
- data/cockpit/js/llm-ui.js +87 -0
- data/cockpit/js/llm.js +463 -118
- data/cockpit/js/parameters.js +45 -14
- data/cockpit/js/wfadaptor.js +394 -75
- data/cockpit/llm.html +17 -15
- data/cockpit/llmmodel.html +18 -17
- data/cockpit/model.html +9 -9
- data/cockpit/only_llm.html +15 -13
- data/cockpit/themes/base.js +1 -1
- data/cockpit/themes/packed/theme.js +3 -0
- data/cockpit/themes/presetlr/rngs/alternative.rng +28 -0
- data/cockpit/themes/presetlr/rngs/call.rng +249 -0
- data/cockpit/themes/presetlr/rngs/callmanipulate.rng +281 -0
- data/cockpit/themes/presetlr/rngs/choose.rng +27 -0
- data/cockpit/themes/presetlr/rngs/closed_loop.rng +62 -0
- data/cockpit/themes/presetlr/rngs/closed_loop_cancel.rng +5 -0
- data/cockpit/themes/presetlr/rngs/closed_loop_control.rng +31 -0
- data/cockpit/themes/presetlr/rngs/closed_loop_measuring.rng +12 -0
- data/cockpit/themes/presetlr/rngs/critical.rng +8 -0
- data/cockpit/themes/presetlr/rngs/escape.rng +5 -0
- data/cockpit/themes/presetlr/rngs/group.rng +3 -0
- data/cockpit/themes/presetlr/rngs/loop.rng +40 -0
- data/cockpit/themes/presetlr/rngs/manipulate.rng +76 -0
- data/cockpit/themes/presetlr/rngs/otherwise.rng +25 -0
- data/cockpit/themes/presetlr/rngs/parallel.rng +24 -0
- data/cockpit/themes/presetlr/rngs/parallel_branch.rng +5 -0
- data/cockpit/themes/presetlr/rngs/scripts.rng +23 -0
- data/cockpit/themes/presetlr/rngs/start.rng +143 -0
- data/cockpit/themes/presetlr/rngs/stop.rng +5 -0
- data/cockpit/themes/presetlr/rngs/terminate.rng +8 -0
- data/cockpit/themes/presetlr/rngs/wait_for_signal.rng +8 -0
- data/cockpit/themes/presetlr/symbols/alternative.svg +19 -0
- data/cockpit/themes/presetlr/symbols/arrow.svg +1 -0
- data/cockpit/themes/presetlr/symbols/call.svg +1 -0
- data/cockpit/themes/presetlr/symbols/call_sensor.svg +1 -0
- data/cockpit/themes/presetlr/symbols/callmanipulate.svg +1 -0
- data/cockpit/themes/presetlr/symbols/callmanipulate_sensor.svg +1 -0
- data/cockpit/themes/presetlr/symbols/callmanipulate_sensor_signal.svg +1 -0
- data/cockpit/themes/presetlr/symbols/callmanipulate_signal.svg +1 -0
- data/cockpit/themes/presetlr/symbols/choose.svg +15 -0
- data/cockpit/themes/presetlr/symbols/choose_exclusive.svg +15 -0
- data/cockpit/themes/presetlr/symbols/choose_exclusive_finish.svg +1 -0
- data/cockpit/themes/presetlr/symbols/choose_inclusive.svg +13 -0
- data/cockpit/themes/presetlr/symbols/choose_inclusive_finish.svg +1 -0
- data/cockpit/themes/presetlr/symbols/closed_loop.svg +1 -0
- data/cockpit/themes/presetlr/symbols/closed_loop_cancel.svg +1 -0
- data/cockpit/themes/presetlr/symbols/closed_loop_control.svg +1 -0
- data/cockpit/themes/presetlr/symbols/closed_loop_measuring.svg +1 -0
- data/cockpit/themes/presetlr/symbols/complex.svg +1 -0
- data/cockpit/themes/presetlr/symbols/critical.svg +1 -0
- data/cockpit/themes/presetlr/symbols/delete.svg +1 -0
- data/cockpit/themes/presetlr/symbols/end.svg +1 -0
- data/cockpit/themes/presetlr/symbols/escape.svg +1 -0
- data/cockpit/themes/presetlr/symbols/event_end.svg +1 -0
- data/cockpit/themes/presetlr/symbols/event_start.svg +1 -0
- data/cockpit/themes/presetlr/symbols/loop.svg +15 -0
- data/cockpit/themes/presetlr/symbols/loop_end.svg +15 -0
- data/cockpit/themes/presetlr/symbols/loop_end_pre.svg +15 -0
- data/cockpit/themes/presetlr/symbols/manipulate.svg +1 -0
- data/cockpit/themes/presetlr/symbols/mark.svg +1 -0
- data/cockpit/themes/presetlr/symbols/otherwise.svg +7 -0
- data/cockpit/themes/presetlr/symbols/parallel.svg +1 -0
- data/cockpit/themes/presetlr/symbols/parallel_branch.svg +7 -0
- data/cockpit/themes/presetlr/symbols/parallel_branch_event.svg +14 -0
- data/cockpit/themes/presetlr/symbols/parallel_branch_event_rev.svg +11 -0
- data/cockpit/themes/presetlr/symbols/parallel_branch_normal.svg +7 -0
- data/cockpit/themes/presetlr/symbols/parallel_eventbased_exclusive.svg +1 -0
- data/cockpit/themes/presetlr/symbols/parallel_eventbased_parallel.svg +1 -0
- data/cockpit/themes/presetlr/symbols/scripts.svg +1 -0
- data/cockpit/themes/presetlr/symbols/start.svg +1 -0
- data/cockpit/themes/presetlr/symbols/start_event.svg +1 -0
- data/cockpit/themes/presetlr/symbols/stop.svg +1 -0
- data/cockpit/themes/presetlr/symbols/terminate.svg +1 -0
- data/cockpit/themes/presetlr/symbols/wait_for_signal.svg +1 -0
- data/cockpit/themes/presetlr/theme.js +54 -0
- data/cockpit/themes/wellformed/rngs/alternative.rng +28 -0
- data/cockpit/themes/wellformed/rngs/call.rng +249 -0
- data/cockpit/themes/wellformed/rngs/callmanipulate.rng +281 -0
- data/cockpit/themes/wellformed/rngs/choose.rng +27 -0
- data/cockpit/themes/wellformed/rngs/closed_loop.rng +62 -0
- data/cockpit/themes/wellformed/rngs/closed_loop_cancel.rng +5 -0
- data/cockpit/themes/wellformed/rngs/closed_loop_control.rng +31 -0
- data/cockpit/themes/wellformed/rngs/closed_loop_measuring.rng +12 -0
- data/cockpit/themes/wellformed/rngs/critical.rng +8 -0
- data/cockpit/themes/wellformed/rngs/escape.rng +5 -0
- data/cockpit/themes/wellformed/rngs/group.rng +3 -0
- data/cockpit/themes/wellformed/rngs/loop.rng +40 -0
- data/cockpit/themes/wellformed/rngs/manipulate.rng +76 -0
- data/cockpit/themes/wellformed/rngs/otherwise.rng +25 -0
- data/cockpit/themes/wellformed/rngs/parallel.rng +24 -0
- data/cockpit/themes/wellformed/rngs/parallel_branch.rng +5 -0
- data/cockpit/themes/wellformed/rngs/scripts.rng +23 -0
- data/cockpit/themes/wellformed/rngs/start.rng +143 -0
- data/cockpit/themes/wellformed/rngs/stop.rng +5 -0
- data/cockpit/themes/wellformed/rngs/terminate.rng +8 -0
- data/cockpit/themes/wellformed/rngs/wait_for_signal.rng +8 -0
- data/cockpit/themes/wellformed/symbols/alternative.svg +1 -0
- data/cockpit/themes/wellformed/symbols/arrow.svg +1 -0
- data/cockpit/themes/wellformed/symbols/call.svg +1 -0
- data/cockpit/themes/wellformed/symbols/call_sensor.svg +1 -0
- data/cockpit/themes/wellformed/symbols/callmanipulate.svg +1 -0
- data/cockpit/themes/wellformed/symbols/callmanipulate_sensor.svg +1 -0
- data/cockpit/themes/wellformed/symbols/callmanipulate_sensor_signal.svg +1 -0
- data/cockpit/themes/wellformed/symbols/callmanipulate_signal.svg +1 -0
- data/cockpit/themes/wellformed/symbols/choose.svg +1 -0
- data/cockpit/themes/wellformed/symbols/choose_exclusive.svg +1 -0
- data/cockpit/themes/wellformed/symbols/choose_exclusive_finish.svg +1 -0
- data/cockpit/themes/wellformed/symbols/choose_inclusive.svg +1 -0
- data/cockpit/themes/wellformed/symbols/choose_inclusive_finish.svg +1 -0
- data/cockpit/themes/wellformed/symbols/closed_loop.svg +1 -0
- data/cockpit/themes/wellformed/symbols/closed_loop_cancel.svg +1 -0
- data/cockpit/themes/wellformed/symbols/closed_loop_control.svg +1 -0
- data/cockpit/themes/wellformed/symbols/closed_loop_measuring.svg +1 -0
- data/cockpit/themes/wellformed/symbols/complex.svg +1 -0
- data/cockpit/themes/wellformed/symbols/critical.svg +1 -0
- data/cockpit/themes/wellformed/symbols/delete.svg +1 -0
- data/cockpit/themes/wellformed/symbols/end.svg +1 -0
- data/cockpit/themes/wellformed/symbols/escape.svg +1 -0
- data/cockpit/themes/wellformed/symbols/event_end.svg +1 -0
- data/cockpit/themes/wellformed/symbols/event_start.svg +6 -0
- data/cockpit/themes/wellformed/symbols/loop.svg +1 -0
- data/cockpit/themes/wellformed/symbols/loop_end.svg +1 -0
- data/cockpit/themes/wellformed/symbols/manipulate.svg +1 -0
- data/cockpit/themes/wellformed/symbols/mark.svg +1 -0
- data/cockpit/themes/wellformed/symbols/otherwise.svg +1 -0
- data/cockpit/themes/wellformed/symbols/parallel.svg +1 -0
- data/cockpit/themes/wellformed/symbols/parallel_branch.svg +1 -0
- data/cockpit/themes/wellformed/symbols/parallel_branch_event.svg +1 -0
- data/cockpit/themes/wellformed/symbols/parallel_branch_event_rev.svg +11 -0
- data/cockpit/themes/wellformed/symbols/parallel_branch_normal.svg +1 -0
- data/cockpit/themes/wellformed/symbols/parallel_eventbased_exclusive.svg +1 -0
- data/cockpit/themes/wellformed/symbols/parallel_eventbased_parallel.svg +1 -0
- data/cockpit/themes/wellformed/symbols/scripts.svg +1 -0
- data/cockpit/themes/wellformed/symbols/start.svg +1 -0
- data/cockpit/themes/wellformed/symbols/start_event.svg +1 -0
- data/cockpit/themes/wellformed/symbols/stop.svg +1 -0
- data/cockpit/themes/wellformed/symbols/terminate.svg +1 -0
- data/cockpit/themes/wellformed/symbols/wait_for_signal.svg +1 -0
- data/cockpit/themes/wellformed/theme.js +32 -0
- data/cockpit/track.html +8 -8
- data/cpee.gemspec +2 -2
- data/lib/callbacks/callbacks.rng +4 -4
- data/lib/callbacks.xml +4 -4
- data/lib/cpee/constants.rb +4 -4
- data/lib/cpee/fail.rb +4 -4
- data/lib/cpee/implementation.rb +5 -4
- data/lib/cpee/implementation_callbacks.rb +4 -4
- data/lib/cpee/implementation_notifications.rb +4 -4
- data/lib/cpee/implementation_properties.rb +108 -12
- data/lib/cpee/message.rb +4 -4
- data/lib/cpee/persistence.rb +6 -4
- data/lib/cpee/redis.rb +4 -4
- data/lib/cpee/statemachine.rb +4 -4
- data/lib/cpee/value_helper.rb +4 -4
- data/lib/cpee.xml +4 -4
- data/lib/engine/executionhandler-list.rng +4 -4
- data/lib/engine/instance-info.rng +4 -4
- data/lib/engine/instances.rng +4 -4
- data/lib/engine.xml +4 -4
- data/lib/properties/t_dslx.rng +346 -0
- data/lib/properties/transformation.rng +14 -0
- data/lib/properties.xml +5 -4
- data/server/executionhandlers/eval/backend/opts.yaml +1 -1
- data/server/executionhandlers/eval/connection.rb +4 -4
- data/server/executionhandlers/eval/execution.rb +4 -4
- data/server/executionhandlers/ruby/backend/opts.yaml +1 -1
- data/server/executionhandlers/ruby/connection.rb +5 -6
- data/server/executionhandlers/ruby/controller.rb +4 -4
- data/server/executionhandlers/ruby/dsl_to_dslx.xsl +6 -2
- data/server/executionhandlers/ruby/execution.rb +4 -4
- data/server/resources/properties.empty +5 -4
- data/server/resources/properties.init +5 -4
- data/server/resources/topics.xml +4 -4
- data/server/routing/end.pid +1 -0
- data/server/routing/end.rb +4 -4
- data/server/routing/forward-events-00.pid +1 -0
- data/server/routing/forward-events.rb +4 -4
- data/server/routing/forward-votes.pid +1 -0
- data/server/routing/forward-votes.rb +4 -4
- data/server/routing/persist.pid +1 -0
- data/server/routing/persist.rb +6 -4
- data/tools/server/cpee +1 -1
- data/tools/server/resources/properties.init +4 -4
- metadata +140 -5
- data/cockpit/CPEE.xml +0 -8
- data/cockpit/Signavio.xml +0 -8
- data/cockpit/transformations.xml +0 -4
- /data/{COPYING → LICENSE} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# This file is part of CPEE.
|
|
2
2
|
#
|
|
3
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,
|
|
4
|
+
# of the GNU Lesser General Public License as published by the Free Software Foundation,
|
|
5
5
|
# either version 3 of the License, or (at your option) any later version.
|
|
6
6
|
#
|
|
7
7
|
# CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
8
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.
|
|
9
|
+
# PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
|
10
10
|
#
|
|
11
|
-
# You should have received a copy of the GNU General Public License along with
|
|
12
|
-
# CPEE (file
|
|
11
|
+
# You should have received a copy of the GNU Lesser General Public License along with
|
|
12
|
+
# CPEE (file LICENSE in the main directory). If not, see
|
|
13
13
|
# <http://www.gnu.org/licenses/>.
|
|
14
14
|
|
|
15
15
|
require_relative 'fail'
|
|
@@ -139,6 +139,8 @@ module CPEE
|
|
|
139
139
|
doc.find('/p:properties/p:transformation/p:description/@type').first.text = CPEE::Persistence::extract_item(id,opts,'transformation/description/@type')
|
|
140
140
|
doc.find('/p:properties/p:transformation/p:dataelements/@type').first.text = CPEE::Persistence::extract_item(id,opts,'transformation/dataelements/@type')
|
|
141
141
|
doc.find('/p:properties/p:transformation/p:endpoints/@type').first.text = CPEE::Persistence::extract_item(id,opts,'transformation/endpoints/@type')
|
|
142
|
+
doc.find('/p:properties/p:transformation/p:dslx').first.text = CPEE::Persistence::extract_item(id,opts,'transformation/dslx') || ''
|
|
143
|
+
doc.find('/p:properties/p:transformation/p:dslx/@type').first.text = CPEE::Persistence::extract_item(id,opts,'transformation/dslx/@type') || 'copy' # instances from before dslx backtransformation
|
|
142
144
|
Riddl::Parameter::Complex.new('properties','application/xml',doc.to_s)
|
|
143
145
|
end
|
|
144
146
|
end #}}}
|
|
@@ -164,14 +166,14 @@ module CPEE
|
|
|
164
166
|
end
|
|
165
167
|
end
|
|
166
168
|
|
|
167
|
-
%w{dataelements documents endpoints
|
|
169
|
+
%w{dataelements documents endpoints attributes}.each do |item|
|
|
168
170
|
if (node = doc.find('/p:properties/p:' + item)).any?
|
|
169
171
|
CPEE::Properties::PatchItems::set item, id, opts, node.first.dump
|
|
170
172
|
end
|
|
171
173
|
end
|
|
172
174
|
|
|
173
175
|
if (node = doc.find('/p:properties/p:transformation')).any?
|
|
174
|
-
CPEE::Properties::PutTransformation::set id, opts, node.first.dump
|
|
176
|
+
CPEE::Properties::PutTransformation::set id, opts, node.first.dump, doc.find('/p:properties/p:description/*').empty?
|
|
175
177
|
end
|
|
176
178
|
if (node = doc.find('/p:properties/p:description/*')).any?
|
|
177
179
|
CPEE::Properties::PutDescription::set id, opts, node.first.dump
|
|
@@ -206,7 +208,7 @@ module CPEE
|
|
|
206
208
|
end
|
|
207
209
|
|
|
208
210
|
if (node = doc.find('/*/p:transformation')).any?
|
|
209
|
-
CPEE::Properties::PutTransformation::set id, opts, node.first.dump
|
|
211
|
+
CPEE::Properties::PutTransformation::set id, opts, node.first.dump, doc.find('/*/p:description/*').empty?
|
|
210
212
|
end
|
|
211
213
|
if (node = doc.find('/*/p:description/*')).any?
|
|
212
214
|
CPEE::Properties::PutDescription::set id, opts, node.first.dump
|
|
@@ -798,6 +800,32 @@ module CPEE
|
|
|
798
800
|
[dslx, dsl, de, ep]
|
|
799
801
|
end #}}}
|
|
800
802
|
|
|
803
|
+
def self::backtransform(xml,dslx,tdslx,tdslxtype) #{{{
|
|
804
|
+
# description from a directly set dslx, nil means keep the current description
|
|
805
|
+
case tdslxtype
|
|
806
|
+
when 'rest'
|
|
807
|
+
return nil if tdslx.nil? || tdslx.empty?
|
|
808
|
+
srv = Riddl::Client.new(tdslx)
|
|
809
|
+
status, res = srv.post [
|
|
810
|
+
Riddl::Parameter::Complex.new("description","text/xml",dslx), # the service distinguishes directions by path, e.g. /bpmn2/cpee/
|
|
811
|
+
Riddl::Parameter::Simple.new("type","description")
|
|
812
|
+
]
|
|
813
|
+
if status >= 200 && status < 300
|
|
814
|
+
res[0].value.read
|
|
815
|
+
else
|
|
816
|
+
raise 'Could not backtransform dslx'
|
|
817
|
+
end
|
|
818
|
+
when 'xslt'
|
|
819
|
+
return nil if tdslx.nil? || tdslx.empty?
|
|
820
|
+
trans = XML::Smart::open_unprotected(tdslx)
|
|
821
|
+
XML::Smart::string(dslx).transform_with(trans).to_s
|
|
822
|
+
when 'none'
|
|
823
|
+
nil
|
|
824
|
+
else # copy, or instances from before dslx backtransformation
|
|
825
|
+
xml
|
|
826
|
+
end
|
|
827
|
+
end #}}}
|
|
828
|
+
|
|
801
829
|
def self::set(id,opts,xml,exposition=[],copy=false)
|
|
802
830
|
dslx, dsl, de, ep = if copy
|
|
803
831
|
PutDescription::transform(
|
|
@@ -826,11 +854,28 @@ module CPEE
|
|
|
826
854
|
opts
|
|
827
855
|
)
|
|
828
856
|
end
|
|
857
|
+
description = if copy
|
|
858
|
+
begin
|
|
859
|
+
PutDescription::backtransform(
|
|
860
|
+
xml,
|
|
861
|
+
dslx,
|
|
862
|
+
CPEE::Persistence::extract_item(id,opts,'transformation/dslx'),
|
|
863
|
+
CPEE::Persistence::extract_item(id,opts,'transformation/dslx/@type')
|
|
864
|
+
)
|
|
865
|
+
rescue => e # dslx is stored anyway, description stays as it is
|
|
866
|
+
puts e.message
|
|
867
|
+
puts e.backtrace
|
|
868
|
+
nil
|
|
869
|
+
end
|
|
870
|
+
else
|
|
871
|
+
xml
|
|
872
|
+
end
|
|
873
|
+
description ||= CPEE::Persistence::extract_item(id,opts,'description') || ''
|
|
829
874
|
attrs = CPEE::Persistence::extract_list(id,opts,'attributes').to_h
|
|
830
875
|
dos = CPEE::Persistence::extract_list(id,opts,'documents').to_h
|
|
831
876
|
change_uuid = Digest::SHA1.hexdigest(dslx)
|
|
832
877
|
CPEE::Persistence::set_item(id,opts,'description',
|
|
833
|
-
:description =>
|
|
878
|
+
:description => description,
|
|
834
879
|
:dslx => dslx,
|
|
835
880
|
:change_uuid => change_uuid,
|
|
836
881
|
:dsl => dsl,
|
|
@@ -851,6 +896,16 @@ module CPEE
|
|
|
851
896
|
end
|
|
852
897
|
end
|
|
853
898
|
|
|
899
|
+
def self::validate(xml,opts) # dslx against t_dslx.rng, returns the errors
|
|
900
|
+
errors = []
|
|
901
|
+
begin
|
|
902
|
+
XML::Smart::string(xml).validate_against(XML::Smart::open_unprotected(opts[:dslx_rng])) { |e| errors << e.message.strip }
|
|
903
|
+
rescue => e # not even well-formed
|
|
904
|
+
errors << e.message.strip
|
|
905
|
+
end
|
|
906
|
+
errors
|
|
907
|
+
end
|
|
908
|
+
|
|
854
909
|
def response
|
|
855
910
|
id = @a[0]
|
|
856
911
|
opts = @a[1]
|
|
@@ -860,9 +915,17 @@ module CPEE
|
|
|
860
915
|
elsif opts[:statemachine].final? id
|
|
861
916
|
@status = 410
|
|
862
917
|
else
|
|
918
|
+
# force-encoding because johannes managed to sneak in ascii special characters. why the browser is not sanitizing it is beyond me.
|
|
919
|
+
xml = @p[0].value.read.force_encoding('UTF-8')
|
|
920
|
+
errors = copy ? PutDescription::validate(xml,opts) : [] # copy: dslx, a description can be any model type
|
|
921
|
+
if errors.any?
|
|
922
|
+
attrs = CPEE::Persistence::extract_list(id,opts,'attributes').to_h
|
|
923
|
+
CPEE::Message::send(:event,'description/error',File.join(opts[:url],'/'),id,attrs['uuid'],attrs['info'],{ :message => errors.join("\n"), :errors => errors, :attributes => attrs },opts[:redis])
|
|
924
|
+
@status = 422
|
|
925
|
+
return Riddl::Parameter::Complex.new('error','text/plain',errors.join("\n"))
|
|
926
|
+
end
|
|
863
927
|
begin
|
|
864
|
-
|
|
865
|
-
PutDescription::set(id,opts,@p[0].value.read.force_encoding('UTF-8'),@p[1..-1],copy)
|
|
928
|
+
PutDescription::set(id,opts,xml,@p[1..-1],copy)
|
|
866
929
|
rescue => e
|
|
867
930
|
puts e.message
|
|
868
931
|
puts e.backtrace
|
|
@@ -886,20 +949,53 @@ module CPEE
|
|
|
886
949
|
des.find('p:description/@type').first.text = CPEE::Persistence::extract_item(id,opts,'transformation/description/@type')
|
|
887
950
|
des.find('p:dataelements/@type').first.text = CPEE::Persistence::extract_item(id,opts,'transformation/dataelements/@type')
|
|
888
951
|
des.find('p:endpoints/@type').first.text = CPEE::Persistence::extract_item(id,opts,'transformation/endpoints/@type')
|
|
952
|
+
des.find('p:dslx').first.text = CPEE::Persistence::extract_item(id,opts,'transformation/dslx') || ''
|
|
953
|
+
des.find('p:dslx/@type').first.text = CPEE::Persistence::extract_item(id,opts,'transformation/dslx/@type') || 'copy' # instances from before dslx backtransformation
|
|
889
954
|
Riddl::Parameter::Complex.new('status','text/xml',des.to_doc.to_s)
|
|
890
955
|
end
|
|
891
956
|
end #}}}
|
|
892
957
|
class PutTransformation < Riddl::Implementation #{{{
|
|
893
|
-
def self::set(id,opts,xml)
|
|
958
|
+
def self::set(id,opts,xml,backtrans=true)
|
|
894
959
|
doc = XML::Smart::string(xml)
|
|
895
960
|
doc.register_namespace 'p', 'http://cpee.org/ns/properties/2.0'
|
|
961
|
+
tdslx = doc.find('string(/p:transformation/p:dslx)')
|
|
962
|
+
tdslxtype = (t = doc.find('string(/p:transformation/p:dslx/@type)')).empty? ? 'copy' : t # optional, missing means copy
|
|
963
|
+
changed = tdslx != (CPEE::Persistence::extract_item(id,opts,'transformation/dslx') || '') ||
|
|
964
|
+
tdslxtype != (CPEE::Persistence::extract_item(id,opts,'transformation/dslx/@type') || 'copy')
|
|
896
965
|
CPEE::Persistence::set_item(id,opts,'transformation',
|
|
897
966
|
:description => doc.find('string(/p:transformation/p:description)'),
|
|
898
967
|
:description_type => doc.find('string(/p:transformation/p:description/@type)'),
|
|
899
968
|
:dataelements =>doc.find('string(/p:transformation/p:dataelements)'),
|
|
900
969
|
:dataelements_type => doc.find('string(/p:transformation/p:dataelements/@type)'),
|
|
901
970
|
:endpoints =>doc.find('string(/p:transformation/p:endpoints)'),
|
|
902
|
-
:endpoints_type => doc.find('string(/p:transformation/p:endpoints/@type)')
|
|
971
|
+
:endpoints_type => doc.find('string(/p:transformation/p:endpoints/@type)'),
|
|
972
|
+
:dslx => tdslx,
|
|
973
|
+
:dslx_type => tdslxtype
|
|
974
|
+
)
|
|
975
|
+
PutTransformation::backtransform(id,opts,tdslx,tdslxtype) if backtrans && changed
|
|
976
|
+
end
|
|
977
|
+
def self::backtransform(id,opts,tdslx,tdslxtype)
|
|
978
|
+
# the description has to follow the new transformation. the new values are passed
|
|
979
|
+
# directly, as redis is only updated asynchronously by persist.rb
|
|
980
|
+
dslx = CPEE::Persistence::extract_item(id,opts,'dslx')
|
|
981
|
+
return if dslx.nil? || dslx.empty?
|
|
982
|
+
description = begin
|
|
983
|
+
PutDescription::backtransform(dslx,dslx,tdslx,tdslxtype)
|
|
984
|
+
rescue => e # description stays as it is
|
|
985
|
+
puts e.message
|
|
986
|
+
puts e.backtrace
|
|
987
|
+
nil
|
|
988
|
+
end
|
|
989
|
+
return if description.nil?
|
|
990
|
+
CPEE::Persistence::set_item(id,opts,'description',
|
|
991
|
+
:description => description,
|
|
992
|
+
:dslx => dslx,
|
|
993
|
+
:change_uuid => Digest::SHA1.hexdigest(dslx),
|
|
994
|
+
:dsl => CPEE::Persistence::extract_item(id,opts,'dsl'),
|
|
995
|
+
:dataelements => CPEE::Persistence::extract_list(id,opts,'dataelements').to_h,
|
|
996
|
+
:documents => CPEE::Persistence::extract_list(id,opts,'documents').to_h,
|
|
997
|
+
:endpoints => CPEE::Persistence::extract_list(id,opts,'endpoints').to_h,
|
|
998
|
+
:attributes => CPEE::Persistence::extract_list(id,opts,'attributes').to_h
|
|
903
999
|
)
|
|
904
1000
|
end
|
|
905
1001
|
def response
|
data/lib/cpee/message.rb
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# This file is part of CPEE.
|
|
2
2
|
#
|
|
3
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,
|
|
4
|
+
# of the GNU Lesser General Public License as published by the Free Software Foundation,
|
|
5
5
|
# either version 3 of the License, or (at your option) any later version.
|
|
6
6
|
#
|
|
7
7
|
# CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
8
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.
|
|
9
|
+
# PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
|
10
10
|
#
|
|
11
|
-
# You should have received a copy of the GNU General Public License along with
|
|
12
|
-
# CPEE (file
|
|
11
|
+
# You should have received a copy of the GNU Lesser General Public License along with
|
|
12
|
+
# CPEE (file LICENSE in the main directory). If not, see
|
|
13
13
|
# <http://www.gnu.org/licenses/>.
|
|
14
14
|
|
|
15
15
|
module CPEE
|
data/lib/cpee/persistence.rb
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# This file is part of CPEE.
|
|
2
2
|
#
|
|
3
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,
|
|
4
|
+
# of the GNU Lesser General Public License as published by the Free Software Foundation,
|
|
5
5
|
# either version 3 of the License, or (at your option) any later version.
|
|
6
6
|
#
|
|
7
7
|
# CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
8
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.
|
|
9
|
+
# PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
|
10
10
|
#
|
|
11
|
-
# You should have received a copy of the GNU General Public License along with
|
|
12
|
-
# CPEE (file
|
|
11
|
+
# You should have received a copy of the GNU Lesser General Public License along with
|
|
12
|
+
# CPEE (file LICENSE in the main directory). If not, see
|
|
13
13
|
# <http://www.gnu.org/licenses/>.
|
|
14
14
|
|
|
15
15
|
require 'msgpack'
|
|
@@ -209,6 +209,8 @@ module CPEE
|
|
|
209
209
|
res += Persistence::keys_extract_name(opts,id,'transformation','description','@type')
|
|
210
210
|
res += Persistence::keys_extract_name(opts,id,'transformation','dataelements')
|
|
211
211
|
res += Persistence::keys_extract_name(opts,id,'transformation','dataelements','@type')
|
|
212
|
+
res += Persistence::keys_extract_name(opts,id,'transformation','dslx')
|
|
213
|
+
res += Persistence::keys_extract_name(opts,id,'transformation','dslx','@type')
|
|
212
214
|
res
|
|
213
215
|
end
|
|
214
216
|
|
data/lib/cpee/redis.rb
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# This file is part of CPEE.
|
|
2
2
|
#
|
|
3
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,
|
|
4
|
+
# of the GNU Lesser General Public License as published by the Free Software Foundation,
|
|
5
5
|
# either version 3 of the License, or (at your option) any later version.
|
|
6
6
|
#
|
|
7
7
|
# CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
8
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.
|
|
9
|
+
# PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
|
10
10
|
#
|
|
11
|
-
# You should have received a copy of the GNU General Public License along with
|
|
12
|
-
# CPEE (file
|
|
11
|
+
# You should have received a copy of the GNU Lesser General Public License along with
|
|
12
|
+
# CPEE (file LICENSE in the main directory). If not, see
|
|
13
13
|
# <http://www.gnu.org/licenses/>.
|
|
14
14
|
|
|
15
15
|
require 'redis'
|
data/lib/cpee/statemachine.rb
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# This file is part of CPEE.
|
|
2
2
|
#
|
|
3
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,
|
|
4
|
+
# of the GNU Lesser General Public License as published by the Free Software Foundation,
|
|
5
5
|
# either version 3 of the License, or (at your option) any later version.
|
|
6
6
|
#
|
|
7
7
|
# CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
8
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.
|
|
9
|
+
# PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
|
10
10
|
#
|
|
11
|
-
# You should have received a copy of the GNU General Public License along with
|
|
12
|
-
# CPEE (file
|
|
11
|
+
# You should have received a copy of the GNU Lesser General Public License along with
|
|
12
|
+
# CPEE (file LICENSE in the main directory). If not, see
|
|
13
13
|
# <http://www.gnu.org/licenses/>.
|
|
14
14
|
|
|
15
15
|
module CPEE
|
data/lib/cpee/value_helper.rb
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# This file is part of CPEE.
|
|
2
2
|
#
|
|
3
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,
|
|
4
|
+
# of the GNU Lesser General Public License as published by the Free Software Foundation,
|
|
5
5
|
# either version 3 of the License, or (at your option) any later version.
|
|
6
6
|
#
|
|
7
7
|
# CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
8
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.
|
|
9
|
+
# PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
|
10
10
|
#
|
|
11
|
-
# You should have received a copy of the GNU General Public License along with
|
|
12
|
-
# CPEE (file
|
|
11
|
+
# You should have received a copy of the GNU Lesser General Public License along with
|
|
12
|
+
# CPEE (file LICENSE in the main directory). If not, see
|
|
13
13
|
# <http://www.gnu.org/licenses/>.
|
|
14
14
|
|
|
15
15
|
require 'json'
|
data/lib/cpee.xml
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
This file is part of CPEE.
|
|
3
3
|
|
|
4
4
|
CPEE is free software: you can redistribute it and/or modify it under the terms
|
|
5
|
-
of the GNU General Public License as published by the Free Software Foundation,
|
|
5
|
+
of the GNU Lesser General Public License as published by the Free Software Foundation,
|
|
6
6
|
either version 3 of the License, or (at your option) any later version.
|
|
7
7
|
|
|
8
8
|
CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
9
9
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
10
|
-
PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
10
|
+
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
|
11
11
|
|
|
12
|
-
You should have received a copy of the GNU General Public License along with
|
|
13
|
-
CPEE (file
|
|
12
|
+
You should have received a copy of the GNU Lesser General Public License along with
|
|
13
|
+
CPEE (file LICENSE in the main directory). If not, see
|
|
14
14
|
<http://www.gnu.org/licenses/>.
|
|
15
15
|
-->
|
|
16
16
|
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
This file is part of CPEE.
|
|
3
3
|
|
|
4
4
|
CPEE is free software: you can redistribute it and/or modify it under the terms
|
|
5
|
-
of the GNU General Public License as published by the Free Software Foundation,
|
|
5
|
+
of the GNU Lesser General Public License as published by the Free Software Foundation,
|
|
6
6
|
either version 3 of the License, or (at your option) any later version.
|
|
7
7
|
|
|
8
8
|
CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
9
9
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
10
|
-
PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
10
|
+
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
|
11
11
|
|
|
12
|
-
You should have received a copy of the GNU General Public License along with
|
|
13
|
-
CPEE (file
|
|
12
|
+
You should have received a copy of the GNU Lesser General Public License along with
|
|
13
|
+
CPEE (file LICENSE in the main directory). If not, see
|
|
14
14
|
<http://www.gnu.org/licenses/>.
|
|
15
15
|
-->
|
|
16
16
|
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
This file is part of CPEE.
|
|
3
3
|
|
|
4
4
|
CPEE is free software: you can redistribute it and/or modify it under the terms
|
|
5
|
-
of the GNU General Public License as published by the Free Software Foundation,
|
|
5
|
+
of the GNU Lesser General Public License as published by the Free Software Foundation,
|
|
6
6
|
either version 3 of the License, or (at your option) any later version.
|
|
7
7
|
|
|
8
8
|
CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
9
9
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
10
|
-
PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
10
|
+
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
|
11
11
|
|
|
12
|
-
You should have received a copy of the GNU General Public License along with
|
|
13
|
-
CPEE (file
|
|
12
|
+
You should have received a copy of the GNU Lesser General Public License along with
|
|
13
|
+
CPEE (file LICENSE in the main directory). If not, see
|
|
14
14
|
<http://www.gnu.org/licenses/>.
|
|
15
15
|
-->
|
|
16
16
|
|
data/lib/engine/instances.rng
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
This file is part of CPEE.
|
|
3
3
|
|
|
4
4
|
CPEE is free software: you can redistribute it and/or modify it under the terms
|
|
5
|
-
of the GNU General Public License as published by the Free Software Foundation,
|
|
5
|
+
of the GNU Lesser General Public License as published by the Free Software Foundation,
|
|
6
6
|
either version 3 of the License, or (at your option) any later version.
|
|
7
7
|
|
|
8
8
|
CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
9
9
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
10
|
-
PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
10
|
+
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
|
11
11
|
|
|
12
|
-
You should have received a copy of the GNU General Public License along with
|
|
13
|
-
CPEE (file
|
|
12
|
+
You should have received a copy of the GNU Lesser General Public License along with
|
|
13
|
+
CPEE (file LICENSE in the main directory). If not, see
|
|
14
14
|
<http://www.gnu.org/licenses/>.
|
|
15
15
|
-->
|
|
16
16
|
|
data/lib/engine.xml
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
This file is part of CPEE.
|
|
3
3
|
|
|
4
4
|
CPEE is free software: you can redistribute it and/or modify it under the terms
|
|
5
|
-
of the GNU General Public License as published by the Free Software Foundation,
|
|
5
|
+
of the GNU Lesser General Public License as published by the Free Software Foundation,
|
|
6
6
|
either version 3 of the License, or (at your option) any later version.
|
|
7
7
|
|
|
8
8
|
CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
9
9
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
10
|
-
PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
10
|
+
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
|
11
11
|
|
|
12
|
-
You should have received a copy of the GNU General Public License along with
|
|
13
|
-
CPEE (file
|
|
12
|
+
You should have received a copy of the GNU Lesser General Public License along with
|
|
13
|
+
CPEE (file LICENSE in the main directory). If not, see
|
|
14
14
|
<http://www.gnu.org/licenses/>.
|
|
15
15
|
-->
|
|
16
16
|
|