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.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +73 -1
  3. data/cpee-transformation.gemspec +10 -2
  4. data/lib/cpee/transformation/bpmn2.rb +35 -2
  5. data/lib/cpee/transformation/cpee.rb +49 -5
  6. data/lib/cpee/transformation/graphviz.rb +190 -33
  7. data/lib/cpee/transformation/implementation.rb +6 -0
  8. data/lib/cpee/transformation/implementation.xml +4 -0
  9. data/lib/cpee/transformation/mermaid.rb +55 -18
  10. data/lib/cpee/transformation/ptml.rb +71 -68
  11. data/lib/cpee/transformation/structures.rb +41 -6
  12. data/lib/cpee/transformation/target.rb +14 -1
  13. data/lib/cpee/transformation/transformer.rb +1 -1
  14. data/server/trans.conf +1 -0
  15. data/tools/trans_bpmn2-to-graphviz +85 -0
  16. data/tools/{bpmn2_to_ptml.rb → trans_bpmn2-to-ptml} +1 -3
  17. data/tools/trans_cpee-to-bpmn2 +92 -0
  18. data/tools/trans_cpee-to-graphviz +85 -0
  19. data/tools/{cpee_to_ptml.rb → trans_cpee-to-ptml} +1 -3
  20. metadata +35 -24
  21. /data/tools/{bpmn2_to_cpee.rb → trans_bpmn2-to-cpee} +0 -0
  22. /data/tools/{bpmn2_to_mermaid.rb → trans_bpmn2-to-mermaid} +0 -0
  23. /data/tools/{cpee_to_cpee.rb → trans_cpee-to-cpee} +0 -0
  24. /data/tools/{cpee_to_dataflow.rb → trans_cpee-to-dataflow} +0 -0
  25. /data/tools/{cpee_to_mermaid.rb → trans_cpee-to-mermaid} +0 -0
  26. /data/tools/{cpee_to_text_bf.rb → trans_cpee-to-text-bf} +0 -0
  27. /data/tools/{cpee_to_text_df-poe.rb → trans_cpee-to-text-df-poe} +0 -0
  28. /data/tools/{cpee_to_text_df-por.rb → trans_cpee-to-text-df-por} +0 -0
  29. /data/tools/{mermaid_to_cpee.rb → trans_mermaid-to-cpee} +0 -0
  30. /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 cpee and output to console."))
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.3
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
- - cpee_to_cpee.rb
91
- - cpee_to_mermaid.rb
92
- - cpee_to_ptml.rb
93
- - cpee_to_text_bf.rb
94
- - cpee_to_text_df-poe.rb
95
- - cpee_to_text_df-por.rb
96
- - mermaid_to_cpee.rb
97
- - ptml_to_cpee.rb
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
- - tools/bpmn2_to_cpee.rb
127
- - tools/bpmn2_to_mermaid.rb
128
- - tools/bpmn2_to_ptml.rb
127
+ - server/trans.conf
129
128
  - tools/cpee-trans
130
- - tools/cpee_to_cpee.rb
131
- - tools/cpee_to_dataflow.rb
132
- - tools/cpee_to_mermaid.rb
133
- - tools/cpee_to_ptml.rb
134
- - tools/cpee_to_text_bf.rb
135
- - tools/cpee_to_text_df-poe.rb
136
- - tools/cpee_to_text_df-por.rb
137
- - tools/mermaid_to_cpee.rb
138
- - tools/ptml_to_cpee.rb
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