server/executionhandlers/ruby/connection.rb in cpee-2.1.64 vs server/executionhandlers/ruby/connection.rb in cpee-2.1.66

- old
+ new

@@ -317,17 +317,22 @@ true end GC.start end #}}} - def prepare(__struct, __endpoints, __parameters) #{{{ - @handler_endpoint = __endpoints.is_a?(Array) ? __endpoints.map{ |ep| __struct.endpoints[ep] }.compact : __struct.endpoints[__endpoints] + def prepare(__lock,__dataelements,__endpoints,__status,__local,__additional,__code,__exec_endpoints,__exec_parameters) #{{{ + __struct = if __code + manipulate(true,__lock,__dataelements,__endpoints,__status,__local,__additional,__code,'Parameter') + else + WEEL::ReadStructure.new(__dataelements,__endpoints,__local,__additional) + end + @handler_endpoint = __exec_endpoints.is_a?(Array) ? __exec_endpoints.map{ |ep| __struct.endpoints[ep] }.compact : __struct.endpoints[__exec_endpoints] if @controller.attributes['twin_engine'] @handler_endpoint_orig = @handler_endpoint @handler_endpoint = @controller.attributes['twin_engine'].to_s + '?original_endpoint=' + Riddl::Protocols::Utils::escape(@handler_endpoint) end - __params = __parameters.dup + __params = __exec_parameters.dup __params[:arguments] = __params[:arguments].dup if __params[:arguments] __params[:arguments]&.map! do |__ele| __tmp = __ele.dup if __tmp.value.is_a?(WEEL::ProcString) __tmp.value = __struct.instance_eval __tmp.value.code, 'Parameter', 1 @@ -336,10 +341,10 @@ end __params end #}}} def test_condition(__dataelements,__endpoints,__local,__additional,__code,__args={}) #{{{ __struct = WEEL::ReadStructure.new(__dataelements,__endpoints,__local,__additional).instance_eval(__code,'Condition',1) - @controller.notify("gateway/decide", :instance_uuid => @controller.uuid, :code => code, :condition => (__struct ? "true" : "false")) + @controller.notify("gateway/decide", :instance_uuid => @controller.uuid, :code => __code, :condition => (__struct ? "true" : "false")) __struct end #}}} def manipulate(__readonly,__lock,__dataelements,__endpoints,__status,__local,__additional,__code,__where,__result=nil,__options=nil) #{{{ result = CPEE::EvalRuby::Translation::simplify_structurized_result(__result) __struct = if __readonly