cpee 2.1.86 → 2.1.87
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/cockpit/css/llm.css +4 -1
- data/cockpit/js/llm.js +143 -16
- data/cockpit/js/llm_alternative.js +1 -18
- data/cockpit/js/ui.js +15 -15
- data/cockpit/only_llm.html +250 -0
- data/cockpit/templates/Worklist.xml +2 -1
- data/cpee.gemspec +1 -1
- data/lib/cpee/implementation.rb +1 -1
- data/lib/cpee/implementation_callbacks.rb +68 -60
- data/lib/cpee/implementation_notifications.rb +36 -25
- data/lib/cpee/implementation_properties.rb +31 -5
- data/lib/cpee/statemachine.rb +7 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2daaf617d59eef8d41794e44b8b4488db897422baaee84ad06d9fd936923c896
|
4
|
+
data.tar.gz: 075d29fb38465e916b869a0d4602f143e0e31590535d1ec38eac6ffae7eb8b01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d1d375b2bf0f363d97fa77c2e09dbd3f6d66130d328c77f9b02037b8b0951c93faa36f703a764cb85360af9220095af2836cb618baf0e4d23cd26b40d554eb8
|
7
|
+
data.tar.gz: '019b357616c43dd596200536e46226d0ee4960ada5d34e8a3d185398f9b835e451643182861b0b4cb55c54b828e1a7b69370afb6beb9f577b57631f18505979b'
|
data/cockpit/css/llm.css
CHANGED
data/cockpit/js/llm.js
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
var last_generated_model = undefined;
|
2
|
+
var last_model_before_generation =undefined;
|
3
|
+
|
1
4
|
function clean_llm_ui(status_id) {
|
2
5
|
status_div = $(`#${status_id}`);
|
3
6
|
status_div.empty();
|
@@ -5,16 +8,30 @@ function clean_llm_ui(status_id) {
|
|
5
8
|
return
|
6
9
|
}
|
7
10
|
|
8
|
-
function
|
11
|
+
function add_prompt(prompt_id,content) {
|
9
12
|
let input = $(`#${prompt_id}`);
|
10
|
-
|
13
|
+
const range = document.createRange();
|
14
|
+
const selection = window.getSelection();
|
15
|
+
range.selectNodeContents(input[0]);
|
16
|
+
selection.removeAllRanges();
|
17
|
+
selection.addRange(range);
|
18
|
+
document.execCommand('insertText', false, content);
|
19
|
+
return ;
|
20
|
+
}
|
11
21
|
|
22
|
+
function call_llm_service(status_id,prompt_id,llm_id) {
|
23
|
+
let input = $(`#${prompt_id}`);
|
24
|
+
let text = input[0].innerText;
|
25
|
+
let myllm = $(`#${llm_id}`).find(":selected").val();
|
26
|
+
if (myllm === undefined){
|
27
|
+
myllm = "gemini-2.0-flash";
|
28
|
+
}
|
12
29
|
const formData = new FormData();
|
13
30
|
const blob1 = new Blob([save['dslx']], { type: "text/xml" });
|
14
31
|
formData.append("rpst_xml", blob1);
|
15
32
|
const blob2 = new Blob([text], { type: "text/plain" });
|
16
33
|
formData.append("user_input", blob2);
|
17
|
-
const blob3 = new Blob([
|
34
|
+
const blob3 = new Blob([myllm], { type: "text/plain" });
|
18
35
|
formData.append("llm", blob3);
|
19
36
|
|
20
37
|
jQuery.ajax({
|
@@ -25,34 +42,144 @@ function call_llm_service(status_id,prompt_id) {
|
|
25
42
|
processData: false,
|
26
43
|
method: 'POST',
|
27
44
|
success: function(data){
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
headers: { 'Content-ID': 'description' },
|
33
|
-
data: data.output_cpee
|
34
|
-
});
|
35
|
-
$(`#${status_id}`).text(data.status);
|
36
|
-
$(`#${status_id}`).addClass('success');
|
45
|
+
last_model_before_generation = save['dslx'];
|
46
|
+
last_generated_model = data.output_cpee;
|
47
|
+
set_cpee_model(data.output_cpee,["<!-- Input CPEE-Tree -->\n"+data.input_cpee,"# User Input:\n"+data.user_input,"# Used LLM:\n"+data.used_llm,"%% Input Intermediate\n"+data.input_intermediate,"%% Output Intermediate\n"+data.output_intermediate,"<!-- Output CPEE-Tree -->\n"+data.output_cpee]);
|
48
|
+
set_success(status_id,data.status);
|
37
49
|
},
|
38
50
|
error: function(xhr, status, data) {
|
39
|
-
|
40
|
-
$(`#${status_id}`).addClass('error');
|
51
|
+
set_error(status_id,xhr.responseJSON.error);
|
41
52
|
}
|
42
53
|
});
|
43
54
|
|
44
55
|
input.empty();
|
45
56
|
}
|
46
57
|
|
58
|
+
function call_llm_text_service(status_id,prompt_id,llm_id,action) {
|
59
|
+
let myllm = $(`#${llm_id}`).find(":selected").val();
|
60
|
+
if (myllm === undefined){
|
61
|
+
myllm = "gemini-2.0-flash";
|
62
|
+
}
|
63
|
+
const info = save.attributes_raw.info;
|
64
|
+
const formData = new FormData();
|
65
|
+
const first = new Blob([save['dslx']], { type: "text/xml" });
|
66
|
+
formData.append("rpst_xml", first);
|
67
|
+
const second = myllm;
|
68
|
+
formData.append("llm", second);
|
69
|
+
|
70
|
+
jQuery.ajax({
|
71
|
+
url: '/llm/text/llm/',
|
72
|
+
data: formData,
|
73
|
+
cache: false,
|
74
|
+
contentType: false,
|
75
|
+
processData: false,
|
76
|
+
method: 'POST',
|
77
|
+
success: function(data){
|
78
|
+
if (action=="show"){
|
79
|
+
add_prompt(prompt_id,data["output_text"]);
|
80
|
+
} else if (action=="file") {
|
81
|
+
$('#savetext').attr('download', info + '.txt');
|
82
|
+
const encodedText = encodeURIComponent(data["output_text"]);
|
83
|
+
const dataUri = "data:text/plain;charset=utf-8," + encodedText;
|
84
|
+
const link = document.getElementById("savetext");
|
85
|
+
link.href = dataUri;
|
86
|
+
link.click();
|
87
|
+
};
|
88
|
+
last_model_before_generation = save['dslx'];
|
89
|
+
set_success(status_id,data.status);
|
90
|
+
},
|
91
|
+
error: function(xhr, status, data) {
|
92
|
+
set_error(status_id,xhr.responseJSON.error);
|
93
|
+
}
|
94
|
+
});
|
95
|
+
}
|
96
|
+
|
97
|
+
function set_cpee_model(cpee_xml,expositions=[]) {
|
98
|
+
|
99
|
+
const form_data = new FormData();
|
100
|
+
const blob = new Blob([cpee_xml], { type: "text/xml" });
|
101
|
+
form_data.append("dslx", blob);
|
102
|
+
|
103
|
+
for (const x of expositions) {
|
104
|
+
const blobi = new Blob([x], { type: "text/plain" });
|
105
|
+
form_data.append("exposition", blobi);
|
106
|
+
}
|
107
|
+
|
108
|
+
$.ajax({
|
109
|
+
type: "PUT",
|
110
|
+
url: url + "/properties/dslx/",
|
111
|
+
contentType: false,
|
112
|
+
processData: false,
|
113
|
+
data: form_data
|
114
|
+
});
|
115
|
+
}
|
116
|
+
|
117
|
+
function set_success(status_id,success_text) {
|
118
|
+
$(`#${status_id}`).text(success_text);
|
119
|
+
$(`#${status_id}`).addClass('success');
|
120
|
+
}
|
121
|
+
|
122
|
+
function set_error(status_id,error_text) {
|
123
|
+
$(`#${status_id}`).text(error_text);
|
124
|
+
$(`#${status_id}`).addClass('error');
|
125
|
+
}
|
126
|
+
|
127
|
+
function load_last_generated_model() {
|
128
|
+
set_cpee_model(last_generated_model === undefined ? save['dslx'] : last_generated_model);
|
129
|
+
}
|
130
|
+
|
131
|
+
function load_last_model_before_generation() {
|
132
|
+
set_cpee_model(last_model_before_generation === undefined ? save['dslx'] : last_model_before_generation);
|
133
|
+
}
|
134
|
+
|
135
|
+
function load_file_content(files) {
|
136
|
+
if (typeof window.FileReader !== 'function') {
|
137
|
+
console.log('FileReader not yet supported');
|
138
|
+
return;
|
139
|
+
}
|
140
|
+
var reader = new FileReader();
|
141
|
+
reader.onload = function(){
|
142
|
+
clean_llm_ui('status');
|
143
|
+
add_prompt('prompt',reader.result);
|
144
|
+
}
|
145
|
+
reader.onerror = function(){ console.log("reader error"); }
|
146
|
+
reader.onabort = function(){ console.log("reader abort"); }
|
147
|
+
reader.readAsText(files[0]);
|
148
|
+
}
|
149
|
+
|
47
150
|
$(document).ready(function() {
|
48
151
|
$(document).on('keydown','#prompt',function(e){
|
49
152
|
clean_llm_ui('status');
|
50
153
|
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
|
51
|
-
call_llm_service('status',this.id);
|
154
|
+
call_llm_service('status',this.id,'llms');
|
52
155
|
}
|
53
156
|
});
|
54
157
|
$(document).on('click','#prompt_submit_button',function(e){
|
55
158
|
clean_llm_ui('status');
|
56
|
-
call_llm_service('status','prompt');
|
159
|
+
call_llm_service('status','prompt','llms');
|
160
|
+
});
|
161
|
+
$(document).on('click','#generate_itext_button',function(e){
|
162
|
+
clean_llm_ui('status');
|
163
|
+
call_llm_text_service('status','prompt','llms','file');
|
164
|
+
});
|
165
|
+
$(document).on('click','#generate_text_button',function(e){
|
166
|
+
clean_llm_ui('status');
|
167
|
+
call_llm_text_service('status','prompt','llms','show');
|
168
|
+
});
|
169
|
+
$(document).on('click','#prompt_undo_button',function(e){
|
170
|
+
clean_llm_ui('status');
|
171
|
+
load_last_model_before_generation();
|
172
|
+
});
|
173
|
+
$(document).on('click','#prompt_attach_button',function(e){
|
174
|
+
document.getElementById('loadtxt').click();
|
175
|
+
});
|
176
|
+
$("#loadtxt").change(function(e){
|
177
|
+
let files = document.getElementById('loadtxt').files;
|
178
|
+
load_file_content(files);
|
179
|
+
});
|
180
|
+
$(document).on('drop','#prompt',function(e){
|
181
|
+
e.preventDefault();
|
182
|
+
e.stopPropagation();
|
183
|
+
load_file_content(e.originalEvent.dataTransfer.files);
|
57
184
|
});
|
58
185
|
});
|
@@ -57,7 +57,7 @@ function call_llm_service(status_id,prompt_id) {
|
|
57
57
|
|
58
58
|
function load_file_content(files) {
|
59
59
|
if (typeof window.FileReader !== 'function') {
|
60
|
-
|
60
|
+
console.log('FileReader not yet supported');
|
61
61
|
return;
|
62
62
|
}
|
63
63
|
var reader = new FileReader();
|
@@ -82,23 +82,6 @@ $(document).ready(function() {
|
|
82
82
|
clean_llm_ui('status');
|
83
83
|
call_llm_service('status','prompt');
|
84
84
|
});
|
85
|
-
/*$('#prompt').on('input',function(e) {
|
86
|
-
console.log("beforeinput");
|
87
|
-
console.log(e);
|
88
|
-
if(e.originalEvent.inputType === "insertFromDrop") {
|
89
|
-
e.preventDefault();
|
90
|
-
e.stopPropagation();
|
91
|
-
load_file_content(e.originalEvent.dataTransfer.files);
|
92
|
-
}
|
93
|
-
});*/
|
94
|
-
/*$('#prompt').on('dragover',function(e) {
|
95
|
-
e.preventDefault();
|
96
|
-
e.stopPropagation();
|
97
|
-
});
|
98
|
-
$('#prompt').on('dragenter',function(e) {
|
99
|
-
e.preventDefault();
|
100
|
-
e.stopPropagation();
|
101
|
-
});*/
|
102
85
|
$('#prompt').on('drop',function(e) {
|
103
86
|
e.preventDefault();
|
104
87
|
e.stopPropagation();
|
data/cockpit/js/ui.js
CHANGED
@@ -36,38 +36,38 @@ $(document).ready(function() {
|
|
36
36
|
success: function(res){
|
37
37
|
var res_def = config_defaults();
|
38
38
|
if (res['log-url']) { // just leave it out when it is not configured
|
39
|
-
$("body").attr('current-logs',res['log-url']);
|
39
|
+
$("body").attr('current-logs',res['log-url'].replace("%host",window.location.host));
|
40
40
|
}
|
41
41
|
if (res['res-url']) {
|
42
|
-
$("body").attr('current-resources',res['res-url']);
|
42
|
+
$("body").attr('current-resources',res['res-url'].replace("%host",window.location.host));
|
43
43
|
} else {
|
44
|
-
$("body").attr('current-resources',res_def['res-url']);
|
44
|
+
$("body").attr('current-resources',res_def['res-url'].replace("%host",window.location.host));
|
45
45
|
}
|
46
46
|
if (res['base-url']) {
|
47
|
-
$("body").attr('current-base',res['base-url']);
|
47
|
+
$("body").attr('current-base',res['base-url'].replace("%host",window.location.host));
|
48
48
|
} else {
|
49
|
-
$("body").attr('current-base',res_def['base-url']);
|
49
|
+
$("body").attr('current-base',res_def['base-url'].replace("%host",window.location.host));
|
50
50
|
}
|
51
51
|
if (res['save-url']) {
|
52
|
-
$("body").attr('current-save',res['save-url']);
|
52
|
+
$("body").attr('current-save',res['save-url'].replace("%host",window.location.host));
|
53
53
|
} else {
|
54
|
-
$("body").attr('current-save',res_def['save-url']);
|
54
|
+
$("body").attr('current-save',res_def['save-url'].replace("%host",window.location.host));
|
55
55
|
}
|
56
56
|
if (res['templates-url']) {
|
57
|
-
$("body").attr('current-templates',res['templates-url']);
|
57
|
+
$("body").attr('current-templates',res['templates-url'].replace("%host",window.location.host));
|
58
58
|
} else {
|
59
|
-
$("body").attr('current-templates',res_def['templates-url']);
|
59
|
+
$("body").attr('current-templates',res_def['templates-url'].replace("%host",window.location.host));
|
60
60
|
}
|
61
|
-
$("input[name=res-url]").val($("body").attr('current-resources'));
|
62
|
-
$("input[name=base-url]").val($("body").attr('current-base'));
|
61
|
+
$("input[name=res-url]").val($("body").attr('current-resources').replace("%host",window.location.host));
|
62
|
+
$("input[name=base-url]").val($("body").attr('current-base').replace("%host",window.location.host));
|
63
63
|
cockpit();
|
64
64
|
},
|
65
65
|
error: function(){
|
66
66
|
var res = config_defaults();
|
67
|
-
$("body").attr('current-resources',res['res-url']);
|
68
|
-
$("body").attr('current-base',res['base-url']);
|
69
|
-
$("body").attr('current-save',res['save-url']);
|
70
|
-
$("body").attr('current-templates',res['templates-url']);
|
67
|
+
$("body").attr('current-resources',res['res-url'].replace("%host",window.location.host));
|
68
|
+
$("body").attr('current-base',res['base-url'].replace("%host",window.location.host));
|
69
|
+
$("body").attr('current-save',res['save-url'].replace("%host",window.location.host));
|
70
|
+
$("body").attr('current-templates',res['templates-url'].replace("%host",window.location.host));
|
71
71
|
$("input[name=res-url]").val($("body").attr('current-resources'));
|
72
72
|
$("input[name=base-url]").val($("body").attr('current-base'));
|
73
73
|
cockpit();
|
@@ -0,0 +1,250 @@
|
|
1
|
+
<!--
|
2
|
+
This file is part of CPEE.
|
3
|
+
|
4
|
+
CPEE is free software: you can redistribute it and/or modify it under the terms
|
5
|
+
of the GNU General Public License as published by the Free Software Foundation,
|
6
|
+
either version 3 of the License, or (at your option) any later version.
|
7
|
+
|
8
|
+
CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
|
9
|
+
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
10
|
+
PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
11
|
+
|
12
|
+
You should have received a copy of the GNU General Public License along with
|
13
|
+
CPEE (file COPYING in the main directory). If not, see
|
14
|
+
<http://www.gnu.org/licenses/>.
|
15
|
+
-->
|
16
|
+
|
17
|
+
<!DOCTYPE html>
|
18
|
+
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
19
|
+
<head>
|
20
|
+
<meta charset="utf-8"/>
|
21
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
22
|
+
<title>CPEE Cockpit</title>
|
23
|
+
|
24
|
+
<!-- libs, do not modify. When local than load local libs. -->
|
25
|
+
<script type="text/javascript" src="/js_libs/jquery.min.js"></script>
|
26
|
+
<script type="text/javascript" src="/js_libs/jquery.browser.js"></script>
|
27
|
+
<script type="text/javascript" src="/js_libs/jquery.svg.min.js"></script>
|
28
|
+
<script type="text/javascript" src="/js_libs/jquery.svgdom.min.js"></script>
|
29
|
+
<script type="text/javascript" src="/js_libs/vkbeautify.js"></script>
|
30
|
+
<script type="text/javascript" src="/js_libs/util.js"></script>
|
31
|
+
<script type="text/javascript" src="/js_libs/printf.js"></script>
|
32
|
+
<script type="text/javascript" src="/js_libs/strftime.min.js"></script>
|
33
|
+
<script type="text/javascript" src="/js_libs/parsequery.js"></script>
|
34
|
+
<script type="text/javascript" src="/js_libs/underscore.min.js"></script>
|
35
|
+
<script type="text/javascript" src="/js_libs/jquery.caret.min.js"></script>
|
36
|
+
<script type="text/javascript" src="/js_libs/jquery.cookie.js"></script>
|
37
|
+
|
38
|
+
<script type="text/javascript" src="/js_libs/relaxngui.js"></script>
|
39
|
+
|
40
|
+
<script type="text/javascript" src="/js_libs/uidash.js"></script>
|
41
|
+
<script type="text/javascript" src="/js_libs/custommenu.js"></script>
|
42
|
+
|
43
|
+
<link rel="stylesheet" href="/js_libs/custommenu.css" type="text/css"/>
|
44
|
+
<link rel="stylesheet" href="/js_libs/uidash.css" type="text/css"/>
|
45
|
+
|
46
|
+
<link rel="stylesheet" href="/js_libs/relaxngui.css" type="text/css"/>
|
47
|
+
|
48
|
+
<!-- modelling ui -->
|
49
|
+
<script type="text/javascript" src="js/wfadaptor.js"></script>
|
50
|
+
<link rel="stylesheet" href="css/wfadaptor.css" type="text/css" data-include-export="true"/>
|
51
|
+
|
52
|
+
<!-- custom stuff, play arround -->
|
53
|
+
<script type="text/javascript" src="js/ui.js"></script>
|
54
|
+
<script type="text/javascript" src="js/instance.js"></script>
|
55
|
+
<script type="text/javascript" src="js/details.js"></script>
|
56
|
+
<script type="text/javascript" src="js/parameters.js"></script>
|
57
|
+
<script type="text/javascript" src="js/resources.js"></script>
|
58
|
+
<script type="text/javascript" src="js/modifiers.js"></script>
|
59
|
+
<script type="text/javascript" src="themes/base.js"></script>
|
60
|
+
|
61
|
+
<script type="text/javascript" src="js/llm.js"></script>
|
62
|
+
<link rel="stylesheet" href="css/llm.css" type="text/css"/>
|
63
|
+
|
64
|
+
<link rel="stylesheet" href="css/ui.css" type="text/css"/>
|
65
|
+
<link rel="stylesheet" href="css/resources-label.css" type="text/css"/>
|
66
|
+
<link rel="stylesheet" href="css/resources-svg.css" type="text/css" data-include-export="true"/>
|
67
|
+
<link rel="stylesheet" href="/global_ui/uicpee.css" type="text/css"/>
|
68
|
+
<style>
|
69
|
+
/* has to be fucking inline, because firefox and chrome disagree how to handle filter urls */
|
70
|
+
/* shit balls, no elegance is left in this world */
|
71
|
+
</style>
|
72
|
+
</head>
|
73
|
+
<body data-base-port="8298" data-res-port="9303" data-theme-base="themes" is="x-ui-">
|
74
|
+
<div id='disclaimer' class='hidden'> <!--{{{-->
|
75
|
+
<h1>Disclaimer</h1>
|
76
|
+
|
77
|
+
<p>
|
78
|
+
We use reasonable care in creating and presenting the functionality
|
79
|
+
found in this demonstrator. It is provided purely for demonstration purposes
|
80
|
+
and you should seek further guidance and make independent enquiries
|
81
|
+
before relying upon it.
|
82
|
+
</p>
|
83
|
+
|
84
|
+
<p>
|
85
|
+
All functionality included in this demonstrator is subject to change
|
86
|
+
without notice. We make no representation or warranty whatsoever
|
87
|
+
regarding the completeness, accuracy, adequacy, suitability or
|
88
|
+
operation of this demonstrator, or of the results it produces.
|
89
|
+
</p>
|
90
|
+
|
91
|
+
<p>
|
92
|
+
We assume no responsibility for process instances created with this
|
93
|
+
demonstrator and disclaim all liability arising from negligence or
|
94
|
+
otherwise in respect of such process instances. We will not be liable
|
95
|
+
for any damages (including, without limitation, damages for any
|
96
|
+
consequential loss or loss of business opportunities or projects, or
|
97
|
+
loss of profits) howsoever arising from use of or inability to use
|
98
|
+
this demonstrator, or from any action or omission taken as a result of
|
99
|
+
using this demonstrator.
|
100
|
+
</p>
|
101
|
+
|
102
|
+
<p>
|
103
|
+
This demonstrator is hosted in Austria. All liability is excluded to the extent
|
104
|
+
permitted by law including any implied terms. Any interpretation of its
|
105
|
+
content, claims or disputes (of whatever nature and not limited to contractual
|
106
|
+
issues) shall be subject to the exclusive jurisdiction of the Austrian Courts
|
107
|
+
under Austrian law.
|
108
|
+
</p>
|
109
|
+
|
110
|
+
<p>
|
111
|
+
All actions performed while using this demonstrator will be logged, including
|
112
|
+
the IP address of the user.
|
113
|
+
</p>
|
114
|
+
|
115
|
+
<p>
|
116
|
+
<input id='iagree' type='checkbox'/><label for='iagree'><strong>OK, I Agree with this terms. I will be a happy person, and do no evil.</strong></label>
|
117
|
+
</p>
|
118
|
+
<p>
|
119
|
+
<button id='icontinue' disabled='disabled'>Continue</button>
|
120
|
+
</p>
|
121
|
+
</div> <!--}}}-->
|
122
|
+
|
123
|
+
<div class='hidden' id='relaxngworker'></div>
|
124
|
+
|
125
|
+
<div class='menu' id='templates'></div>
|
126
|
+
<div class='menu' id='modeltypes'></div>
|
127
|
+
|
128
|
+
<template id="label">
|
129
|
+
<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg" style="position: absolute; top: 0; left: 0;" class="displaylabel">
|
130
|
+
<g transform="translate(1 %%1) rotate(-%%2)">
|
131
|
+
<rect class="displaylabel" width="200" height="14" x="8" y="0" rx="5" ry="5"/>
|
132
|
+
<path class="displaylabel" d="M10,13 0,13 8,8"/>
|
133
|
+
<path class="displaylabelinner" d="M10,11.5 8.5,11.5 8.5,9.5 10,9.5"/>
|
134
|
+
<text class="label" x="18" y="10">aaaa</text>
|
135
|
+
</g>
|
136
|
+
</svg>
|
137
|
+
</template>
|
138
|
+
|
139
|
+
<ui-tabbed id="instance">
|
140
|
+
<ui-tabbar>
|
141
|
+
<ui-tab class="switch" ></ui-tab>
|
142
|
+
<ui-tab class="" data-tab="new" id="tabnew" >New</ui-tab>
|
143
|
+
<ui-tab class="inactive hidden" data-tab="instance" id="tabinstance" >Instance</ui-tab>
|
144
|
+
<ui-behind ><a style='display:none' target='_blank' id='current-instance'></a><a style='display:none' target='_blank' id='current-instance-properties'>P</a><a style='display:none' target='_blank' id='current-instance-subscriptions'>S</a><a style='display:none' target='_blank' id='current-instance-callbacks'>C</a></ui-behind>
|
145
|
+
<ui-last ><a class="logo" href=".."></a></ui-last>
|
146
|
+
</ui-tabbar>
|
147
|
+
<ui-content>
|
148
|
+
<ui-area data-belongs-to-tab="new" id="areanew"> <!--{{{-->
|
149
|
+
<table class='x-ui-layout'>
|
150
|
+
<tr>
|
151
|
+
<td>Resources:</td>
|
152
|
+
<td><input name="res-url" type="text" value=""/></td>
|
153
|
+
<td></td>
|
154
|
+
</tr>
|
155
|
+
<tr>
|
156
|
+
<td>Engine:</td>
|
157
|
+
<td><input name="base-url" type="text" value=""/></td>
|
158
|
+
<td><button name="base">create new instance</button></td>
|
159
|
+
</tr>
|
160
|
+
<tr>
|
161
|
+
<td>Instance:</td>
|
162
|
+
<td><input name="instance-url" type="text" value=""/></td>
|
163
|
+
<td><button name="instance">monitor instance</button></td>
|
164
|
+
</tr>
|
165
|
+
</table>
|
166
|
+
</ui-area> <!--}}}-->
|
167
|
+
<ui-area data-belongs-to-tab="instance" id="areainstance" class="inactive"> <!--{{{-->
|
168
|
+
<div>
|
169
|
+
<div class='section'>
|
170
|
+
<div>
|
171
|
+
<form id='fuckchrome'>
|
172
|
+
<input type='file' name='testsetfile' id='testsetfile'/>
|
173
|
+
</form>
|
174
|
+
<button title='a template includes various settings, subscriptions or a (partial) model' name="loadtestset">load template</button><button title='a testset includes various settings, subscriptions or a model' name="loadtestsetfile">load testset</button>
|
175
|
+
</div>
|
176
|
+
<div>
|
177
|
+
<input type='file' name='modelfile' id='modelfile'/>
|
178
|
+
<button title='a standalone process model is only loadable if the currently loaded testset sucessfully prepared the current instance for the type of model' name="loadmodelfile">load model</button>
|
179
|
+
</div>
|
180
|
+
</div><div class='section'>
|
181
|
+
<a id="savetestsetfile" href="" download=""></a>
|
182
|
+
<a id="savesvgfile" href="" download=""></a>
|
183
|
+
<button title='a testset includes various settings, subscriptions and a model' name="savetestsetfile">save testset</button>
|
184
|
+
<button title='a testset includes various settings, subscriptions and a model' name="savesvgfile">save svg graph</button>
|
185
|
+
</div><div class='section' id='modifiers'>
|
186
|
+
<template id="item">
|
187
|
+
<div>
|
188
|
+
<div class='title'><strong></strong></div>
|
189
|
+
<div class='select'><select></select></div>
|
190
|
+
<div class='additional'></div>
|
191
|
+
</div>
|
192
|
+
</template>
|
193
|
+
</div>
|
194
|
+
</div>
|
195
|
+
</ui-area> <!--}}}-->
|
196
|
+
</ui-content>
|
197
|
+
</ui-tabbed>
|
198
|
+
|
199
|
+
<ui-rest id="main" class="hidden">
|
200
|
+
<ui-tabbar>
|
201
|
+
<ui-before ></ui-before>
|
202
|
+
<ui-tab class="" data-tab="details" id="tabdetails">Graph</ui-tab>
|
203
|
+
<ui-tab class="inactive" data-tab="log" id="tablog" >Log</ui-tab>
|
204
|
+
<ui-behind ><a style='display:none' target='_blank' id='current-index'>E</a><a style='display:none' target='_blank' id='current-track'>T</a><a style='display:none' target='_blank' id='current-graph'>G</a></ui-behind>
|
205
|
+
</ui-tabbar>
|
206
|
+
<ui-content>
|
207
|
+
<ui-area data-belongs-to-tab="details" id='graphcolumn' oncontextmenu='return false'>
|
208
|
+
<div id='prompt_container' class="stand_alone">
|
209
|
+
<div id='prompt' contenteditable="true" title="Please enter your modelling instructions here... CTRL-ENTER or press '➤' to submit ..." placeholder="Please enter your modelling instructions here... CTRL-ENTER or press '➤' to submit ..."></div>
|
210
|
+
</div>
|
211
|
+
<div id='status'></div>
|
212
|
+
<div id='llm_params' class="multi">
|
213
|
+
<label id="llmlabel" for="llms">Choose LLM:</label>
|
214
|
+
<select name="llms" id="llms">
|
215
|
+
<option value="gemini-2.0-flash" selected>gemini 2 Flash</option>
|
216
|
+
<option value="gemini-2.5-flash-preview-05-20">gemini 2.5 Flash</option>
|
217
|
+
<option value="gemini-2.5-pro-preview-05-06">gemini 2.5 Pro</option>
|
218
|
+
<option value="gpt-4">gpt 4</option>
|
219
|
+
<option value="gpt-4o">gpt 4o</option>
|
220
|
+
<option value="gpt-4o-mini">gpt 4o mini</option>
|
221
|
+
</select>
|
222
|
+
<a id="savetext" href="" download=""></a>
|
223
|
+
<button id='generate_text_button' class='llm_button' title='show text generated from model in text area'>Show as Text</button>
|
224
|
+
<button id='generate_itext_button' class='llm_button' title='save text generated from model to file'>Save as Text</button>
|
225
|
+
</div>
|
226
|
+
<div><input id="loadtxt" accept=".txt" type="file"/></div>
|
227
|
+
<div id='prompt_submit_container' class="multi">
|
228
|
+
<button id='prompt_undo_button' class='llm_button' title='undo (reset to state before your last submit)'>⤺</button>
|
229
|
+
<button id='prompt_attach_button' class='llm_button' title='load text from (txt) file'>📎</button>
|
230
|
+
<button id='prompt_submit_button' class='llm_button' title='submit'>➤</button>
|
231
|
+
</div>
|
232
|
+
</ui-area>
|
233
|
+
<ui-resizehandle data-belongs-to-tab="details" data-label="drag to resize"></ui-resizehandle>
|
234
|
+
<ui-area data-belongs-to-tab="details" id="detailcolumn">
|
235
|
+
<div id="modelling">
|
236
|
+
<div id='graphgrid'>
|
237
|
+
<div class="resource-label" style="display: none"></div>
|
238
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:x="http://www.w3.org/1999/xlink" id='graphcanvas' width='1' height='1'></svg>
|
239
|
+
</div>
|
240
|
+
</div>
|
241
|
+
</ui-area>
|
242
|
+
<ui-area data-belongs-to-tab="log" id="arealog" class="inactive"> <!--{{{-->
|
243
|
+
<div>Persistent Log: <a style='display:none' target='_blank' id='current-log'></a> [<a style='display:none' target='_blank' id='shifted-log'>S</a>]</div>
|
244
|
+
<table id="dat_log" class="x-ui-layout"></table>
|
245
|
+
</ui-area> <!--}}}-->
|
246
|
+
</ui-content>
|
247
|
+
</ui-rest>
|
248
|
+
|
249
|
+
</body>
|
250
|
+
</html>
|
@@ -8,8 +8,8 @@
|
|
8
8
|
<attributes>
|
9
9
|
<info>Worklist</info>
|
10
10
|
<modeltype>CPEE</modeltype>
|
11
|
-
<organisation1>http://cpee.org/~demo/orgviz/organisation_informatik.xml</organisation1>
|
12
11
|
<theme>extended</theme>
|
12
|
+
<organisation1>http://cpee.org/~demo/orgviz/organisation_informatik.xml</organisation1>
|
13
13
|
<creator>Christine Ashcreek</creator>
|
14
14
|
<author>Christine Ashcreek</author>
|
15
15
|
<design_stage>development</design_stage>
|
@@ -25,6 +25,7 @@
|
|
25
25
|
<form>https://cpee.org/~demo/form/form-f.html</form>
|
26
26
|
<role>Assistant</role>
|
27
27
|
<priority>42</priority>
|
28
|
+
<handling>single</handling>
|
28
29
|
<restrictions/>
|
29
30
|
<data>
|
30
31
|
<schaden>10000</schaden>
|
data/cpee.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "cpee"
|
3
|
-
s.version = "2.1.
|
3
|
+
s.version = "2.1.87"
|
4
4
|
s.platform = Gem::Platform::RUBY
|
5
5
|
s.license = "LGPL-3.0-or-later"
|
6
6
|
s.summary = "The cloud process execution engine (cpee.org). If you just need workflow execution, without a rest service exposing it, then use WEEL."
|
data/lib/cpee/implementation.rb
CHANGED
@@ -101,7 +101,7 @@ module CPEE
|
|
101
101
|
opts[:sse_keepalive_frequency] ||= 10
|
102
102
|
opts[:sse_connections] = {}
|
103
103
|
|
104
|
-
opts[:statemachine] = CPEE::StateMachine.new opts[:states]
|
104
|
+
opts[:statemachine] = CPEE::StateMachine.new opts[:states] do |id|
|
105
105
|
CPEE::Persistence::extract_item(id,opts,"state")
|
106
106
|
end
|
107
107
|
|
@@ -79,30 +79,34 @@ module CPEE
|
|
79
79
|
opts = @a[1]
|
80
80
|
callback = @r[-1]
|
81
81
|
|
82
|
-
if
|
83
|
-
|
84
|
-
:'callback-end',
|
85
|
-
callback,
|
86
|
-
opts[:url],
|
87
|
-
id,
|
88
|
-
{},
|
89
|
-
{},
|
90
|
-
{},
|
91
|
-
opts[:redis]
|
92
|
-
)
|
93
|
-
elsif CPEE::Persistence::extract_item(id,opts,"callback/#{callback}/type") == 'vote'
|
94
|
-
CPEE::Message::send(
|
95
|
-
:'vote-response',
|
96
|
-
callback,
|
97
|
-
opts[:url],
|
98
|
-
id,
|
99
|
-
{},
|
100
|
-
{},
|
101
|
-
'true',
|
102
|
-
opts[:redis]
|
103
|
-
)
|
82
|
+
if opts[:statemachine].final? id
|
83
|
+
@status = 410
|
104
84
|
else
|
105
|
-
|
85
|
+
if CPEE::Persistence::extract_item(id,opts,"callback/#{callback}/type") == 'callback'
|
86
|
+
CPEE::Message::send(
|
87
|
+
:'callback-end',
|
88
|
+
callback,
|
89
|
+
opts[:url],
|
90
|
+
id,
|
91
|
+
{},
|
92
|
+
{},
|
93
|
+
{},
|
94
|
+
opts[:redis]
|
95
|
+
)
|
96
|
+
elsif CPEE::Persistence::extract_item(id,opts,"callback/#{callback}/type") == 'vote'
|
97
|
+
CPEE::Message::send(
|
98
|
+
:'vote-response',
|
99
|
+
callback,
|
100
|
+
opts[:url],
|
101
|
+
id,
|
102
|
+
{},
|
103
|
+
{},
|
104
|
+
'true',
|
105
|
+
opts[:redis]
|
106
|
+
)
|
107
|
+
else
|
108
|
+
@status = 404
|
109
|
+
end
|
106
110
|
end
|
107
111
|
nil
|
108
112
|
end
|
@@ -121,54 +125,58 @@ module CPEE
|
|
121
125
|
opts = @a[1]
|
122
126
|
callback = @r[-1]
|
123
127
|
|
124
|
-
if
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
128
|
+
if opts[:statemachine].final? id
|
129
|
+
@status = 410
|
130
|
+
else
|
131
|
+
if CPEE::Persistence::extract_item(id,opts,"callback/#{callback}/type") == 'callback'
|
132
|
+
ret = {}
|
133
|
+
ret['values'] = @p.map{ |e|
|
134
|
+
# bei complex wenn kleiner 500KiB statt e.value.path e.value.read
|
135
|
+
# bei complex wenn groesser 500KiB das file ueber nginx in einem verzeichnis verfuegbar machen, mimetype auf cpee/externallink
|
136
|
+
# aendert, link auf den server in den content. Der eval macht das dann direkt.
|
137
|
+
# Alt: [e.name, e.class == Riddl::Parameter::Simple ? [:simple,e.value] : [:complex,e.mimetype,e.value.path] ]
|
138
|
+
[
|
139
|
+
e.name,
|
140
|
+
if e.class == Riddl::Parameter::Simple
|
141
|
+
[:simple,e.value]
|
142
|
+
elsif e.class == Riddl::Parameter::Complex && e.value.size <= 512000
|
143
|
+
[:complex,e.mimetype,cleanup_encoding(e.value.read)]
|
144
|
+
else
|
145
|
+
# [:complex,'cpee-external-' + e.mimetype,cleanup_encoding(e.value.read)]
|
146
|
+
[:complex, e.mimetype,cleanup_encoding(e.value.read)]
|
147
|
+
end
|
148
|
+
]
|
149
|
+
}
|
150
|
+
ret['headers'] = @h
|
144
151
|
|
145
|
-
CPEE::Message::send(
|
146
|
-
:'callback-response',
|
147
|
-
callback,
|
148
|
-
opts[:url],
|
149
|
-
id,
|
150
|
-
{},
|
151
|
-
{},
|
152
|
-
ret,
|
153
|
-
opts[:redis]
|
154
|
-
)
|
155
|
-
elsif CPEE::Persistence::extract_item(id,opts,"callback/#{callback}/type") == 'vote'
|
156
|
-
if @p.length == 1 && @p[0].name == 'continue' && @p[0].class == Riddl::Parameter::Simple
|
157
152
|
CPEE::Message::send(
|
158
|
-
:'
|
153
|
+
:'callback-response',
|
159
154
|
callback,
|
160
155
|
opts[:url],
|
161
156
|
id,
|
162
157
|
{},
|
163
158
|
{},
|
164
|
-
|
159
|
+
ret,
|
165
160
|
opts[:redis]
|
166
161
|
)
|
162
|
+
elsif CPEE::Persistence::extract_item(id,opts,"callback/#{callback}/type") == 'vote'
|
163
|
+
if @p.length == 1 && @p[0].name == 'continue' && @p[0].class == Riddl::Parameter::Simple
|
164
|
+
CPEE::Message::send(
|
165
|
+
:'vote-response',
|
166
|
+
callback,
|
167
|
+
opts[:url],
|
168
|
+
id,
|
169
|
+
{},
|
170
|
+
{},
|
171
|
+
@p[0].value,
|
172
|
+
opts[:redis]
|
173
|
+
)
|
174
|
+
else
|
175
|
+
@status = 400
|
176
|
+
end
|
167
177
|
else
|
168
|
-
@status =
|
178
|
+
@status = 503
|
169
179
|
end
|
170
|
-
else
|
171
|
-
@status = 503
|
172
180
|
end
|
173
181
|
nil
|
174
182
|
end
|
@@ -126,19 +126,22 @@ module CPEE
|
|
126
126
|
def response
|
127
127
|
id = @a[0]
|
128
128
|
opts = @a[1]
|
129
|
+
if opts[:statemachine].final? id
|
130
|
+
@status = 410
|
131
|
+
else
|
132
|
+
key = @p[0].name == 'id' ? @p.shift.value : Digest::MD5.hexdigest(Kernel::rand().to_s)
|
133
|
+
url = @p[0].name == 'url' ? @p.shift.value : nil
|
134
|
+
values = []
|
135
|
+
while @p.length > 0
|
136
|
+
topic = @p.shift.value
|
137
|
+
base = @p.shift
|
138
|
+
type = base.name
|
139
|
+
values += base.value.split(',').map { |i| File.join(topic,type[0..-2],i) }
|
140
|
+
end
|
141
|
+
@header = CPEE::Persistence::set_handler(id,opts,key,url,values)
|
129
142
|
|
130
|
-
|
131
|
-
url = @p[0].name == 'url' ? @p.shift.value : nil
|
132
|
-
values = []
|
133
|
-
while @p.length > 0
|
134
|
-
topic = @p.shift.value
|
135
|
-
base = @p.shift
|
136
|
-
type = base.name
|
137
|
-
values += base.value.split(',').map { |i| File.join(topic,type[0..-2],i) }
|
143
|
+
Riddl::Parameter::Simple.new('key',key)
|
138
144
|
end
|
139
|
-
@header = CPEE::Persistence::set_handler(id,opts,key,url,values)
|
140
|
-
|
141
|
-
Riddl::Parameter::Simple.new('key',key)
|
142
145
|
end
|
143
146
|
end #}}}
|
144
147
|
|
@@ -148,18 +151,22 @@ module CPEE
|
|
148
151
|
opts = @a[1]
|
149
152
|
key = @r.last
|
150
153
|
|
151
|
-
if
|
152
|
-
|
153
|
-
values = []
|
154
|
-
while @p.length > 0
|
155
|
-
topic = @p.shift.value
|
156
|
-
base = @p.shift
|
157
|
-
type = base.name
|
158
|
-
values += base.value.split(',').map { |i| File.join(topic,type[0..-2],i) }
|
159
|
-
end
|
160
|
-
@header = CPEE::Persistence::set_handler(id,opts,key,url,values,true)
|
154
|
+
if opts[:statemachine].final? id
|
155
|
+
@status = 410
|
161
156
|
else
|
162
|
-
|
157
|
+
if CPEE::Persistence::exists_handler?(id,opts,key)
|
158
|
+
url = @p[0].name == 'url' ? @p.shift.value : nil
|
159
|
+
values = []
|
160
|
+
while @p.length > 0
|
161
|
+
topic = @p.shift.value
|
162
|
+
base = @p.shift
|
163
|
+
type = base.name
|
164
|
+
values += base.value.split(',').map { |i| File.join(topic,type[0..-2],i) }
|
165
|
+
end
|
166
|
+
@header = CPEE::Persistence::set_handler(id,opts,key,url,values,true)
|
167
|
+
else
|
168
|
+
@status = 404
|
169
|
+
end
|
163
170
|
end
|
164
171
|
end
|
165
172
|
end #}}}
|
@@ -174,10 +181,14 @@ module CPEE
|
|
174
181
|
opts = @a[1]
|
175
182
|
key = @r.last
|
176
183
|
|
177
|
-
if
|
178
|
-
|
184
|
+
if opts[:statemachine].final? id
|
185
|
+
@status = 410
|
179
186
|
else
|
180
|
-
|
187
|
+
if CPEE::Persistence::exists_handler?(id,opts,key)
|
188
|
+
DeleteSubscription::set(id,opts,key)
|
189
|
+
else
|
190
|
+
@status = 404
|
191
|
+
end
|
181
192
|
end
|
182
193
|
nil
|
183
194
|
end
|
@@ -148,7 +148,9 @@ module CPEE
|
|
148
148
|
id = @a[0]
|
149
149
|
opts = @a[1]
|
150
150
|
if opts[:statemachine].readonly? id
|
151
|
-
@status =
|
151
|
+
@status = 423
|
152
|
+
elsif opts[:statemachine].final? id
|
153
|
+
@status = 410
|
152
154
|
else
|
153
155
|
doc = XML::Smart::string(@p[0].value.read)
|
154
156
|
doc.register_namespace 'p', 'http://cpee.org/ns/properties/2.0'
|
@@ -225,7 +227,9 @@ module CPEE
|
|
225
227
|
id = @a[0]
|
226
228
|
opts = @a[1]
|
227
229
|
if opts[:statemachine].readonly? id
|
228
|
-
@status =
|
230
|
+
@status = 423
|
231
|
+
elsif opts[:statemachine].final? id
|
232
|
+
@status = 410
|
229
233
|
else
|
230
234
|
doc = XML::Smart::string(@p[0].value.read)
|
231
235
|
doc.register_namespace 'p', 'http://cpee.org/ns/properties/2.0'
|
@@ -311,7 +315,9 @@ module CPEE
|
|
311
315
|
id = @a[0]
|
312
316
|
opts = @a[1]
|
313
317
|
if opts[:statemachine].readonly? id
|
314
|
-
@status =
|
318
|
+
@status = 423
|
319
|
+
elsif opts[:statemachine].final? id
|
320
|
+
@status = 410
|
315
321
|
else
|
316
322
|
PutStatus::set id, opts, @p[0].value.read
|
317
323
|
end
|
@@ -361,6 +367,8 @@ module CPEE
|
|
361
367
|
opts = @a[1]
|
362
368
|
if opts[:statemachine].readonly? id
|
363
369
|
@status = 423
|
370
|
+
elsif opts[:statemachine].final? id
|
371
|
+
@status = 410
|
364
372
|
else
|
365
373
|
PutExecutionHandler::set(id,opts,@p[0].value)
|
366
374
|
end
|
@@ -397,6 +405,8 @@ module CPEE
|
|
397
405
|
opts = @a[2]
|
398
406
|
if opts[:statemachine].readonly? id
|
399
407
|
@status = 423
|
408
|
+
elsif opts[:statemachine].final? id
|
409
|
+
@status = 410
|
400
410
|
else
|
401
411
|
begin
|
402
412
|
PatchItems::set(item,id,opts,@p[0].value.read)
|
@@ -426,6 +436,8 @@ module CPEE
|
|
426
436
|
opts = @a[2]
|
427
437
|
if opts[:statemachine].readonly? id
|
428
438
|
@status = 423
|
439
|
+
elsif opts[:statemachine].final? id
|
440
|
+
@status = 410
|
429
441
|
else
|
430
442
|
begin
|
431
443
|
PutItems::set(item,id,opts,@p[0].value.read)
|
@@ -443,6 +455,8 @@ module CPEE
|
|
443
455
|
opts = @a[2]
|
444
456
|
if opts[:statemachine].readonly? id
|
445
457
|
@status = 423
|
458
|
+
elsif opts[:statemachine].final? id
|
459
|
+
@status = 410
|
446
460
|
else
|
447
461
|
begin
|
448
462
|
doc = XML::Smart::string(@p[0].value.read)
|
@@ -496,6 +510,8 @@ module CPEE
|
|
496
510
|
val = { @r.last => nil }
|
497
511
|
if opts[:statemachine].readonly? id
|
498
512
|
@status = 423
|
513
|
+
elsif opts[:statemachine].final? id
|
514
|
+
@status = 410
|
499
515
|
else
|
500
516
|
if CPEE::Persistence::extract_item(id,opts,@r.join('/'))
|
501
517
|
CPEE::Persistence::set_list(id,opts,item,val,val.keys)
|
@@ -555,6 +571,8 @@ module CPEE
|
|
555
571
|
opts = @a[1]
|
556
572
|
if opts[:statemachine].readonly? id
|
557
573
|
@status = 423
|
574
|
+
elsif opts[:statemachine].final? id
|
575
|
+
@status = 410
|
558
576
|
else
|
559
577
|
begin
|
560
578
|
PatchPositions::set(id,opts,@p[0].value.read)
|
@@ -592,6 +610,8 @@ module CPEE
|
|
592
610
|
opts = @a[1]
|
593
611
|
if opts[:statemachine].readonly? id
|
594
612
|
@status = 423
|
613
|
+
elsif opts[:statemachine].final? id
|
614
|
+
@status = 410
|
595
615
|
else
|
596
616
|
begin
|
597
617
|
PutPositions::set(id,opts,@p[0].value.read)
|
@@ -608,6 +628,8 @@ module CPEE
|
|
608
628
|
opts = @a[1]
|
609
629
|
if opts[:statemachine].readonly? id
|
610
630
|
@status = 423
|
631
|
+
elsif opts[:statemachine].final? id
|
632
|
+
@status = 410
|
611
633
|
else
|
612
634
|
begin
|
613
635
|
doc = XML::Smart::string(@p[0].value.read)
|
@@ -832,7 +854,9 @@ module CPEE
|
|
832
854
|
opts = @a[1]
|
833
855
|
copy = @a[2]
|
834
856
|
if opts[:statemachine].readonly? id
|
835
|
-
@status =
|
857
|
+
@status = 423
|
858
|
+
elsif opts[:statemachine].final? id
|
859
|
+
@status = 410
|
836
860
|
else
|
837
861
|
begin
|
838
862
|
# force-encoding because johannes managed to sneak in ascii special characters. why the browser is not sanitizing it is beyond me.
|
@@ -880,7 +904,9 @@ module CPEE
|
|
880
904
|
id = @a[0]
|
881
905
|
opts = @a[1]
|
882
906
|
if opts[:statemachine].readonly? id
|
883
|
-
@status =
|
907
|
+
@status = 423
|
908
|
+
elsif opts[:statemachine].final? id
|
909
|
+
@status = 410
|
884
910
|
else
|
885
911
|
PutTransformation::set(id,opts,@p[0].value.read)
|
886
912
|
end
|
data/lib/cpee/statemachine.rb
CHANGED
@@ -15,10 +15,11 @@
|
|
15
15
|
module CPEE
|
16
16
|
|
17
17
|
class StateMachine
|
18
|
-
def initialize(file
|
18
|
+
def initialize(file,&state)
|
19
19
|
@states = XML::Smart.open_unprotected(file)
|
20
20
|
@state = state
|
21
|
-
@readonly =
|
21
|
+
@readonly = @states.find("/states/observable/*[*]").map { |e| e.qname.name }
|
22
|
+
@final = @states.find("/states/observable/*[not(*)]").map { |e| e.qname.name }
|
22
23
|
end
|
23
24
|
|
24
25
|
def setable?(id,nval)
|
@@ -29,6 +30,10 @@ module CPEE
|
|
29
30
|
def readonly?(id)
|
30
31
|
@readonly.include? @state.call(id)
|
31
32
|
end
|
33
|
+
|
34
|
+
def final?(id)
|
35
|
+
@final.include? @state.call(id)
|
36
|
+
end
|
32
37
|
end
|
33
38
|
|
34
39
|
end
|
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: 2.1.
|
4
|
+
version: 2.1.87
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juergen eTM Mangler
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
- Gerhard Stuermer
|
10
10
|
bindir: tools
|
11
11
|
cert_chain: []
|
12
|
-
date: 2025-06-
|
12
|
+
date: 2025-06-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: riddl
|
@@ -235,6 +235,7 @@ files:
|
|
235
235
|
- cockpit/llm.html
|
236
236
|
- cockpit/llm_alternative.html
|
237
237
|
- cockpit/model.html
|
238
|
+
- cockpit/only_llm.html
|
238
239
|
- cockpit/rngs/attributes.rng
|
239
240
|
- cockpit/rngs/dataelements.rng
|
240
241
|
- cockpit/rngs/endpoints.rng
|