-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexternaltask-input.html
102 lines (87 loc) · 4.06 KB
/
externaltask-input.html
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
<script type="text/javascript">
RED.nodes.registerType('externaltask-input', {
category: 'ProcessCube',
color: '#02AFD6',
defaults: {
name: { value: '' },
engine: { value: '', type: 'processcube-engine-config' },
topic: { value: '' },
topicType: { value: '' },
workerConfig: { value: '{}'},
workerConfigType: { value: 'json'}
},
inputs: 0,
outputs: 1,
icon: 'externaltask_input.svg',
label: function () {
return this.name || '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);
},
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');
},
});
</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-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>
</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
: engine (string) : 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>