cpee 1.3.121 → 1.3.122

Sign up to get free protection for your applications and to get access to all the features.
@@ -48,6 +48,7 @@ $(document).ready(function() {// {{{
48
48
  $("button[name=instance]").click(monitor_instance);
49
49
  $("button[name=loadtestset]").click(load_testset);
50
50
  $("button[name=loadtestsetfile]").click(load_testsetfile);
51
+ $("button[name=loadmodelfile]").click(load_modelfile);
51
52
  $("button[name=savetestset]").click(function(){ save_testset(); });
52
53
  $("button[name=savesvg]").click(function(){ save_svg(); });
53
54
  $("input[name=votecontinue]").click(check_subscription);
@@ -556,7 +557,7 @@ function save_svg() {// {{{
556
557
  }
557
558
  });
558
559
  }// }}}
559
- function set_testset (testset) {// {{{
560
+ function set_testset(testset) {// {{{
560
561
  var url = $("input[name=current-instance]").val();
561
562
 
562
563
  $.ajax({
@@ -607,7 +608,7 @@ function set_testset (testset) {// {{{
607
608
  });
608
609
  }
609
610
  });
610
- }// }}}
611
+ }// }}}
611
612
  function load_testsetfile() { //{{{
612
613
  if (running) return;
613
614
  if (typeof window.FileReader !== 'function') {
@@ -624,6 +625,23 @@ function load_testsetfile() { //{{{
624
625
  reader.onabort = function(){ running = false; }
625
626
  reader.readAsText(files[0]);
626
627
  } //}}}
628
+ function load_modelfile() { //{{{
629
+ if (running) return;
630
+ if (typeof window.FileReader !== 'function') {
631
+ alert('FileReader not yet supportet');
632
+ return;
633
+ }
634
+ var files = $('#modelfile').get(0).files;
635
+ var reader = new FileReader();
636
+ reader.onload = function(){
637
+ var url = $("input[name=current-instance]").val();
638
+ load_des(url,reader.result);
639
+ running = false;
640
+ }
641
+ reader.onerror = function(){ running = false; }
642
+ reader.onabort = function(){ running = false; }
643
+ reader.readAsText(files[0]);
644
+ } //}}}
627
645
  function load_testset() {// {{{
628
646
  if (running) return;
629
647
  running = true;
@@ -646,18 +664,23 @@ function load_testset() {// {{{
646
664
  running = false;
647
665
  }// }}}
648
666
 
649
- function load_testset_des(url,testset) {// {{{
650
- var ser = '';
651
- $("testset > description > *",testset).each(function(){
652
- ser += $(this).serializeXML() + "\n";
653
- });
654
- var val = "<content>" + ser + "</content>";
667
+ function load_des(url,model) { //{{{
668
+ model = model.replace(/<\?[^\?]+\?>/,'');
669
+ var val = "<content>" + model + "</content>";
655
670
  $.ajax({
656
671
  type: "PUT",
657
672
  url: url + "/properties/values/description",
658
673
  data: ({content: val}),
659
674
  error: report_failure
660
675
  });
676
+ } //}}}
677
+
678
+ function load_testset_des(url,testset) {// {{{
679
+ var ser = '';
680
+ $("testset > description > *",testset).each(function(){
681
+ ser += $(this).serializeXML() + "\n";
682
+ });
683
+ load_des(url,ser);
661
684
  } // }}}
662
685
  function load_testset_hw(url,testset) {// {{{
663
686
  $("testset > handlerwrapper",testset).each(function(){
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee"
3
- s.version = "1.3.121"
3
+ s.version = "1.3.122"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3"
6
6
  s.summary = "Preliminary release of cloud process execution engine (cpee). If you just need workflow execution, without a rest/xmpp service exposing it, then use WEEL"
@@ -77,9 +77,8 @@ module CPEE
77
77
  id = @r[0].to_i
78
78
  callback = @r[2]
79
79
  controller[id].mutex.synchronize do
80
- if controller[id].callbacks.has_key?(callback) then
80
+ if controller[id].callbacks.has_key?(callback)
81
81
  controller[id].callbacks[callback].callback(@p)
82
- controller[id].callbacks.delete(callback)
83
82
  end
84
83
  end
85
84
  end
@@ -142,6 +142,19 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
142
142
  end # }}}
143
143
 
144
144
  def callback(result)
145
+ if result.length == 1
146
+ if result[0].is_a? Riddl::Parameter::Simple
147
+ result = result[0]
148
+ elsif result[0].is_a? Riddl::Parameter::Complex
149
+ if result[0].mimetype == 'application/json'
150
+ result = JSON::parse(result[0].value.read)
151
+ elsif result[0].mimetype == 'application/xml' || result[0].mimetype == 'text/xml'
152
+ result = XML::Smart::string(result[0].value.read)
153
+ else
154
+ result = result[0]
155
+ end
156
+ end
157
+ end
145
158
  @handler_returnValue = result
146
159
  @controller.callbacks.delete(@handler_passthrough)
147
160
  @handler_passthrough = nil
@@ -1,90 +1,32 @@
1
1
  <properties xmlns="http://riddl.org/ns/common-patterns/properties/1.0">
2
2
  <info>Enter info here</info>
3
- <state>ready</state>
3
+ <state>finished</state>
4
4
  <handlerwrapper>DefaultHandlerWrapper</handlerwrapper>
5
5
  <positions/>
6
6
  <dataelements>
7
- <persons>3</persons>
8
- <card>Visa_12345</card>
9
- <airline>null</airline>
10
- <hotels>[]</hotels>
11
- <from>Vienna</from>
12
- <to>Prague</to>
13
- <costs>0</costs>
7
+ <x/>
14
8
  </dataelements>
15
9
  <endpoints>
16
- <bookAir>http://gruppe.wst.univie.ac.at/~mangler/services/airline.php</bookAir>
17
- <bookHotel>http://gruppe.wst.univie.ac.at/~mangler/services/hotel.php</bookHotel>
18
- <approve>http://gruppe.wst.univie.ac.at/~mangler/services/approval.php</approve>
10
+ <timeout>http://gruppe.wst.univie.ac.at/~mangler/services/timeout.php</timeout>
11
+ <back>http://gruppe.wst.univie.ac.at/~mangler/services/callback.php</back>
19
12
  </endpoints>
20
- <dsl>call :a1, :bookAir, { :method =&gt; "post", :parameters =&gt; { :from =&gt; data.from, :to =&gt; data.to, :persons =&gt; data.persons } }, &lt;&lt;-end
21
- data.airline = result.value('id')
22
- data.costs += result.value('costs').to_f
23
- status.update 1, 'Hotel'
24
- end
25
- parallel do
26
- loop pre_test{data.persons &gt; 0} do
27
- parallel_branch data.persons do |p|
28
- call :a2, :bookHotel, { :method =&gt; "post", :parameters =&gt; { :to =&gt; data.to } }, &lt;&lt;-end
29
- data.hotels &lt;&lt; result.value('id')
30
- data.costs += result.value('costs').to_f
31
- end
32
- end
33
- manipulate :a3, &lt;&lt;-end
34
- data.persons -= 1
35
- end
36
- end
37
- end
38
- choose do
39
- alternative data.costs &gt; 700 do
40
- call :a4, :approve, { :method =&gt; "post", :parameters =&gt; { :costs =&gt; data.costs } }
41
- end
13
+ <dsl>call :a1, :back, { :method =&gt; "post", :parameters =&gt; { :timeout =&gt; 2 } }, &lt;&lt;-end
14
+ data.x += "a1,"
42
15
  end
43
16
  </dsl>
44
17
  <dslx>
45
18
  <description xmlns="http://cpee.org/ns/description/1.0">
46
- <call id="a1" endpoint="bookAir">
19
+ <call id="a1" endpoint="back">
47
20
  <parameters>
21
+ <!--{{{-->
48
22
  <method>post</method>
49
23
  <parameters>
50
- <from>data.from</from>
51
- <to>data.to</to>
52
- <persons>data.persons</persons>
24
+ <timeout>2</timeout>
53
25
  </parameters>
54
26
  </parameters>
55
- <manipulate output="result"> data.airline = result.value('id')
56
- data.costs += result.value('costs').to_f
57
- status.update 1, 'Hotel'</manipulate>
27
+ <!--}}}-->
28
+ <manipulate output="result"> data.x += "a1,"</manipulate>
58
29
  </call>
59
- <parallel>
60
- <loop pre_test="data.persons &gt; 0">
61
- <parallel_branch pass="data.persons" local="p">
62
- <call id="a2" endpoint="bookHotel">
63
- <parameters>
64
- <method>post</method>
65
- <parameters>
66
- <to>data.to</to>
67
- </parameters>
68
- </parameters>
69
- <manipulate output="result"> data.hotels &lt;&lt; result.value('id')
70
- data.costs += result.value('costs').to_f</manipulate>
71
- </call>
72
- </parallel_branch>
73
- <manipulate id="a3"> data.persons -= 1</manipulate>
74
- </loop>
75
- </parallel>
76
- <choose>
77
- <alternative condition="data.costs &gt; 700">
78
- <call id="a4" endpoint="approve">
79
- <parameters>
80
- <method>post</method>
81
- <parameters>
82
- <costs>data.costs</costs>
83
- </parameters>
84
- </parameters>
85
- </call>
86
- </alternative>
87
- </choose>
88
30
  </description>
89
31
  </dslx>
90
32
  <status>
@@ -93,48 +35,17 @@ end
93
35
  </status>
94
36
  <description>
95
37
  <description xmlns="http://cpee.org/ns/description/1.0">
96
- <call id="a1" endpoint="bookAir">
38
+ <call id="a1" endpoint="back">
97
39
  <parameters>
40
+ <!--{{{-->
98
41
  <method>post</method>
99
42
  <parameters>
100
- <from>data.from</from>
101
- <to>data.to</to>
102
- <persons>data.persons</persons>
43
+ <timeout>2</timeout>
103
44
  </parameters>
104
45
  </parameters>
105
- <manipulate output="result"> data.airline = result.value('id')
106
- data.costs += result.value('costs').to_f
107
- status.update 1, 'Hotel'</manipulate>
46
+ <!--}}}-->
47
+ <manipulate output="result"> data.x += "a1,"</manipulate>
108
48
  </call>
109
- <parallel>
110
- <loop pre_test="data.persons &gt; 0">
111
- <parallel_branch pass="data.persons" local="p">
112
- <call id="a2" endpoint="bookHotel">
113
- <parameters>
114
- <method>post</method>
115
- <parameters>
116
- <to>data.to</to>
117
- </parameters>
118
- </parameters>
119
- <manipulate output="result"> data.hotels &lt;&lt; result.value('id')
120
- data.costs += result.value('costs').to_f</manipulate>
121
- </call>
122
- </parallel_branch>
123
- <manipulate id="a3"> data.persons -= 1</manipulate>
124
- </loop>
125
- </parallel>
126
- <choose>
127
- <alternative condition="data.costs &gt; 700">
128
- <call id="a4" endpoint="approve">
129
- <parameters>
130
- <method>post</method>
131
- <parameters>
132
- <costs>data.costs</costs>
133
- </parameters>
134
- </parameters>
135
- </call>
136
- </alternative>
137
- </choose>
138
49
  </description>
139
50
  </description>
140
51
  <transformation>
@@ -1,50 +1,33 @@
1
1
  <properties xmlns="http://riddl.org/ns/common-patterns/properties/1.0">
2
- <info>Enter info here</info>
3
- <state>finished</state>
2
+ <info>asdasd</info>
3
+ <state>ready</state>
4
4
  <handlerwrapper>DefaultHandlerWrapper</handlerwrapper>
5
- <positions/>
5
+ <positions>
6
+ <a1>after</a1>
7
+ </positions>
6
8
  <dataelements>
7
- <json>{"lv":"Workflow Technologies","id":{"lvnr":"050311","gruppe":1}}</json>
8
- <json_lv>Workflow Technologies</json_lv>
9
- <json_lvnr/>
10
- <xml_lv>Workflow Technologies</xml_lv>
11
- <xml_lvnr>050311</xml_lvnr>
9
+ <x/>
12
10
  </dataelements>
13
11
  <endpoints>
14
12
  <timeout>http://gruppe.wst.univie.ac.at/~mangler/services/timeout.php</timeout>
15
- <json>http://cpee.org/services/json.php</json>
16
- <xml>http://cpee.org/services/xml.php</xml>
13
+ <back>http://gruppe.wst.univie.ac.at/~mangler/services/callback.php</back>
17
14
  </endpoints>
18
- <dsl>call :a1, :json, { :label =&gt; "Get JSON", :method =&gt; "get", :parameters =&gt; nil }, &lt;&lt;-end
19
- data.json = result
20
- data.json_lv = result['lv']
21
- data.json_lvnr = result['lv']['lvnr']
22
- end
23
- call :a2, :xml, { :label =&gt; "Get XML", :method =&gt; "get", :parameters =&gt; nil }, &lt;&lt;-end
24
- data.xml_lv = result.find('string(/data/lv)')
25
- data.xml_lvnr = result.find('string(/data/lv/@id)')
15
+ <dsl>call :a1, :back, { :method =&gt; "post", :parameters =&gt; { :timeout =&gt; 2 } }, &lt;&lt;-end
16
+ data.x += "a1,"
26
17
  end
27
18
  </dsl>
28
19
  <dslx>
29
20
  <description xmlns="http://cpee.org/ns/description/1.0">
30
- <call id="a1" endpoint="json" svg-label="Get JSON">
31
- <parameters>
32
- <label>Get JSON</label>
33
- <method>get</method>
34
- <parameters/>
35
- </parameters>
36
- <manipulate>data.json = result
37
- data.json_lv = result['lv']
38
- data.json_lvnr = result['lv']['lvnr']</manipulate>
39
- </call>
40
- <call id="a2" endpoint="xml">
21
+ <call id="a1" endpoint="back">
41
22
  <parameters>
42
- <label>Get XML</label>
43
- <method>get</method>
44
- <parameters/>
23
+ <!--{{{-->
24
+ <method>post</method>
25
+ <parameters>
26
+ <timeout>2</timeout>
27
+ </parameters>
45
28
  </parameters>
46
- <manipulate>data.xml_lv = result.find('string(/data/lv)')
47
- data.xml_lvnr = result.find('string(/data/lv/@id)')</manipulate>
29
+ <!--}}}-->
30
+ <manipulate output="result"> data.x += "a1,"</manipulate>
48
31
  </call>
49
32
  </description>
50
33
  </dslx>
@@ -54,30 +37,22 @@ data.xml_lvnr = result.find('string(/data/lv/@id)')</manipulate>
54
37
  </status>
55
38
  <description>
56
39
  <description xmlns="http://cpee.org/ns/description/1.0">
57
- <call id="a1" endpoint="json" svg-label="Get JSON">
58
- <parameters>
59
- <label>Get JSON</label>
60
- <method>get</method>
61
- <parameters/>
62
- </parameters>
63
- <manipulate>data.json = result
64
- data.json_lv = result['lv']
65
- data.json_lvnr = result['lv']['lvnr']</manipulate>
66
- </call>
67
- <call id="a2" endpoint="xml">
40
+ <call id="a1" endpoint="back">
68
41
  <parameters>
69
- <label>Get XML</label>
70
- <method>get</method>
71
- <parameters/>
42
+ <!--{{{-->
43
+ <method>post</method>
44
+ <parameters>
45
+ <timeout>2</timeout>
46
+ </parameters>
72
47
  </parameters>
73
- <manipulate>data.xml_lv = result.find('string(/data/lv)')
74
- data.xml_lvnr = result.find('string(/data/lv/@id)')</manipulate>
48
+ <!--}}}-->
49
+ <manipulate output="result"> data.x += "a1,"</manipulate>
75
50
  </call>
76
51
  </description>
77
52
  </description>
78
53
  <transformation>
79
54
  <description type="copy"/>
80
- <dataelements type="xslt"/>
81
- <endpoints type="xslt"/>
55
+ <dataelements type="rest"/>
56
+ <endpoints type="rest"/>
82
57
  </transformation>
83
58
  </properties>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cpee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.121
4
+ version: 1.3.122
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-01-01 00:00:00.000000000 Z
14
+ date: 2014-03-27 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: riddl
@@ -69,92 +69,82 @@ extra_rdoc_files:
69
69
  - README
70
70
  files:
71
71
  - server/server.rb
72
- - server/instances/3/properties.xml
73
- - server/instances/9/properties.xml
74
- - server/instances/5/properties.xml
75
- - server/instances/10/properties.xml
76
- - server/instances/1/properties.xml
77
- - server/instances/8/properties.xml
78
- - server/instances/4/properties.xml
79
- - server/instances/2/properties.xml
80
- - server/instances/7/properties.xml
81
- - server/instances/11/properties.xml
82
- - server/instances/6/properties.xml
83
- - server/resources/properties.schema.active
72
+ - server/resources/topics.xml
84
73
  - server/resources/properties.schema.finished
85
- - server/resources/transformation_dslx.xsl
74
+ - server/resources/properties.schema.active
86
75
  - server/resources/properties.init
87
- - server/resources/transformation.xml
76
+ - server/resources/transformation_dslx.xsl
88
77
  - server/resources/properties.schema.inactive
89
- - server/resources/topics.xml
90
- - server/handlerwrappers/rescue.rb
91
- - server/handlerwrappers/default.rb
78
+ - server/resources/transformation.xml
79
+ - server/instances/1/properties.xml
80
+ - server/instances/2/properties.xml
92
81
  - server/handlerwrappers/soap.rb
82
+ - server/handlerwrappers/default.rb
93
83
  - lib/engine.xml
94
- - lib/cpee/handler_properties.rb
95
- - lib/cpee/controller.rb
96
84
  - lib/cpee/callback.rb
97
- - lib/cpee/implementation.rb
98
85
  - lib/cpee/handler_notifications.rb
86
+ - lib/cpee/controller.rb
87
+ - lib/cpee/handler_properties.rb
88
+ - lib/cpee/implementation.rb
99
89
  - lib/cpee/empty_workflow.rb
100
90
  - lib/engine/instance-info.rng
101
- - lib/engine/callbacks.rng
102
91
  - lib/engine/instances.rng
92
+ - lib/engine/callbacks.rng
103
93
  - lib/cpee.xml
94
+ - cockpit/testsets/Endpoints and Data Manipulation.xml
95
+ - cockpit/testsets/TEST - Bad Loop.xml
96
+ - cockpit/testsets/Syncing P34 3.xml
97
+ - cockpit/testsets/Coopis Testset.xml
98
+ - cockpit/testsets/TEST - Wrong Positions.xml
99
+ - cockpit/testsets/ICSOC Testset.xml
100
+ - cockpit/testsets/Syncing P34.xml
101
+ - cockpit/testsets/Linear.xml
102
+ - cockpit/testsets/Syncing P34 1.xml
103
+ - cockpit/testsets/Syncing P34 2.xml
104
+ - cockpit/testsets/Mangler 2.xml
105
+ - cockpit/testsets/Mangler 1.xml
106
+ - cockpit/testsets/index.xml
107
+ - cockpit/testsets/Concurrent.xml
108
+ - cockpit/testsets/SOPROMO Test Sonification.xml
109
+ - cockpit/README
104
110
  - cockpit/css/ui.css
111
+ - cockpit/js/details.js
112
+ - cockpit/js/wfadaptor.cpee.js
113
+ - cockpit/js/instance.js
114
+ - cockpit/js/ui.js
115
+ - cockpit/js/parameters.js
116
+ - cockpit/index.html
105
117
  - cockpit/contrib/graph_example.svg
106
118
  - cockpit/contrib/tree_example.svg
107
- - cockpit/contrib/transformation2.xsl
108
119
  - cockpit/contrib/transformation1.xsl
120
+ - cockpit/contrib/transformation2.xsl
109
121
  - cockpit/contrib/legend.svg
110
122
  - cockpit/contrib/symbols.svg
111
- - cockpit/index.html
112
- - cockpit/lib/jquery.caret.min.js
113
- - cockpit/lib/strftime.min.js
114
- - cockpit/lib/wfadaptor.js
115
- - cockpit/lib/wfadaptor.css
116
123
  - cockpit/lib/jquery-ui.custom.min.js
117
- - cockpit/lib/jquery.cookie.js
118
- - cockpit/lib/parsequery.js
119
- - cockpit/lib/util.js
120
- - cockpit/lib/ui.js
121
- - cockpit/lib/wfadaptor-doc/demo2.html
122
- - cockpit/lib/wfadaptor-doc/demo1.html
123
- - cockpit/lib/wfadaptor-doc/index.html
124
- - cockpit/lib/printf.js
125
- - cockpit/lib/jquery-ui.custom.min.txt
126
- - cockpit/lib/underscore.min.js
127
124
  - cockpit/lib/contextmenu.js
128
- - cockpit/lib/contextmenu.css
129
125
  - cockpit/lib/ui.css
126
+ - cockpit/lib/contextmenu.css
127
+ - cockpit/lib/util.js
128
+ - cockpit/lib/underscore.min.js
129
+ - cockpit/lib/strftime.min.js
130
+ - cockpit/lib/printf.js
130
131
  - cockpit/lib/jquery.min.js
132
+ - cockpit/lib/jquery.cookie.js
133
+ - cockpit/lib/jquery-ui.custom.min.txt
131
134
  - cockpit/lib/jquery.svgdom.js
132
- - cockpit/testsets/Syncing P34 3.xml
133
- - cockpit/testsets/Linear.xml
134
- - cockpit/testsets/SOPROMO Test Sonification.xml
135
- - cockpit/testsets/Mangler 1.xml
136
- - cockpit/testsets/TEST - Bad Loop.xml
137
- - cockpit/testsets/index.xml
138
- - cockpit/testsets/ICSOC Testset.xml
139
- - cockpit/testsets/Syncing P34.xml
140
- - cockpit/testsets/Syncing P34 1.xml
141
- - cockpit/testsets/Endpoints and Data Manipulation.xml
142
- - cockpit/testsets/Mangler 2.xml
143
- - cockpit/testsets/Coopis Testset.xml
144
- - cockpit/testsets/Concurrent.xml
145
- - cockpit/testsets/TEST - Wrong Positions.xml
146
- - cockpit/testsets/Syncing P34 2.xml
147
- - cockpit/README
148
- - cockpit/js/instance.js
149
- - cockpit/js/details.js
150
- - cockpit/js/ui.js
151
- - cockpit/js/parameters.js
152
- - cockpit/js/wfadaptor.cpee.js
153
- - contrib/logo2-small.png
135
+ - cockpit/lib/ui.js
136
+ - cockpit/lib/parsequery.js
137
+ - cockpit/lib/wfadaptor.css
138
+ - cockpit/lib/jquery.caret.min.js
139
+ - cockpit/lib/wfadaptor.js
140
+ - cockpit/lib/wfadaptor-doc/demo1.html
141
+ - cockpit/lib/wfadaptor-doc/index.html
142
+ - cockpit/lib/wfadaptor-doc/demo2.html
154
143
  - contrib/logo2.png
155
- - contrib/logo2a.png
156
144
  - contrib/logo2a.svg
145
+ - contrib/logo2-small.png
157
146
  - contrib/logo2.svg
147
+ - contrib/logo2a.png
158
148
  - contrib/Screenshot at 2011-09-28 02:38:11.png
159
149
  - COPYING
160
150
  - FEATURES
@@ -163,9 +153,9 @@ files:
163
153
  - cpee.gemspec
164
154
  - README
165
155
  - AUTHORS
166
- - test/load.rb
167
156
  - test/testset.xml
168
157
  - test/delete.rb
158
+ - test/load.rb
169
159
  homepage: http://cpee.org/
170
160
  licenses:
171
161
  - LGPL-3
@@ -193,6 +183,6 @@ specification_version: 3
193
183
  summary: Preliminary release of cloud process execution engine (cpee). If you just
194
184
  need workflow execution, without a rest/xmpp service exposing it, then use WEEL
195
185
  test_files:
196
- - test/load.rb
197
186
  - test/testset.xml
198
187
  - test/delete.rb
188
+ - test/load.rb