Home > Forum > Plugins > New task from the code level C#

New task from the code level C#
0

Hi,
I am creating a plugin for webcon in C#. I need to start a new task from the code level. Is there any dedicated function for this?
Best regards

In reply to: Daniel Krüger (Cosmo Consult)

Hi Adam,

you can achieve this with a custom action.

public override void Run(RunCustomActionParams args)
{
args.TransitionInfo.TasksToAdd.Add(new WebCon.WorkFlow.SDK.Common.Model.NewTaskData(...));


https://developer.webcon.com/2022/resources/sdk-reference/html/40cdf426-b7ad-2644-9c96-f836f641fd21.htm

Best regards,
Daniel

Hi Daniel,

Thanks a lot. do you have any example of how to use it and how it works?

Best regards,
Adam

MVP
In reply to: Adam

Hi Daniel,

Thanks a lot. do you have any example of how to use it and how it works?

Best regards,
Adam

Hi Adam,

I don't have an example. I just stumbled about this feature when I checked whether I could access all persons who will receive a task. Which is not the case.

As far as I can there's not much you can do. Deine a user, it's displayname and whether he is CC or not. There's no option to define a different task description.

Maybe an alternative would be to use the default action for creating a task. If you need to get the assignee via C# you could a business rule to return the name.

Best regards.

In reply to: Daniel Krüger (Cosmo Consult)

Hi Adam,

I don't have an example. I just stumbled about this feature when I checked whether I could access all persons who will receive a task. Which is not the case.

As far as I can there's not much you can do. Deine a user, it's displayname and whether he is CC or not. There's no option to define a different task description.

Maybe an alternative would be to use the default action for creating a task. If you need to get the assignee via C# you could a business rule to return the name.

Best regards.

Hi,

Why is only one task created, and everything executes in it, when I execute the following code in a loop:

args.TransitionInfo.TasksToAdd.Add(new WebCon.WorkFlow.SDK.Common.Model.NewTaskData(new WebCon.WorkFlow.SDK.Common.Model.UserInfo("webcon", "webcon")));

Best regards.