locked
workflow not compiling

    Question

  • hi,

    when i have workflow without code activity i am dynamically able to compile it

    but when i am adding any code activty or any other activity which is referring to some variable or method in code besides file i am not able to compile workflow dynamically

    it is giving error member not found

    please suggest me the solution for this.

     

    here i am putting code

     

    Dim objWorkflowCompiler As WorkflowCompiler = New WorkflowCompiler()

    Dim objWorkflowCompilerParameters As WorkflowCompilerParameters = New WorkflowCompilerParameters()

    objWorkflowCompilerParameters.LanguageToUse = "VB"

    objWorkflowCompilerParameters.ReferencedAssemblies.Add("C:\CompileWorkflow\CAWorkflowService\bin\Debug\CAWorkflowService.dll")

    objWorkflowCompilerParameters.ReferencedAssemblies.Add("C:\CompileWorkflow\CAActivityLibrary\bin\CAActivityLibrary.dll")

    objWorkflowCompilerParameters.OutputAssembly = "CustomWorkflow" + Guid.NewGuid().ToString() + ".dll"

    Dim xomlfiles() As String = {"C:\CompileWorkflow\CAWorkflow\Test.xoml", "C:\CompileWorkflow\CAWorkflow\Test.xoml.vb"}

    Dim objWorkflowCompilerResults As WorkflowCompilerResults = objWorkflowCompiler.Compile(objWorkflowCompilerParameters, xomlfiles)

    If (objWorkflowCompilerResults.Errors.Count > 0) Then

    MsgBox(objWorkflowCompilerResults.Errors(0).ToString())

    Else

    end if

    Monday, January 15, 2007 9:13 AM

Answers

  • Hi,

    The workflow compiler tries to compile the xoml using the SequentialWorkflowActivity as the base class. The fact that you specify the code besides file just creates a second unrelated compilation. What you need to do is create a class derived from SequentialWorkflowActivity and add your code and properties to that. Next use this as the root type of your xoml workflow and only compile that class.

    Maurice

    Monday, January 15, 2007 11:57 AM

All replies

  • Does you XOML file contain a reference to the assemblies used?

    And what is the exact error message you are receiving?

    Maurice

    Monday, January 15, 2007 10:14 AM
  •  

    i am getting the error message

    "C:\CompileWorkflow\CAWorkflow\Test.xoml : error WF1549: Activity 'Activity1' validation failed: Path 'PatientName' used to specify member for 'Test' is invalid. Path needs to point to valid member.

    i am getting following error when i am adding code activtiy to it

    "C:\CompileWorkflow\CAWorkflow\Test.xoml : error BC30456: 'codeActivity1_ExecuteCode_2' is not a member of 'CAWorkflow.Test'." 

    my xoml file contain

    <SequentialWorkflowActivity x:Class="CAWorkflow.Test" x:Name="Test" xmlns:ns0="clr-namespace:CAActivityLibrary;Assembly=CAActivityLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/workflow">

    <ns0:SendMailActivity MailFrom="rajendra.j@mphasis.com" Body="hi" x:Name="sendMailActivity1" MailTo="rajendra.j@mphasis.com" Subject="how r u" />

    <ns0:SendPlazmaDisplay x:Name="Activity1" PatientName="{ActivityBind Test,Path=PatientName}" PatientDetail="{ActivityBind Test,Path=PatientDetail}" />

    </SequentialWorkflowActivity>

     

    and my codebeside file contain

    Public Class Test

    Inherits SequentialWorkflowActivity

    Private _PatientName As String

    Private _PatientDetail As String

    Public Property PatientName() As String

    Get

    Return _PatientName

    End Get

    Set(ByVal value As String)

    _PatientName = value

    End Set

    End Property

    Public Property PatientDetail() As String

    Get

    Return _PatientDetail

    End Get

    Set(ByVal value As String)

    _PatientDetail = value

    End Set

    End Property

    Public ReadOnly Property BodyDetail() As String

    Get

    Return "The patient " & _PatientName & "is registered with the hostpital"

    End Get

    End Property

    Public Sub exeCode()

    End Sub

     

     

    Monday, January 15, 2007 10:36 AM
  • Hi,

    The workflow compiler tries to compile the xoml using the SequentialWorkflowActivity as the base class. The fact that you specify the code besides file just creates a second unrelated compilation. What you need to do is create a class derived from SequentialWorkflowActivity and add your code and properties to that. Next use this as the root type of your xoml workflow and only compile that class.

    Maurice

    Monday, January 15, 2007 11:57 AM
  •  

    hi maurice

    it is working now

    thanks a lot

     

     

    Monday, January 15, 2007 12:24 PM
  • Maurice de Beijer said:

    Hi,

    The workflow compiler tries to compile the xoml using the SequentialWorkflowActivity as the base class. The fact that you specify the code besides file just creates a second unrelated compilation. What you need to do is create a class derived from SequentialWorkflowActivity and add your code and properties to that. Next use this as the root type of your xoml workflow and only compile that class.

    Maurice


    Hi,

    I have a problem Mems

    How would the new Xoml?

    Edson,

    Monday, March 23, 2009 2:51 PM