This repository was archived by the owner on Jan 7, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexternaltask-input.html
More file actions
136 lines (116 loc) · 5.54 KB
/
externaltask-input.html
File metadata and controls
136 lines (116 loc) · 5.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<script type="text/javascript">
RED.nodes.registerType('externaltask-input', {
category: 'ProcessCube',
color: '#02AFD6',
defaults: {
name: { value: '' },
workername: { value: '' },
engine: { value: '', type: 'processcube-engine-config' },
topic: { value: '' },
topicType: { value: '' },
workerConfig: { value: '{}'},
workerConfigType: { value: 'json'},
traces: { value: [] },
},
inputs: 0,
outputs: 1,
icon: 'externaltask_input.svg',
label: function () {
return this.name || (this.topic ? `topic: ${this.topic}` : 'externaltask-input');
},
oneditprepare: function () {
$('#node-input-workerConfig').typedInput({
default: 'json',
types: ['json'],
});
$('#node-input-workerConfig').typedInput('value', this.workerConfig);
$('#node-input-workerConfig').typedInput('type', this.workerConfigType);
$('#node-input-topic').typedInput({
default: 'str',
types: ['str', 'env'],
});
$('#node-input-topic').typedInput('value', this.topic);
$('#node-input-topic').typedInput('type', this.topicType);
const allTraces = [
{ value: "start", label: "Start" },
{ value: "enter", label: "Enter" },
{ value: "exit", label: "Exit" },
{ value: "error", label: "Error" },
{ value: "finish", label: "Finish" }
];
const selectEl = $("#node-input-traces");
// Optionen einfügen
allTraces.forEach(opt => {
selectEl.append(new Option(opt.label, opt.value));
});
// Bereits gespeicherte Werte setzen
const selectedOptions = this.traces || [];
selectEl.val(selectedOptions);
},
oneditsave: function () {
this.workerConfig = $('#node-input-workerConfig').typedInput('value');
if (this.workerConfig == '') {
this.workerConfig = '{}'
$('#node-input-workerConfig').typedInput('value', '{}');
}
this.workerConfigType = $('#node-input-workerConfig').typedInput('type');
this.topic = $('#node-input-topic').typedInput('value');
this.topicType = $('#node-input-topic').typedInput('type');
const selected = $("#node-input-traces").val();
this.traces = selected;
},
});
</script>
<script type="text/html" data-template-name="externaltask-input">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-workername"><i class="fa fa-tag"></i> Workername</label>
<input type="text" id="node-input-workername" placeholder="(optional) Workername" />
</div>
<div class="form-row">
<label for="node-input-engine"><i class="fa fa-tag"></i> Engine</label>
<input type="text" id="node-input-engine" placeholder="Engine" />
</div>
<div class="form-row">
<label for="node-input-topic"><i class="fa fa-tag"></i> Topic</label>
<input type="text" id="node-input-topic" placeholder="Topic of ExternalTask" />
</div>
<div class="form-row">
<label for="node-input-workerConfig"><i class="fa fa-tag"></i> Config</label>
<input type="text" id="node-input-workerConfig" />
</div>
<div class="form-row">
<label for="node-input-traces"><i class="fa fa-check-square"></i> Traces</label>
<select id="node-input-traces" multiple size="5" style="width: 100%"></select>
</div>
</script>
<script type="text/markdown" data-help-name="externaltask-input">
Waiting for external tasks that correspond to the `Topic` configured in
the connected ProcessCube Engine for processing.
## Configs
: name (string) : The name of the node
: workername (string) : The optional name of the worker otherwise it will be generated with the pattern
nodered:NODERED_NAME-host:HOST_NAME-pid:PID-id:ID of the node
: engine (engine-node) : The ProcessCube Engine to connect to
: topic (string) : The topic of the external task
: workerConfig (object) : The configuration for the worker
### workerConfig
- workerId (string): The id of the worker
- lockDuration (number): The duration in milliseconds the external task is locked for execution
- maxTasks (number): The maximum number of tasks that can be fetched at once
- longpollingTimeout (number): The duration in milliseconds the external task is locked for execution
- payloadFilter (Req-Expression): The filter for the payload of the external task
## Outputs
: payload (string) : The payload the external task was started with.
: task (object) : The external task object
: flowNodeInstanceId (string) : The unique identifier of the external task, which is needed to complete the task
### Details
- To finish the external task the `externaltask-output` node is required.
- For handling a error while executing a flow as external task the `externaltask-error` node is required.
### References
- [The ProcessCube© Developer Network](https://processcube.io) - All documentation for the ProcessCube© platform
- [ProcessCube© LowCode Integration](https://processcube.io/docs/node-red) - LowCode integration in ProcessCube©
</script>