is there a possibility to execute a script when a task is created using the new task?s taskid in this script? I would like to start an action, e.g. send a message to a message queue containing the current taskid. And how can I use this taskid then in the script? Is it _task.taskid?
There is an event TWorkflowStudio.OnTaskCreated you can use to execute code when a new task instance is created. It's Delphi code though, not script. Of course, you can let your users add scripts somehow and then from your custom Delphi code in OnTaskCreated, you execute a script.
From the workflow designer, it's not possible to setup such mechanism.
thank You for this promising idea. Just two questions:
1. is it possible, to add an unconnected Scipting-Block to a diagram and execute the diagram even if the check workflow shows errors (missing link)?
2. how can I execute this script in code - in the OnTaskCreated-event? Do You have a code snippet?
If this works I can add an empty Scripting-Block to my diagram and execute this script on every task creation. If there is any code inside, this code executes, if there is not, nothing happens.
I think i would be too cumbersome. You would even have reports saying the block is not connected to any other block. I think it's easier that you manage the scripts yourself somehow, and then just load/execute it in the event.