cpee-transformation 1.0.3 → 1.0.7
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 +73 -1
- data/cpee-transformation.gemspec +10 -2
- data/lib/cpee/transformation/bpmn2.rb +35 -2
- data/lib/cpee/transformation/cpee.rb +49 -5
- data/lib/cpee/transformation/graphviz.rb +190 -33
- data/lib/cpee/transformation/implementation.rb +6 -0
- data/lib/cpee/transformation/implementation.xml +4 -0
- data/lib/cpee/transformation/mermaid.rb +55 -18
- data/lib/cpee/transformation/ptml.rb +71 -68
- data/lib/cpee/transformation/structures.rb +41 -6
- data/lib/cpee/transformation/target.rb +14 -1
- data/lib/cpee/transformation/transformer.rb +1 -1
- data/server/trans.conf +1 -0
- data/tools/trans_bpmn2-to-graphviz +85 -0
- data/tools/{bpmn2_to_ptml.rb → trans_bpmn2-to-ptml} +1 -3
- data/tools/trans_cpee-to-bpmn2 +92 -0
- data/tools/trans_cpee-to-graphviz +85 -0
- data/tools/{cpee_to_ptml.rb → trans_cpee-to-ptml} +1 -3
- metadata +35 -24
- /data/tools/{bpmn2_to_cpee.rb → trans_bpmn2-to-cpee} +0 -0
- /data/tools/{bpmn2_to_mermaid.rb → trans_bpmn2-to-mermaid} +0 -0
- /data/tools/{cpee_to_cpee.rb → trans_cpee-to-cpee} +0 -0
- /data/tools/{cpee_to_dataflow.rb → trans_cpee-to-dataflow} +0 -0
- /data/tools/{cpee_to_mermaid.rb → trans_cpee-to-mermaid} +0 -0
- /data/tools/{cpee_to_text_bf.rb → trans_cpee-to-text-bf} +0 -0
- /data/tools/{cpee_to_text_df-poe.rb → trans_cpee-to-text-df-poe} +0 -0
- /data/tools/{cpee_to_text_df-por.rb → trans_cpee-to-text-df-por} +0 -0
- /data/tools/{mermaid_to_cpee.rb → trans_mermaid-to-cpee} +0 -0
- /data/tools/{ptml_to_cpee.rb → trans_ptml-to-cpee} +0 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
#!/usr/bin/ruby
|
|
2
|
+
# encoding: UTF-8
|
|
3
|
+
#
|
|
4
|
+
# This file is part of CPEE-TRANSFORMATION.
|
|
5
|
+
#
|
|
6
|
+
# CPEE-TRANSFORMATION is free software: you can redistribute it and/or modify
|
|
7
|
+
# it under the terms of the GNU Lesser General Public License as published by
|
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or (at your
|
|
9
|
+
# option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# CPEE-TRANSFORMATION is distributed in the hope that it will be useful, but
|
|
12
|
+
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
13
|
+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
|
14
|
+
# for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU Lesser General Public License
|
|
17
|
+
# along with CPEE-TRANSFORMATION (file LICENSE in the main directory). If not,
|
|
18
|
+
# see <http://www.gnu.org/licenses/>.
|
|
19
|
+
|
|
20
|
+
def wrap(s1, s2, width=78, indent=ARGV.options.summary_width + 3)
|
|
21
|
+
lines = []
|
|
22
|
+
s = ARGV.options.summary_indent + s1 + ' ' * (indent - s1.length - ARGV.options.summary_indent.length) + s2
|
|
23
|
+
line, s = s[0..indent-2], s[indent..-1]
|
|
24
|
+
s.split(/\n/).each do |ss|
|
|
25
|
+
ss.split(/[ \t]+/).each do |word|
|
|
26
|
+
if line.size + word.size >= width
|
|
27
|
+
lines << line
|
|
28
|
+
line = (" " * (indent)) + word
|
|
29
|
+
else
|
|
30
|
+
line << " " << word
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
lines << line if line
|
|
34
|
+
line = (" " * (indent-1))
|
|
35
|
+
end
|
|
36
|
+
return lines.join("\n")
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
require 'optparse'
|
|
40
|
+
|
|
41
|
+
require_relative '../lib/cpee/transformation/transformer' rescue nil
|
|
42
|
+
require_relative '../lib/cpee/transformation/cpee' rescue nil
|
|
43
|
+
require_relative '../lib/cpee/transformation/graphviz' rescue nil
|
|
44
|
+
|
|
45
|
+
interactive = false
|
|
46
|
+
printtree = false
|
|
47
|
+
|
|
48
|
+
ARGV.options { |opt|
|
|
49
|
+
opt.summary_indent = ' ' * 2
|
|
50
|
+
opt.summary_width = 18
|
|
51
|
+
opt.banner = "Usage:\n#{opt.summary_indent}#{File.basename($0)} FNAME\n"
|
|
52
|
+
opt.on("Options:")
|
|
53
|
+
opt.on("--help", "-h", "This text") { puts opt; exit }
|
|
54
|
+
opt.on("--interactive", "-i", "Interactive mode") { interactive = true }
|
|
55
|
+
opt.on("--tree", "-t", "Print tree") { printtree = true }
|
|
56
|
+
opt.on("")
|
|
57
|
+
opt.on(wrap("[FNAME]","convert cpee tree in file FNAME to graphviz and output to console."))
|
|
58
|
+
opt.parse!
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if ARGV.length != 1
|
|
62
|
+
puts ARGV.options
|
|
63
|
+
exit
|
|
64
|
+
else
|
|
65
|
+
f = ARGV[0]
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
model = CPEE::Transformation::Source::CPEE.new(File.read(f))
|
|
69
|
+
|
|
70
|
+
trans = CPEE::Transformation::Transformer.new(model)
|
|
71
|
+
traces = trans.build_traces
|
|
72
|
+
|
|
73
|
+
if interactive
|
|
74
|
+
puts traces.legend
|
|
75
|
+
puts
|
|
76
|
+
tree = trans.build_tree(true)
|
|
77
|
+
else
|
|
78
|
+
tree = trans.build_tree(false)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
if printtree
|
|
82
|
+
puts tree.to_s
|
|
83
|
+
else
|
|
84
|
+
puts trans.generate_model(CPEE::Transformation::Target::Graphviz)
|
|
85
|
+
end
|
|
@@ -54,7 +54,7 @@ ARGV.options { |opt|
|
|
|
54
54
|
opt.on("--interactive", "-i", "Interactive mode") { interactive = true }
|
|
55
55
|
opt.on("--tree", "-t", "Print tree") { printtree = true }
|
|
56
56
|
opt.on("")
|
|
57
|
-
opt.on(wrap("[FNAME]","convert cpee tree in file FNAME to
|
|
57
|
+
opt.on(wrap("[FNAME]","convert cpee tree in file FNAME to ptml and output to console."))
|
|
58
58
|
opt.parse!
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -78,8 +78,6 @@ else
|
|
|
78
78
|
tree = trans.build_tree(false)
|
|
79
79
|
end
|
|
80
80
|
|
|
81
|
-
pp tree
|
|
82
|
-
|
|
83
81
|
if printtree
|
|
84
82
|
puts tree.to_s
|
|
85
83
|
else
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cpee-transformation
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Juergen eTM Mangler
|
|
@@ -83,18 +83,19 @@ dependencies:
|
|
|
83
83
|
description: see http://cpee.org
|
|
84
84
|
email: juergen.mangler@gmail.com
|
|
85
85
|
executables:
|
|
86
|
-
- bpmn2_to_cpee.rb
|
|
87
|
-
- bpmn2_to_mermaid.rb
|
|
88
|
-
- bpmn2_to_ptml.rb
|
|
89
86
|
- cpee-trans
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
-
|
|
87
|
+
- trans_bpmn2-to-cpee
|
|
88
|
+
- trans_bpmn2-to-mermaid
|
|
89
|
+
- trans_bpmn2-to-ptml
|
|
90
|
+
- trans_cpee-to-bpmn2
|
|
91
|
+
- trans_cpee-to-cpee
|
|
92
|
+
- trans_cpee-to-mermaid
|
|
93
|
+
- trans_cpee-to-ptml
|
|
94
|
+
- trans_cpee-to-text-bf
|
|
95
|
+
- trans_cpee-to-text-df-poe
|
|
96
|
+
- trans_cpee-to-text-df-por
|
|
97
|
+
- trans_mermaid-to-cpee
|
|
98
|
+
- trans_ptml-to-cpee
|
|
98
99
|
extensions: []
|
|
99
100
|
extra_rdoc_files:
|
|
100
101
|
- README.md
|
|
@@ -123,23 +124,33 @@ files:
|
|
|
123
124
|
- lib/cpee/transformation/transformation_xml_text.xml
|
|
124
125
|
- lib/cpee/transformation/transformer.rb
|
|
125
126
|
- server/trans
|
|
126
|
-
-
|
|
127
|
-
- tools/bpmn2_to_mermaid.rb
|
|
128
|
-
- tools/bpmn2_to_ptml.rb
|
|
127
|
+
- server/trans.conf
|
|
129
128
|
- tools/cpee-trans
|
|
130
|
-
- tools/
|
|
131
|
-
- tools/
|
|
132
|
-
- tools/
|
|
133
|
-
- tools/
|
|
134
|
-
- tools/
|
|
135
|
-
- tools/
|
|
136
|
-
- tools/
|
|
137
|
-
- tools/
|
|
138
|
-
- tools/
|
|
129
|
+
- tools/trans_bpmn2-to-cpee
|
|
130
|
+
- tools/trans_bpmn2-to-graphviz
|
|
131
|
+
- tools/trans_bpmn2-to-mermaid
|
|
132
|
+
- tools/trans_bpmn2-to-ptml
|
|
133
|
+
- tools/trans_cpee-to-bpmn2
|
|
134
|
+
- tools/trans_cpee-to-cpee
|
|
135
|
+
- tools/trans_cpee-to-dataflow
|
|
136
|
+
- tools/trans_cpee-to-graphviz
|
|
137
|
+
- tools/trans_cpee-to-mermaid
|
|
138
|
+
- tools/trans_cpee-to-ptml
|
|
139
|
+
- tools/trans_cpee-to-text-bf
|
|
140
|
+
- tools/trans_cpee-to-text-df-poe
|
|
141
|
+
- tools/trans_cpee-to-text-df-por
|
|
142
|
+
- tools/trans_mermaid-to-cpee
|
|
143
|
+
- tools/trans_ptml-to-cpee
|
|
139
144
|
homepage: http://github.com/etm/cpee-transformation/
|
|
140
145
|
licenses:
|
|
141
146
|
- LGPL-3.0-or-later
|
|
142
147
|
metadata: {}
|
|
148
|
+
post_install_message: |
|
|
149
|
+
The BPMN2 target uses bpmnexport from cpee-layout (Node.js >= 22.22). By
|
|
150
|
+
default npx fetches it on first use. To avoid that, run
|
|
151
|
+
npm install -g cpee-layout
|
|
152
|
+
and set ":bpmnexport: bpmnexport" in trans.conf of your service
|
|
153
|
+
(scaffolded with cpee-trans new DIR).
|
|
143
154
|
rdoc_options: []
|
|
144
155
|
require_paths:
|
|
145
156
|
- lib
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|