BabyGBear

Hiya

I have a couple of composite activities with several child activities that build fine with no errors or warnings that won't appear in the toolbox. One of them I have actually used in a workflow (because it used to appear) and the code hasn't been changed.

I'm wondering if any automatic updates could be effecting them as they stopped appearing about the time we installed updates. I can get the activities to appear in my own toolbox in the rehosted designer but it wont let me use it.

Does anyone have any ideas




Re: Windows Workflow Foundation Composit Activity Problem

BabyGBear

After some testing this is a problem with the toolbox item. If I remove the toolbox item attribute for the composite activity, it works again. Unfortunately without the toolbox item it's useless in a workflow! My code for this is below. Can anyone see the problem with it

[SerializableAttribute]
internal class LsmParallelToolboxItem : ActivityToolboxItem
{
protected LsmParallelToolboxItem(SerializationInfo info, StreamingContext context)
:
base (info, context)
{ }

[PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust")]
protected override IComponent[] CreateComponentsCore(IDesignerHost host)
{
LsmParallelActivity composite = new LsmParallelActivity();
composite.Activities.Add(
new CodeBeforeBranchActivity(Resources.CodeBeforeBranchActivityName));
ParallelActivity parallel = new ParallelActivity(Resources.LsmBranchName);
parallel.Activities.Add(
new SequenceActivity(Resources.FirstBranchName));
parallel.Activities.Add(
new SequenceActivity(Resources.SecondBranchName));
composite.Activities.Add(parallel);
composite.Activities.Add(
new CodeAfterBranchActivity(Resources.CodeAfterBranchActivityName));
return new IComponent[] { composite };
}}






Re: Windows Workflow Foundation Composit Activity Problem

BabyGBear

After some testing this is a problem with the toolbox item. If I remove the toolbox item attribute for the composite activity, it works again. Unfortunately without the toolbox item it's useless in a workflow! My code for this is below. Can anyone see the problem with it

[SerializableAttribute]
internal class LsmParallelToolboxItem : ActivityToolboxItem
{
protected LsmParallelToolboxItem(SerializationInfo info, StreamingContext context)
:
base (info, context)
{ }

[PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust")]
protected override IComponent[] CreateComponentsCore(IDesignerHost host)
{
LsmParallelActivity composite = new LsmParallelActivity();
composite.Activities.Add(
new CodeBeforeBranchActivity(Resources.CodeBeforeBranchActivityName));
ParallelActivity parallel = new ParallelActivity(Resources.LsmBranchName);
parallel.Activities.Add(
new SequenceActivity(Resources.FirstBranchName));
parallel.Activities.Add(
new SequenceActivity(Resources.SecondBranchName));
composite.Activities.Add(parallel);
composite.Activities.Add(
new CodeAfterBranchActivity(Resources.CodeAfterBranchActivityName));
return new IComponent[] { composite };
}}






Re: Windows Workflow Foundation Composit Activity Problem

ElifOn - MSFT

Hi

Try deleting the CodeBeforeBranchActivity and CodeAfterBranch activity from the CreateComponentsCore and try again. If it works fine with just the parallel activity then you may have a problem in your CodeBeforeBranch and CodeAfterBranch activities. Also I believe those two activities are in a different assembly, than that might be the problem why you are unable to see the LsmParallel. Anyways let us know if it works without those two activities or not.

Thanks,

Elif






Re: Windows Workflow Foundation Composit Activity Problem

BabyGBear

Hiya Elif

Ok, I have tried that and it still doesn't work. Thanks for trying though :) The CodeBefore and Code After are infact in the same namespace and cs file as the LsmParallel class and strangely enough these two do appear. The weird thing is that this code all worked fine and I have used this activity in a workflow and everything. It just suddenly stopped working one day although no-one has touched the code according to the Team System source control. that is why I wondered if an automatic update might be the cause

I'm open to any other suggestions.






Re: Windows Workflow Foundation Composit Activity Problem

ElifOn - MSFT

Even if there might have been an automatic update on the framework it shouldnt effect this particular behavior of the workflow. So what you are saying is when we dont have the ToolBoxItem attribute on it works fine right I can just suggest couple more ways to be able to understand where the main problem is which is, just have the custom ToolBoxItem class but dont do anything in it. Is it still working Just have the override and in the return call the base.CreateComponentsCore, is it still working Remotely thats all i can think of, but if you want you are welcome to send your application to me so that i can see if anything is wrong with it.

If you are saying that it stopped working without you changing anythhing in the source code then you might want to try uninstalling workflow foundation and vs extensions and reinstalling the latest version via .NET Framework 3.0.

Hope this helps,

Thanks

Elif