다음을 통해 공유


방법: 워크플로 컴파일

세 가지 방법으로 워크플로를 생성할 수 있습니다.

  • 파일 이름 확장명이 .xoml인 워크플로 마크업 파일에서 워크플로 마크업을 사용하여 선언적으로 워크플로를 생성할 수 있습니다. 이 워크플로 파일을 워크플로 컴파일러로 컴파일하거나, 컴파일하지 않고 호스트 응용 프로그램을 통해 워크플로 런타임 엔진에 전달할 수 있습니다. 이 방법을 코드 없음 워크플로 제작이라고 합니다. 자세한 내용은 워크플로 마크업 사용을 참조하십시오. 만들어지는 파일의 확장명은 .xoml입니다.

  • 마크업 파일을 사용하여 워크플로를 선언할 수 있지만 마크업 파일은 구현 논리가 포함된 코드 파일을 사용하여 컴파일됩니다. 이 방법을 코드 분리 워크플로 제작이라고 합니다. 이 경우 만들어지는 파일의 확장명은 .xoml 및 .xoml.cs 또는 .xoml.vb입니다.

  • 코드 파일에서 Windows Workflow Foundation 개체 모델을 사용하여 워크플로를 생성할 수 있습니다. 이 방법을 코드 전용 워크플로 제작이라고 합니다. 이 경우 만들어지는 파일의 확장명은 표준 C# 또는 Visual Basic 소스 코드 파일 확장명입니다. 이러한 파일도 컴파일됩니다.

컴파일 프로세스

워크플로가 컴파일될 때 다음 절차가 컴파일 프로세스의 일부로 수행됩니다.

  • 워크플로 활동이 자체적으로 설정된 규칙에 따라 유효성을 검사하는지 확인하기 위해 유효성 검사가 수행됩니다. 유효성 검사 오류가 발생하면 컴파일러에서 오류 목록을 반환합니다.

  • 컴파일러에 입력된 마크업 정의에서 partial 클래스가 생성됩니다.

  • 활동의 런타임 실행을 돕기 위해 코드가 생성됩니다. 포함된 활동의 실행이 완료될 때 포함하는 활동에 알려주는 이벤트 구독이 생성됩니다.

  • 마크업 파일에서 생성된 partial 클래스와 코드 파일에서 생성된 partial 클래스가 .NET Framework C# 또는 Visual Basic 컴파일러에 입력됩니다. 이 프로세스의 출력은 .NET 어셈블리인 WorkflowSample.dll입니다. 이 파일을 배포하여 워크플로를 실행할 수 있습니다.

wfc.exe 워크플로 명령줄 컴파일러 사용

Windows Workflow Foundation에서는 wfc.exe라는 명령줄 워크플로 컴파일러를 제공합니다. 또한 사용자 지정 컴파일러 개발을 위해 워크플로 컴파일을 지원하는 일련의 public 형식도 제공합니다. 이러한 public 형식은 wfc.exe에서 내부적으로 사용되는 동일한 형식입니다. WorkflowCompiler 클래스를 사용하여 사용자 지정 버전의 컴파일러를 만들 수 있습니다.

또한 아래의 간단한 예제와 같이 WorkflowCompiler 클래스를 사용하여 워크플로를 컴파일할 수도 있습니다.

WorkflowCompiler compiler = new WorkflowCompiler();
WorkflowCompilerParameters param = new WorkflowCompilerParameters();
compiler.Compile(param, new string[] { "MainWorkflow.xoml" });

자세한 내용은 Windows Workflow Foundation Class Library 참조에서 WorkflowCompiler 클래스를 참조하십시오.

컴파일러 옵션

wfc.exe 워크플로 명령줄 컴파일러 옵션은 다음 코드 스타일 항목에 설명되어 있습니다.

Microsoft (R) Windows Workflow Compiler version 3.0.0.0
Copyright (C) Microsoft Corporation 2005. All rights reserved.

                  Windows Workflow Compiler Options

wfc.exe <Xoml file list> /target:assembly [<vb/cs file list>] [/language:...] 
        [/out:...] [/reference:...] [/library:...] [/debug...] [/nocode...] 
         [/checktypes...] [/resource:<resource info>]

                        - OUTPUT FILE -
/out:<file>             Output file name
/target:assembly        Build a Windows Workflow assembly (default).
                        Short form: /t:assembly
/target:exe             Build a Windows Workflow application.
                        Short form: /t:exe
/delaysign[+|-]         Delay-sign the assembly using only the public portion
                        of the strong name key.
/keyfile:<file>         Specifies a strong name key file.
/keycontainer:<string>  Specifies a strong name key container.

                        - INPUT FILES -
<Xoml file list>        Xoml source file name(s).
<vb/cs file list>       Code-beside file name(s).
/reference:<file list>  Reference metadata from the specified assembly file(s).
                        Short form is '/r:'.
/library:<path list>    Set of directories where to lookup for the references.
                        Short form is '/lib:'.
/resource:<resinfo>     Embed the specified resource. Short form is '/res:'.
                        resinfo format is <file>[,<name>[,public|private]].

Rules and freeform layout files must be embedded as assembly resources.
The resource name is constructed by using the namespace and type name
of the activity. For example, an activity named "MyActivity" in namespace
"WFProject" would require resource names "WFProject.MyActivity.rules"
and/or "WFProject.MyActivity.layout".

                        - CODE GENERATION -
/debug[+|-]             Emit full debugging information. The default is '+'.
/nocode[+|-]            Disallow code-beside model.
                        The default is '-'. Short form is '/nc:'.
/checktypes[+|-]        Check for permitted types in wfc.exe.config file.
                        The default is '-'. Short form is '/ct:'.

                        - LANGUAGE -
/language:[cs|vb]       The language to use for the generated class.
                        The default is 'CS' (C#). Short form is '/l:'.
/rootnamespace:<string> Specifies the root Namespace for all type declarations.
                        Valid only for 'VB' (Visual Basic) language.
                        Short form is '/rns:'.

                        - MISCELLANEOUS -
/help                   Display this usage message. Short form is '/?'.
/nologo                 Suppress compiler copyright message. Short form is '/n'.

/nowarn                 Ignore compiler warnings. Short form is '/w'.

참고 항목

참조

WorkflowCompiler

개념

워크플로 제작 모드
사용자 지정 활동 Serialize
방법: 워크플로 Serialize

Footer image

Copyright © 2007 by Microsoft Corporation. All rights reserved.