Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Execute script on task creation using taskid

 Post Reply Post Reply
Author
Schmid Harald View Drop Down
New Member
New Member
Avatar

Joined: 01 Sep 2016
Posts: 26
Post Options Post Options   Quote Schmid Harald Quote  Post ReplyReply Direct Link To This Post Topic: Execute script on task creation using taskid
    Posted: 04 Jan 2019 at 6:21am
Hello,
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?
Regards
Harald
Back to Top
Wagner R. Landgraf View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2389
Post Options Post Options   Quote Wagner R. Landgraf Quote  Post ReplyReply Direct Link To This Post Posted: 06 Jan 2019 at 10:53pm
Hello,
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.

Back to Top
Schmid Harald View Drop Down
New Member
New Member
Avatar

Joined: 01 Sep 2016
Posts: 26
Post Options Post Options   Quote Schmid Harald Quote  Post ReplyReply Direct Link To This Post Posted: 07 Jan 2019 at 6:48am
Hello Wagner,
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.
Regards
Harald
Back to Top
Wagner R. Landgraf View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2389
Post Options Post Options   Quote Wagner R. Landgraf Quote  Post ReplyReply Direct Link To This Post Posted: 07 Jan 2019 at 4:46pm
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.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down