networkServer.getProcessInstanceListeningPath() OR networkServer.path() // return the "root" path for a process instance where it can receive requests, which should be /running-processes/<instance-uuid>/
// Standard way: 99% of all use cases
// open a server and wait exactly for one request. afterwards, close the server again
let {req, res} = networkServer.get|post|put|delete|head(path) // same as express, but as syncronous function (no callback, no await): https://expressjs.com/en/5x/api.html#app.METHOD
res.send('Hello World');
// 0,5% of use cases: there should also be an async variant with a promise, which can handle *one* incoming request asynchronously
// the ScriptTask should not close until this one request was handled
networkServer.getAsync|postAsync|putAsync|deleteAsync|headAsync(path).then( ... )
// 0,5% of use cases: there should be a way to create a server that handles *multiple* incoming requests -> use callback (i.e. it is async and other code can run afterwards)
// the ScriptTask should not close until the server object is closed with the script task!
let server = networkServer.get|post|put|delete|head(path, (req, res) => {
res.send('Hello World');
server.close(); // important to end the script task!
});
Hotfixes - Prio 1 (on current main):
MCP:
<body>part -> the other part is useless for an AI agent but consumes tokensEngine:
ERROR-TECHNICAL. don't end the whole process - but I think, this is already the case.)tokenProcessPath(also for merges and Subprocesses, see wiki). thetokenIdshould always be just a seven-char string.definitions -> userDefinedId), process-name (definitions -> name), process-description (process -> documentation), task-id (current task), task-name (current task), task-description (documentationof current task), instance-idGateways:
nameattribute of the sequence flow), 2. Condition (one-line editor), 3. Default Path (checkbox, overrides the value on the gateway if there was already another default set). The condition should be written into the BPMN like described here: https://docs.proceed-labs.org/developer/bpmn/bpmn-gateways#xor-and-or-splitting-gatewaysfalseERROR-SEMANTICERROR-TECHNICALvariable.get()Intermediate and Boundary Timer Events
Non-typed Start Events
<process ... proceed:uiForNontypedStartEventsFileName="" >Automate several BPMN Elements:
proceed:optionalTask="true"inside the task elementthrow new ConditionSuccessful()keyword in monaco editorthrow new ConditionSuccessful()error event for Start and non-interrupting boundary eventsthrow new ConditionSuccessful()error event. (or is there a better event triggering way than using an error?)throw new ConditionSuccessful()is thrown (usually from inside a loop) or the Conditional Script ends, a new, complete Instance is created with new ids and the correct times. but also the set variables from the script should be transferred to the instance. (For now, the Engine should not automatically restart the script after it ends. This means, the condition can be fulfilled one time, a new process instance is created and afterwards the process is not activated anymore.)UserTasks Editor:
UserTaskand ScriptTask Editor: "Save" button should close the Modal. It should also show the green "Saved" pop-up (currently only ScriptTask Editor)Script Tasks:
wait(ms)function for the user to use in script tasks. If the process has been paused by the user (via the MS) during the execution ofwait(), returntrue, else returnfalse. Removeawait setTimeoutAsync()from editor (MS) and script execution (Engine) (Note: we still want an asynchronous version, but under a different name, see later). use a similar implementation like here: https://stackoverflow.com/questions/3969475/javascript-pause-settimeout -> if paused or stopped, this is how you can realize itawait setIntervalAsync()(MS Script Editor and Engine) tolet id = setInterval(clbFunc, 10);. Return no Promise anymore, but instead the interval id which should be canceable withclearInterval(id);. This is how the normal setInterval() of Node.js or Web also works, but since we offer the functions, register that this function was called and works until it is canceled withclearInterval(id);. You can then reuse the normal setInterval()setInterval()must be pauseable and stoppable, seewait()setInterval()for the next interval only starts after the last execution ended. => if the user sets an interval for every 5 seconds, he expects the interval to run each 5s (and not 5s after the last execution)setInterval()within one Script Task is currently synchronous, i.e. a long-running code (network call orwait()) blocks the start/execution of other intervals. this is wrong => if the interval code contains some of our long-running, synchronous functions (like network calls orwait()) it should only block/wait to execute the next commands that directly follow but not the parallel execution of other timers and intervals. You can test it by starting two 1s intervals and one having a wait of 5s inside the code - by usingconsole.info()you can see in the timestamps that the 1s-interval is not executed within the 5s waiting of the other (-> is that possible to achieve?)networkfunctions) synchronous (same name) -> noawaitshould be needed, so don't return a promise. (Note: we still want an asynchronous version, but under a different name, see later). at runtime, since the network functions of a script task call our function implementation, the network function should still work asynchronously in the background (don't block the JS execution) but the user does not know. our implementation returns if the network request is answered, but within our implementation also have event-handlers for pausing and stopping an open request.waitAsync(ms),network.getAsync()/postAsync()/putAsync()/deleteAsync()/headAsync()functions for the user to use in script tasks, which returns a promise. Like with the synchronous variants, make it pausable and stoppable.reject(). sometimes it seems to be done but not always. For example: it is not possible to.catch()the error if an DNS address does not exist and can not be resolved (e.g.https://abc.proceed-labs.org/). Also, other statuscodes than 2xx can be catched, but they additionally print an error message on the console (which should not be done, example: getAsync() on www.proceed-labs.org without user-agent header).networkServer.getProcessInstanceListeningPath() and networkServer.path()get|post|put|delete|head(path, [optional clb])orgetAsync|postAsync|putAsync|deleteAsync|headAsync(path)register a listening server in the Native Part of the Engine. After receiving a request to the instance path on/running-processes/<instance-uuid>/or/running-processes/latest/<process-uuid>/, forward the request to all waiting ScriptTasks of the instance-uuid or of the latest instance of a processserverObj.close();. The script task should not close before that.503with body: "this process instance is currently paused and does not handle incoming requests"400with body: "this process instance is currently paused and does not handle incoming requests"reqandresshould be similar to the express objects: https://expressjs.com/en/5x/api.html#req.app and https://expressjs.com/en/5x/api.html#res.app BUT: we can not directly use the express objects because of the serialized IPC connection to the subprocess for a script task (which blocks sending functions). So, you don't need to implement everything, just a few things: all properties and no functions onreq(read-only, thats why it is easy to serialize and transmit to the script task), these functions ofres:cookie(), clearCookie(), end(), json(), location(), send(), set(), status()(maybe less, since one response method would also be sufficient. so, you could decide betweenend(), json(), send())JS and Blockly Editor: Improve looking up the code of other ScriptTasks: in the ScriptTask Editor, add an area to open other ScriptTasks of the same and other processes (for reading and copying code). ScriptTasks of the same process should be opened in read-write mode and from different processes only in read-only mode (show a little badge in the top for the mode).
let a;), the editor shows a "redeclare block-scoped variable" errorSmall UI Improvements in JS and Blockly Editor:
JS and Blockly Editor: add the ability to write code/scripts for the event that process Pause or Stop is clicked: Add two new (Tabs?/Sub-Files?) in the Script Editor to write code that is triggered if Stop or Paused is clicked (e.g. pausing or stopping the 3D printer).
Engine: the
setVariable()functions should consider the set format, e.g. number, date, url, etc.). maybe there can also be hints in the JS Editor, if the user tries to set a wrong format.(Low Prio) For every Script Task, enable the possibility to define a "Default Network Host" with IP OR URL in the Property Panel of the BPMN Editor inside the "Automation Properties"
proceed:defaultNetworkHostfor the selected Script TasknetworkRequest.get/put/post/delete/head(path[, options])inside a script task have a path variable without a host part (e.g. just/api/users/) use the value ofproceed:defaultNetworkHostas default for the target of the network requests (if it is a valid IP or domain). For example,network.get('/api/users/')should send the request to the IP12.0.0.34if this is set in thedefaultNetworkHostattribute of the ScriptTaskMQTT Connection in MS:
logpart inside of the instance object. Therefore improve Engine Endpoint:/process/{definitions}/instance/{instanceId}?log=falseand document in wiki/processendpoint to only list an array of processes with some few meta data like described in the wiki (no bpmn or instance data => pay attention, where the endpoint is already used in PROCEED)/process/<id>/versionsendpoint to only list an array of processes with some few meta data like id and creation-date. update wiki