locked
Workflow inArgument error RRS feed

  • Question

  • I'm evaluating WF 4.0 and VS 2010. So, keeping things simple, I have an Activity that has a flowchart containing an If block that compares two arguments. 

     

    I keep getting the error: Compiler error(s) encountered processing expression "CurrentValue <> PriorValue".

    'CurrentValue' is not declared. It may be inaccessible due to its protection level.

    'PriorValue' is not declared. It may be inaccessible due to its protection level.

     

    This seems like a straight forward enough issue to resolve, but I'm stumped. 

     

    Here is the XAML file in it's entirety:

     

    <Activity mc:Ignorable="sap" x:Class="ArtisanRuleLibrary.Simple" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:a="clr-namespace:ArtisanNotifications;assembly=ArtisanNotifications" xmlns:av="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mv="clr-namespace:Microsoft.VisualBasic;assembly=System" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:s1="clr-namespace:System;assembly=System" xmlns:s2="clr-namespace:System;assembly=System.Xml" xmlns:s3="clr-namespace:System;assembly=System.Core" xmlns:s4="clr-namespace:System;assembly=System.ServiceModel" xmlns:sa="clr-namespace:System.Activities;assembly=System.Activities" xmlns:sad="clr-namespace:System.Activities.Debugger;assembly=System.Activities" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System" xmlns:scg1="clr-namespace:System.Collections.Generic;assembly=System.ServiceModel" xmlns:scg2="clr-namespace:System.Collections.Generic;assembly=System.Core" xmlns:scg3="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:sd="clr-namespace:System.Data;assembly=System.Data" xmlns:sl="clr-namespace:System.Linq;assembly=System.Core" xmlns:st="clr-namespace:System.Text;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

      <x:Members>

        <x:Property Name="CurrentValue" Type="InArgument(x:String)" />

        <x:Property Name="PriorValue" Type="InArgument(x:String)" />

      </x:Members>

      <sap:VirtualizedContainerService.HintSize>654,676</sap:VirtualizedContainerService.HintSize>

      <mva:VisualBasic.Settings>Assembly references and imported namespaces for internal implementation</mva:VisualBasic.Settings>

      <Flowchart sad:XamlDebuggerXmlReader.FileName="ChangeDetection.xaml" sap:VirtualizedContainerService.HintSize="614,636">

        <sap:WorkflowViewStateService.ViewState>

          <scg3:Dictionary x:TypeArguments="x:String, x:Object">

            <x:Boolean x:Key="IsExpanded">False</x:Boolean>

            <av:Point x:Key="ShapeLocation">270,2.5</av:Point>

            <av:Size x:Key="ShapeSize">60,75</av:Size>

            <av:PointCollection x:Key="ConnectorLocation">300,77.5 300,107.5 300,115.5</av:PointCollection>

          </scg3:Dictionary>

        </sap:WorkflowViewStateService.ViewState>

        <Flowchart.StartNode>

          <FlowStep x:Name="__ReferenceID0">

            <sap:WorkflowViewStateService.ViewState>

              <scg3:Dictionary x:TypeArguments="x:String, x:Object">

                <av:Point x:Key="ShapeLocation">200,115.5</av:Point>

                <av:Size x:Key="ShapeSize">200,49</av:Size>

              </scg3:Dictionary>

            </sap:WorkflowViewStateService.ViewState>

            <If Condition="[CurrentValue &lt;&gt; PriorValue]" DisplayName="If CurrentValue &lt;&gt; PriorValue" sap:VirtualizedContainerService.HintSize="200,49" />

          </FlowStep>

        </Flowchart.StartNode>

        <x:Reference>__ReferenceID0</x:Reference>

      </Flowchart>

    </Activity>

     

     

    Friday, March 19, 2010 6:00 PM

Answers

  • I got a minute to try it and I added a workflow console app to my project, referenced the activity library, then added the Simple activity to the workflow and then ran it. I did not get an error. What kind of workflow host are you using?

    Here is my workflow Xaml:

    <Activity mc:Ignorable="sap" x:Class="WorkflowConsoleApplication1.Workflow1" sap:VirtualizedContainerService.HintSize="240,240" mva:VisualBasic.Settings="Assembly references and imported namespaces for internal implementation" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:a="clr-namespace:ArtisanRuleLibrary;assembly=ActivityLibrary1" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mv="clr-namespace:Microsoft.VisualBasic;assembly=System" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:s1="clr-namespace:System;assembly=System" xmlns:s2="clr-namespace:System;assembly=System.Xml" xmlns:s3="clr-namespace:System;assembly=System.Core" xmlns:sad="clr-namespace:System.Activities.Debugger;assembly=System.Activities" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System" xmlns:scg1="clr-namespace:System.Collections.Generic;assembly=System.ServiceModel" xmlns:scg2="clr-namespace:System.Collections.Generic;assembly=System.Core" xmlns:scg3="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:sd="clr-namespace:System.Data;assembly=System.Data" xmlns:sl="clr-namespace:System.Linq;assembly=System.Core" xmlns:st="clr-namespace:System.Text;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
      <a:Simple CurrentValue="{x:Null}" PriorValue="{x:Null}" sad:XamlDebuggerXmlReader.FileName="C:\Users\Administrator\documents\visual studio 2010\projects\ActivityLibrary1\WorkflowConsoleApplication1\Workflow1.xaml" sap:VirtualizedContainerService.HintSize="200,200" />
    </Activity>

    and here is the kickoff code with WorkflowInvoker (generated by the workflow console app extension):

    using System;
    using System.Linq;
    using System.Activities;
    using System.Activities.Statements;

    namespace WorkflowConsoleApplication1
    {

        class Program
        {
            static void Main(string[] args)
            {
                WorkflowInvoker.Invoke(new Workflow1());
            }
        }
    }

    Thanks,


    If this answers your question, please use the "Answer" button to say so | Ben Cline
    Wednesday, March 24, 2010 6:56 PM

