Automatic activity not performing

非 Y 不嫁゛ 提交于 2019-12-05 21:25:33
Nuno Linhares

Be aware that you are using an API that is NOT supported in Automatic Activities. The only processes where you are allowed to use TOM.NET are Event System handlers and Template Building Blocks as documented here.

Automatic Workflow Activities - if not developed with VBScript - must use the CoreService interface.

The good news is that I know for a fact this works - plenty of people got it to work in many implementations. The bad news (for you) is that the error is in your code. Have you tried debugging/step-by-step through your code yet? You can attach to to the workflow process (cm_wf_svc.exe) and figure out what's wrong with the code much faster than we can.

Here's a really simple snippet to finish an activity with CoreService:

ActivityFinishData activityFinish = new ActivityFinishData
    {
        Message = "Automatically Finished from Expiration Workflow Extension"
    };
ActivityInstanceData activityInstance = 
    (ActivityInstanceData)processInstance.Activities[0];
client.FinishActivity(activityInstance.Id, activityFinish, readOptions);

BTW - If you intended to use TOM.NET anyway, why did you bother asking which API to use?

Following the Nuno's answer, yes you should change the code to use TOM or Core Services. TOM .Net is not supported because it is using a different thread apartment than the underlying technology we use for workflow (COM).

About the issue I have checked that you are calling the activity like this.

Call workflowHandler.MoveBackToActivity(Cstr(CurrentWorkItem.ID, "Create or Edit     Component")

It looks like the activity name is not matching. there are some strange characters between "Edit" and "Component"

I hope this helps.

Automatic activities are executed by the Workflow agent service. An Assigned state may indicate that it's just not being picked up by the service. Is your service running correctly, and are things like queue notifications set up properly?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!