lib/cpee/processtransformation/cpee.rb in cpee-1.3.150 vs lib/cpee/processtransformation/cpee.rb in cpee-1.3.151
- old
+ new
@@ -1,19 +1,19 @@
# encoding: UTF-8
#
# This file is part of CPEE.
#
# Apache License, Version 2.0
-#
+#
# Copyright (c) 2013 Juergen Mangler
-#
+#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
-#
+#
# http://www.apache.org/licenses/LICENSE-2.0
-#
+#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
@@ -47,18 +47,21 @@
res.add('break')
end
def print_InfiniteLoop(node,res)
s1 = res.add('loop', 'pre_test' => 'true')
+ node.attributes.each do |k,v|
+ s1.attributes[k] = v
+ end
generate_for_list(node,s1)
end
def print_Loop_default(node,res)
s1 = res.add('loop', 'pre_test' => node.condition.empty? ? 'true' : node.condition.join(' && '))
s1.attributes['language'] = node.condition_type unless node.condition_type.nil?
node.attributes.each do |k,v|
s1.attributes[k] = v
- end
+ end
generate_for_list(node,s1)
s1
end
private :print_Loop_default
def print_Loop(node,res); print_Loop_default(node,res); end
@@ -68,11 +71,11 @@
if node.endpoints.empty? && !node.script.nil? && node.script.strip != ''
n = res.add('d:manipulate', 'id' => "a#{node.niceid}")
n.text = node.script
n.attributes['output'] = node.script_var unless node.script_var.nil?
n.attributes['language'] = node.script_type unless node.script_type.nil?
- else
+ else
n = res.add('d:call', 'id' => "a#{node.niceid}", 'endpoint' => node.endpoints.join(','))
p = n.add('d:parameters')
p.add('d:label',node.label)
p.add('d:method',node.methods.join(','))
p.add('d:type',node.type)
@@ -109,14 +112,14 @@
a = s1.add('d:alternative','condition' => branch.condition.join(' or '))
a.attributes['language'] = branch.condition_type unless branch.condition_type.nil?
a
else
s1.add('d:otherwise')
- end
+ end
branch.attributes.each do |k,v|
s2.attributes[k] = v
- end
+ end
generate_for_list(branch,s2)
end
if (x = s1.find('d:otherwise')).any?
s1.add x
end
@@ -128,8 +131,8 @@
end
end
- end
+ end
end