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

Change the task user

 Post Reply Post Reply
Author
Bottosso Irapuan View Drop Down
New Member
New Member
Avatar

Joined: 04 Sep 2013
Posts: 2
Post Options Post Options   Quote Bottosso Irapuan Quote  Post ReplyReply Direct Link To This Post Topic: Change the task user
    Posted: 01 Nov 2013 at 3:18pm
How I can change the user of the next task of my process in runtime? Or how can I get the user of the previous task?

Back to Top
Wagner R. Landgraf View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2434
Post Options Post Options   Quote Wagner R. Landgraf Quote  Post ReplyReply Direct Link To This Post Posted: 04 Nov 2013 at 12:53pm
Here is an example about how to change the user of a task instance from Delphi code.
You can do some integration with the scripting system to allow calling such a code and passing parameters (like the name of the user, for example). Note that this changes the user for a task that is already created, and you need to know the id of the task.
Also note that when creating a task definition, instead of inserting the name of user in the assignment, you can put a variable name between brackets. Thus during the workflow execution, you can just update that variable value with user id to make the specified task to be created for that use.

var TI : TTaskInstance;
begin
  try
    TI       := TTaskInstance.Create(nil);
    TI.Key   := ATaskIns.Key;
    WorkflowStudio.TaskManager.LoadTaskInstance(TI);

    TI.UserId := ‘someuser’;
    WorkflowStudio.TaskManager.SaveTaskInstance(TI);
  finally
    TI.Free;
  end;
end;

Back to Top
Bottosso Irapuan View Drop Down
New Member
New Member
Avatar

Joined: 04 Sep 2013
Posts: 2
Post Options Post Options   Quote Bottosso Irapuan Quote  Post ReplyReply Direct Link To This Post Posted: 05 Nov 2013 at 6:43am
Great, thanks
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down