Why oh why does the Authoring Tool create a seperate assembly for workflows?
-
Monday, June 13, 2011 9:16 PMModerator
Hi,
<Rant>
This has been bugging me for ages. I am going through all my old workflows and redoing the Managment Pack XML so that the workflows call my assemblies directly rather than via the extra Authoring Tool assembly. I do this for all my new workflows anyway.
So, I only have to copy one assembly (my activity DLL) to the workflow server rather than 2.
Like most of us, probably, I was naive in my early days and used the Authoring Tool for everything until I discovered it's many, many frustrations.
Now I create the MP directly for my workflows without using the Authoring Tool.
It is so easy to redo to "miss out the middle man" that I am stuck wondering why on earth the Authoring Tool just doesn't do this in the first place?!
</Rant>
Thanks,
Rob
- Edited by Rob.FordMVP, Moderator Wednesday, June 15, 2011 1:47 AM
All Replies
-
Monday, June 13, 2011 9:27 PM
Do your direct workflows still show their status in the JobHistory table like the authoring tool "wrapped" workflows do?
I feel the same way as you..the extra authoring tool stuff was cumbersome and I wanted to get rid of it, but I figured there had to be a reason..the JobStatus output was the only reason I could think of, but I never tested it (you know..with some of that mythical free time :) )
If the JobStatus output isn't the reason, I, too, would like to know what the wrapper is for :)
-
Monday, June 13, 2011 9:38 PMModerator
If I am calling a workflow activity DLL using ActivityExecutionStatus then, yes, any exceptions and the status are returned and visible in the log output for the workflow without using the wrapper (as long as I code them in to be returned).
For some of my workflows, I call an exe. This method has many benefits, such as, they can be run manually if required outside of SM and they are much easier to troubleshoot/debug. For these workflows, I use an activity DLL called "ExecuteActivity" which simply gets passed the command line and parameters to run. It only returns exceptions such as "file not found" or "invalid workflow parameter". However, these EXEs produce their own log files, so this is not a problem :)
I created my ExecuteActivity.dll rather than use the built-in command line activity as I found this would hang until workflow timeout and fail in the console, even though the EXE was run successfully.
- Edited by Rob.FordMVP, Moderator Tuesday, June 14, 2011 3:49 AM
-
Tuesday, June 14, 2011 3:20 AMModerator
Oh, and PS, if you don't use the wrapper and you are using a batch size > 1 and therefore passing a WorkflowArrayParameter like this:
<WorkflowArrayParameter Name="ManualActivityId" Type="string">
<Item>$Data/BaseManagedEntityId$</Item>
</WorkflowArrayParameter>Then your custom workflow activity must accept ManualActivityId as an array and you must do a foreach (or preferred loop method) for each Id passed for whatever action you need to do.
If you use the wrapper, it presumably does this for you itself (as that is how the MP ends up) and calls your assembly once for each Id it is passed (as WorkflowParameter to your assembly).
-
Tuesday, June 14, 2011 8:21 PMModerator
I've now deleted all of the Authoring Tool assemblies and my workflows now use my workflow activity assemblies directly. All work ok and status (or exception text) returns to console, so I'm still stuck wondering why on earth the AT creates the wrapper DLL?
Perhaps it is as I mentioned above and it is purely to handle WorkflowArrayParameter to WorkflowParameter?
-
Tuesday, June 14, 2011 9:00 PMModerator
Do you talk about Microsoft.EnterpriseManagement.SystemCenter.Subscription.WindowsWorkflowTaskWriteAction?
http://opsmgr.ru -
Wednesday, June 15, 2011 2:06 AMModerator
Yes, but please ignore my previous comments on WorkflowArrayParameter and WorkflowParameter as I was getting my own examples confused.
However, the only difference I can see between using the wrapper and not using the wrapper is that with the wrapper your workflow has twice the amount of events. For example, 2 executing and 2 closed events as opposed to 1 executing and 1 closed.
-
Wednesday, June 15, 2011 1:01 PMModeratorRob, can you post XML from your MP with "wrapped" dll and your own dll. Something taling me what you talk about AuthTool-generated dll, but not about WindowsWorkflowTaskWriteAction.dll.
http://opsmgr.ru -
Tuesday, June 21, 2011 9:42 PMModerator
It is possible we have got our wires crossed :)
I am talking about AuthTool generated DLLs, yes, but it refers to WindowsWorkflowTaskWriteAction in the XML which is what I thought you meant. I am not referencing that DLL directly.
Also, one of my posts appears to be missing but basically I said ignore what I was saying about WorkflowParameter vs WorkflowArrayParameter as I had got my examples mixed up.
Wrapped example:
<WriteAction ID="WA" TypeID="SystemCenter1!Microsoft.EnterpriseManagement.SystemCenter.Subscription.WindowsWorkflowTaskWriteAction">
<Subscription>
<WindowsWorkflowConfiguration>
<AssemblyName>ProcessActualCreatedDateWorkflow</AssemblyName>
<WorkflowTypeName>WorkflowAuthoring.ProcessActualCreatedDateWorkflow</WorkflowTypeName>
<WorkflowParameters>
<WorkflowParameter Name="ActualCreatedDateActivity1_IncidentId" Type="string">$Data/BaseManagedEntityId$</WorkflowParameter>
</WorkflowParameters>
<RetryExceptions></RetryExceptions>
<RetryDelaySeconds>60</RetryDelaySeconds>
<MaximumRunningTimeSeconds>300</MaximumRunningTimeSeconds>
</WindowsWorkflowConfiguration>
</Subscription>
</WriteAction>Unwrapped example:
<WriteAction ID="WA" TypeID="SystemCenter1!Microsoft.EnterpriseManagement.SystemCenter.Subscription.WindowsWorkflowTaskWriteAction">
<Subscription>
<EnableBatchProcessing>true</EnableBatchProcessing>
<WindowsWorkflowConfiguration>
<AssemblyName>ActualCreatedDateWorkflow</AssemblyName>
<WorkflowTypeName>ActualCreatedDateWorkflow.ActualCreatedDateActivity</WorkflowTypeName>
<WorkflowParameters>
<WorkflowArrayParameter Name="IncidentId" Type="guid">
<Item>$Data/BaseManagedEntityId$</Item>
</WorkflowArrayParameter>
</WorkflowParameters>
<RetryExceptions />
<RetryDelaySeconds>60</RetryDelaySeconds>
<MaximumRunningTimeSeconds>1500</MaximumRunningTimeSeconds>
</WindowsWorkflowConfiguration>
</Subscription>
</WriteAction> -
Tuesday, June 21, 2011 9:49 PMModerator
Now I'm with you )))
Yes, you right - dll generated by AuthTool is just a Sequence Activity with hard-coded parameters. So if you create your own activity with Visual Studio you can use it directly in management pack.
http://opsmgr.ru -
Wednesday, June 22, 2011 12:09 AMModerator
Which brings me back to my original rant, I mean, question...
J
-
Wednesday, June 22, 2011 7:02 AMModerator
Workflow engine can work only with one activity. So, if you want to create some workflow with several steps (several activity) you must create Sequnece Activtiy and insert all steps at this activity.
http://opsmgr.ru- Marked As Answer by Rob.FordMVP, Moderator Wednesday, June 22, 2011 7:11 PM