All replies

  • Hey, I copied the Xaml directly into a new activity on a new activity library project in VS 2010 RC and it compiled fine for me.

    Are you using Beta 2 or RC?

    Thanks, 


    If this answers your question, please use the "Answer" button to say so | Ben Cline
    Monday, March 22, 2010 4:25 AM
  • It's VS 2010 version 10.0.30128.1 RC1

     

    Also, to clarify, it's not compiling the workflow that's the issue, it's running it using WorkflowInvoker. Its at runtime that it starts throwing exceptions about not being able to find 'CurrentValue' and 'PriorValue'.

     

    Thanks!

    Monday, March 22, 2010 1:48 PM
  • I got a minute to try it and I added a workflow console app to my project, referenced the activity library, then added the Simple activity to the workflow and then ran it. I did not get an error. What kind of workflow host are you using?

    Here is my workflow Xaml:

    <Activity mc:Ignorable="sap" x:Class="WorkflowConsoleApplication1.Workflow1" sap:VirtualizedContainerService.HintSize="240,240" mva:VisualBasic.Settings="Assembly references and imported namespaces for internal implementation" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:a="clr-namespace:ArtisanRuleLibrary;assembly=ActivityLibrary1" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mv="clr-namespace:Microsoft.VisualBasic;assembly=System" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:s1="clr-namespace:System;assembly=System" xmlns:s2="clr-namespace:System;assembly=System.Xml" xmlns:s3="clr-namespace:System;assembly=System.Core" xmlns:sad="clr-namespace:System.Activities.Debugger;assembly=System.Activities" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System" xmlns:scg1="clr-namespace:System.Collections.Generic;assembly=System.ServiceModel" xmlns:scg2="clr-namespace:System.Collections.Generic;assembly=System.Core" xmlns:scg3="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:sd="clr-namespace:System.Data;assembly=System.Data" xmlns:sl="clr-namespace:System.Linq;assembly=System.Core" xmlns:st="clr-namespace:System.Text;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
      <a:Simple CurrentValue="{x:Null}" PriorValue="{x:Null}" sad:XamlDebuggerXmlReader.FileName="C:\Users\Administrator\documents\visual studio 2010\projects\ActivityLibrary1\WorkflowConsoleApplication1\Workflow1.xaml" sap:VirtualizedContainerService.HintSize="200,200" />
    </Activity>

    and here is the kickoff code with WorkflowInvoker (generated by the workflow console app extension):

    using System;
    using System.Linq;
    using System.Activities;
    using System.Activities.Statements;

    namespace WorkflowConsoleApplication1
    {

        class Program
        {
            static void Main(string[] args)
            {
                WorkflowInvoker.Invoke(new Workflow1());
            }
        }
    }

    Thanks,


    If this answers your question, please use the "Answer" button to say so | Ben Cline
    Wednesday, March 24, 2010 6:56 PM
  • Thank you for contributing to Visual Studio 2010 and visiting the Visual Studio 2010 & .NET Framework 4 prerelease Forums. 

     

    Now that we are approaching the end of the development cycle we will closing down the prerelease forums.    For more information on the release of Visual Studio 2010 please see S. Somasegar and Jason Zander’s blog:

    ·         http://blogs.msdn.com/somasegar

    ·         http://blogs.msdn.com/jasonz/

     

    If your issue has not been resolved in the release please repost your question in the Visual Studio Team forums which can be found at: 

    http://social.msdn.microsoft.com/Forums/en-US/category/visualstudio,vsarch,vsdbg,vstest,vstfs,vsdata,vsappdev,visualbasic, visualcsharp,visualc

     

    -we would certainly appreciate it!

    If you have found a bug or would like to file a suggestion for future versions please visit the Microsoft Connect Visual Studio feedback page:

    https://connect.microsoft.com/VisualStudio

    Thank you for your input into Visual Studio

    Charles Sterling

    Program Manager Visual Studio

    Friday, April 9, 2010 9:56 PM