WorkflowRuntime.CreateWorkflow Yöntem
Tanım
Belirtilen parametreleri kullanarak bir iş akışı örneği oluşturur.Creates a workflow instance by using the specified parameters.
Aşırı Yüklemeler
CreateWorkflow(XmlReader, XmlReader, Dictionary<String,Object>, Guid) |
Belirtilen parametreleri kullanarak bir iş akışı örneği oluşturur.Creates a workflow instance by using the specified parameters. |
CreateWorkflow(Type, Dictionary<String,Object>, Guid) |
Belirtilen parametreleri kullanarak bir iş akışı örneği oluşturur.Creates a workflow instance by using the specified parameters. |
CreateWorkflow(XmlReader, XmlReader, Dictionary<String,Object>) |
Belirtilen XmlReader nesneleri ve belirtilen bağımsız değişkenleri kullanarak bir iş akışı örneği oluşturur Dictionary<TKey,TValue> .Creates a workflow instance by using the specified XmlReader objects and the arguments contained in the specified Dictionary<TKey,TValue>. |
CreateWorkflow(XmlReader) |
Belirtilen kullanarak bir iş akışı örneği oluşturur XmlReader .Creates a workflow instance by using the specified XmlReader. |
CreateWorkflow(Type) |
Belirtilen iş akışını kullanarak yeni bir iş akışı örneği oluşturur Type .Creates a new workflow instance by using the specified workflow Type. |
CreateWorkflow(Type, Dictionary<String,Object>) |
Belirtilen iş akışını Type ve belirtilen iş akışına dahil edilen bağımsız değişkenleri kullanarak bir iş akışı örneği oluşturur Dictionary<TKey,TValue> .Creates a workflow instance by using the specified workflow Type and the arguments to the workflow contained in the specified Dictionary<TKey,TValue>. |
Açıklamalar
İş akışı çalışma zamanı altyapısı başlatılmamışsa, CreateWorkflow Yöntemler çağırır StartRuntime .If the workflow run-time engine has not been started, the CreateWorkflow methods call StartRuntime. StartRuntimeOlası özel durumların listesi için bkz..See StartRuntime for a list of possible exceptions. İş akışı örneğini oluşturduktan sonra, WorkflowInstance.Start WorkflowInstance CreateWorkflow yürütme işlemini başlatmak için yöntemi tarafından döndürülen nesneyi çağırın.After you create the workflow instance, call WorkflowInstance.Start on the WorkflowInstance object returned by the CreateWorkflow method to begin its execution.
CreateWorkflow(XmlReader, XmlReader, Dictionary<String,Object>, Guid)
Belirtilen parametreleri kullanarak bir iş akışı örneği oluşturur.Creates a workflow instance by using the specified parameters.
public:
System::Workflow::Runtime::WorkflowInstance ^ CreateWorkflow(System::Xml::XmlReader ^ workflowDefinitionReader, System::Xml::XmlReader ^ rulesReader, System::Collections::Generic::Dictionary<System::String ^, System::Object ^> ^ namedArgumentValues, Guid instanceId);
public System.Workflow.Runtime.WorkflowInstance CreateWorkflow (System.Xml.XmlReader workflowDefinitionReader, System.Xml.XmlReader rulesReader, System.Collections.Generic.Dictionary<string,object> namedArgumentValues, Guid instanceId);
member this.CreateWorkflow : System.Xml.XmlReader * System.Xml.XmlReader * System.Collections.Generic.Dictionary<string, obj> * Guid -> System.Workflow.Runtime.WorkflowInstance
Public Function CreateWorkflow (workflowDefinitionReader As XmlReader, rulesReader As XmlReader, namedArgumentValues As Dictionary(Of String, Object), instanceId As Guid) As WorkflowInstance
Parametreler
- workflowDefinitionReader
- XmlReader
XmlReaderİş akışı tanımını içeren bir.An XmlReader that contains the workflow definition.
- namedArgumentValues
- Dictionary<String,Object>
Dictionary<TKey,TValue>İş akışının bağımsız değişkenlerini temsil eden bir dize tarafından anahtarlanan nesnelerden oluşan nesne.A Dictionary<TKey,TValue> of objects keyed by a string that represents the arguments to the workflow.
- instanceId
- Guid
Guid WorkflowInstance Oluşturulacak özel.The Guid of the specific WorkflowInstance to create.
Döndürülenler
Oluşturulan iş akışı örneği.The created workflow instance.
Özel durumlar
workflowType
null bir başvurudur ( Nothing
Visual Basic).workflowType
is a null reference (Nothing
in Visual Basic).
Açıklamalar
Oluşturulduktan sonra WorkflowInstance doğrulama üzerinde yürütülür.Before the WorkflowInstance is created, validation is executed on it. Herhangi bir doğrulama hatası oluşursa, WorkflowValidationFailedException oluşturulur.If any validation errors occur, the WorkflowValidationFailedException is thrown. Bu, basit senaryolar için iyi bir işlemdir, ancak bir sunucu ortamında her etkinleştirme için bir iş akışının yeniden doğrulanması gereksiz ek yük olabilir.This works well for simple scenarios, but in a server environment, revalidating a workflow for every activation might be unnecessary overhead.
Doğrulamayı devre dışı bırakma hakkında daha fazla bilgi için bkz ValidateOnCreate ..For more information about disabling validation, see ValidateOnCreate.
instanceId
Tarafından yüklenen herhangi bir çalışan iş akışı için iş akışı WorkflowRuntime benzersiz olmalıdır.The workflow instanceId
for any running workflows loaded by the WorkflowRuntime must be unique. Bir instanceId
iş akışı oluşturmak için bir geçirirseniz ve çalışan bir iş akışı zaten kullanıyorsa instanceId
, bir oluşturulur InvalidOperationException .If you pass an instanceId
to create a workflow and a running workflow is already using that instanceId
, an InvalidOperationException is thrown.
Parametreleri içine geçirme örneği için CreateWorkflow
bkz. Parametreler Içeren Iş akışı örneği.For an example of passing in parameters to CreateWorkflow
, see Workflow with Parameters Sample.
XML 'de tanımlanan kuralların kullanılmasına ilişkin bir örnek için, bkz. ıelse Rules örneği.For an example of using rules defined in XML, see IfElse with Rules Sample.
Şunlara uygulanır
CreateWorkflow(Type, Dictionary<String,Object>, Guid)
Belirtilen parametreleri kullanarak bir iş akışı örneği oluşturur.Creates a workflow instance by using the specified parameters.
public:
System::Workflow::Runtime::WorkflowInstance ^ CreateWorkflow(Type ^ workflowType, System::Collections::Generic::Dictionary<System::String ^, System::Object ^> ^ namedArgumentValues, Guid instanceId);
public System.Workflow.Runtime.WorkflowInstance CreateWorkflow (Type workflowType, System.Collections.Generic.Dictionary<string,object> namedArgumentValues, Guid instanceId);
member this.CreateWorkflow : Type * System.Collections.Generic.Dictionary<string, obj> * Guid -> System.Workflow.Runtime.WorkflowInstance
Public Function CreateWorkflow (workflowType As Type, namedArgumentValues As Dictionary(Of String, Object), instanceId As Guid) As WorkflowInstance
Parametreler
- namedArgumentValues
- Dictionary<String,Object>
Dictionary<TKey,TValue>İş akışının bağımsız değişkenlerini temsil eden bir dize tarafından anahtarlanan nesnelerden oluşan nesne.A Dictionary<TKey,TValue> of objects keyed by a string that represents the arguments to the workflow.
- instanceId
- Guid
Guid WorkflowInstance Oluşturulacak özel.The Guid of the specific WorkflowInstance to create.
Döndürülenler
Oluşturulan iş akışı örneği.The created workflow instance.
Özel durumlar
workflowType
null bir başvurudur ( Nothing
Visual Basic).workflowType
is a null reference (Nothing
in Visual Basic).
Açıklamalar
Oluşturulduktan sonra WorkflowInstance doğrulama üzerinde yürütülür.Before the WorkflowInstance is created, validation is executed on it. Herhangi bir doğrulama hatası oluşursa, WorkflowValidationFailedException oluşturulur.If any validation errors occur, the WorkflowValidationFailedException is thrown. Bu, basit senaryolar için iyi bir işlemdir, ancak bir sunucu ortamında her etkinleştirme için bir iş akışının yeniden doğrulanması gereksiz ek yük olabilir.This works well for simple scenarios, but in a server environment, revalidating a workflow for every activation might be unnecessary overhead.
Doğrulamayı devre dışı bırakma hakkında daha fazla bilgi için bkz ValidateOnCreate ..For more information about disabling validation, see ValidateOnCreate.
instanceId
Tarafından yüklenen herhangi bir çalışan iş akışı için iş akışı WorkflowRuntime benzersiz olmalıdır.The workflow instanceId
for any running workflows loaded by the WorkflowRuntime must be unique. Bir instanceId
iş akışı oluşturmak için bir geçirirseniz ve çalışan bir iş akışı zaten kullanıyorsa instanceId
, bir oluşturulur InvalidOperationException .If you pass an instanceId
to create a workflow and a running workflow is already using that instanceId
, an InvalidOperationException is thrown.
Parametreleri içine geçirme örneği için CreateWorkflow
bkz. Parametreler Içeren Iş akışı örneği.For an example of passing in parameters to CreateWorkflow
, see Workflow with Parameters Sample.
Şunlara uygulanır
CreateWorkflow(XmlReader, XmlReader, Dictionary<String,Object>)
Belirtilen XmlReader nesneleri ve belirtilen bağımsız değişkenleri kullanarak bir iş akışı örneği oluşturur Dictionary<TKey,TValue> .Creates a workflow instance by using the specified XmlReader objects and the arguments contained in the specified Dictionary<TKey,TValue>.
public:
System::Workflow::Runtime::WorkflowInstance ^ CreateWorkflow(System::Xml::XmlReader ^ workflowDefinitionReader, System::Xml::XmlReader ^ rulesReader, System::Collections::Generic::Dictionary<System::String ^, System::Object ^> ^ namedArgumentValues);
public System.Workflow.Runtime.WorkflowInstance CreateWorkflow (System.Xml.XmlReader workflowDefinitionReader, System.Xml.XmlReader rulesReader, System.Collections.Generic.Dictionary<string,object> namedArgumentValues);
member this.CreateWorkflow : System.Xml.XmlReader * System.Xml.XmlReader * System.Collections.Generic.Dictionary<string, obj> -> System.Workflow.Runtime.WorkflowInstance
Public Function CreateWorkflow (workflowDefinitionReader As XmlReader, rulesReader As XmlReader, namedArgumentValues As Dictionary(Of String, Object)) As WorkflowInstance
Parametreler
- workflowDefinitionReader
- XmlReader
XmlReaderİş akışı tanımını içeren bir.An XmlReader that contains the workflow definition.
- namedArgumentValues
- Dictionary<String,Object>
Dictionary<TKey,TValue>İş akışının bağımsız değişkenlerini temsil eden bir dize tarafından anahtarlanan nesnelerden oluşan nesne.A Dictionary<TKey,TValue> of objects keyed by a string that represents the arguments to the workflow.
Döndürülenler
Oluşturulan iş akışı örneği.The created workflow instance.
Özel durumlar
workflowDefinitionReader
null bir başvurudur ( Nothing
Visual Basic).workflowDefinitionReader
is a null reference (Nothing
in Visual Basic).
WorkflowRuntimeAtıldı.The WorkflowRuntime is disposed.
Açıklamalar
İş akışı örneği, tarafından başvurulan iş akışı tanımından XmlReader ve tarafından sağlanan bağımsız değişkenlerle oluşturulur namedArgumentValues
.The workflow instance is created from the workflow definition referenced by the XmlReader and the arguments supplied by namedArgumentValues
.
Oluşturulduktan sonra WorkflowInstance doğrulama üzerinde yürütülür.Before the WorkflowInstance is created, validation is executed on it. Herhangi bir doğrulama hatası oluşursa, WorkflowValidationFailedException oluşturulur.If any validation errors occur, the WorkflowValidationFailedException is thrown. Bu, basit senaryolar için iyi bir işlemdir, ancak bir sunucu ortamında her etkinleştirme için bir iş akışının yeniden doğrulanması gereksiz ek yük olabilir.This works well for simple scenarios, but in a server environment, revalidating a workflow for every activation might be unnecessary overhead.
Doğrulamayı devre dışı bırakma hakkında daha fazla bilgi için bkz ValidateOnCreate ..For more information about disabling validation, see ValidateOnCreate.
Parametreleri içine geçirme örneği için CreateWorkflow
bkz. Parametreler Içeren Iş akışı örneği.For an example of passing in parameters to CreateWorkflow
, see Workflow with Parameters Sample.
XML 'de tanımlanan kuralların kullanılmasına ilişkin bir örnek için, bkz. ıelse Rules örneği.For an example of using rules defined in XML, see IfElse with Rules Sample.
Şunlara uygulanır
CreateWorkflow(XmlReader)
public:
System::Workflow::Runtime::WorkflowInstance ^ CreateWorkflow(System::Xml::XmlReader ^ workflowDefinitionReader);
public System.Workflow.Runtime.WorkflowInstance CreateWorkflow (System.Xml.XmlReader workflowDefinitionReader);
member this.CreateWorkflow : System.Xml.XmlReader -> System.Workflow.Runtime.WorkflowInstance
Public Function CreateWorkflow (workflowDefinitionReader As XmlReader) As WorkflowInstance
Parametreler
- workflowDefinitionReader
- XmlReader
XmlReaderİş akışı tanımını içeren bir.An XmlReader that contains the workflow definition.
Döndürülenler
Oluşturulan iş akışı örneği.The created workflow instance.
Özel durumlar
workflowDefinitionReader
null bir başvurudur ( Nothing
Visual Basic).workflowDefinitionReader
is a null reference (Nothing
in Visual Basic).
WorkflowRuntimeAtıldı.The WorkflowRuntime is disposed.
Örnekler
Aşağıdaki örnek, XAML tabanlı iş akışı tanımı verilen bir iş akışının nasıl oluşturulacağını gösterir.The following example demonstrates how to create a workflow given a XAML-based workflow definition.
static void Main(string[] args)
{
using (WorkflowRuntime workflowRuntime = new WorkflowRuntime())
{
AutoResetEvent waitHandle = new AutoResetEvent(false);
workflowRuntime.WorkflowCompleted += delegate(object sender, WorkflowCompletedEventArgs e)
{
waitHandle.Set();
};
workflowRuntime.WorkflowTerminated += delegate(object sender, WorkflowTerminatedEventArgs e)
{
Console.WriteLine(e.Exception.Message);
waitHandle.Set();
};
TypeProvider typeProvider = new TypeProvider(null);
// Add referenced assemblies, if needed
// typeProvider.AddAssembly(...);
workflowRuntime.AddService(typeProvider);
using (XmlReader reader = XmlReader.Create("Workflow1.xoml"))
{
WorkflowInstance instance = workflowRuntime.CreateWorkflow(reader);
instance.Start();
}
waitHandle.WaitOne();
}
}
Açıklamalar
İş akışı örneği, tarafından başvurulan bir XAML iş akışı tanım dosyasından oluşturulur XmlReader .The workflow instance is created from a XAML workflow definition file referenced by the XmlReader.
Oluşturulduktan sonra WorkflowInstance doğrulama üzerinde yürütülür.Before the WorkflowInstance is created, validation is executed on it. Herhangi bir doğrulama hatası oluşursa, WorkflowValidationFailedException oluşturulur.If any validation errors occur, the WorkflowValidationFailedException is thrown. Bu, basit senaryolar için iyi bir işlemdir, ancak bir sunucu ortamında her etkinleştirme için bir iş akışının yeniden doğrulanması gereksiz ek yük olabilir.This works well for simple scenarios, but in a server environment, revalidating a workflow for every activation might be unnecessary overhead.
Doğrulamayı devre dışı bırakma hakkında daha fazla bilgi için bkz ValidateOnCreate ..For more information about disabling validation, see ValidateOnCreate.
Şunlara uygulanır
CreateWorkflow(Type)
public:
System::Workflow::Runtime::WorkflowInstance ^ CreateWorkflow(Type ^ workflowType);
public System.Workflow.Runtime.WorkflowInstance CreateWorkflow (Type workflowType);
member this.CreateWorkflow : Type -> System.Workflow.Runtime.WorkflowInstance
Public Function CreateWorkflow (workflowType As Type) As WorkflowInstance
Parametreler
Döndürülenler
Oluşturulan iş akışı örneği.The created workflow instance.
Özel durumlar
workflowType
null bir başvurudur ( Nothing
Visual Basic).workflowType
is a null reference (Nothing
in Visual Basic).
Örnekler
Aşağıdaki kod örneği, WorkflowInstance yöntemini kullanarak bir iş akışı konağında nesne oluşturmanın önerilen yolunu gösterir CreateWorkflow .The following code example demonstrates the recommended way to create a WorkflowInstance object in a workflow host using the CreateWorkflow method.
Bu kod örneği, bir Iş akışı örneğinin Iptal edilmesi işleminin bir parçasıdır.This code example is part of the Canceling a Workflow sample.
Type type = typeof(SampleWorkflow1);
WorkflowInstance workflowInstance = workflowRuntime.CreateWorkflow(type);
workflowInstance.Start();
Dim workflowInstance As WorkflowInstance
workflowInstance = workflowRuntime.CreateWorkflow(GetType(SampleWorkflow))
workflowInstance.Start()
Açıklamalar
Oluşturulduktan sonra WorkflowInstance doğrulama üzerinde yürütülür.Before the WorkflowInstance is created, validation is executed on it. Herhangi bir doğrulama hatası oluşursa, WorkflowValidationFailedException oluşturulur.If any validation errors occur, the WorkflowValidationFailedException is thrown. Bu, basit senaryolar için iyi bir işlemdir, ancak bir sunucu ortamında her etkinleştirme için bir iş akışının yeniden doğrulanması gereksiz ek yük olabilir.This works well for simple scenarios, but in a server environment, revalidating a workflow for every activation might be unnecessary overhead.
Doğrulamayı devre dışı bırakma hakkında daha fazla bilgi için bkz ValidateOnCreate ..For more information about disabling validation, see ValidateOnCreate.
Şunlara uygulanır
CreateWorkflow(Type, Dictionary<String,Object>)
Belirtilen iş akışını Type ve belirtilen iş akışına dahil edilen bağımsız değişkenleri kullanarak bir iş akışı örneği oluşturur Dictionary<TKey,TValue> .Creates a workflow instance by using the specified workflow Type and the arguments to the workflow contained in the specified Dictionary<TKey,TValue>.
public:
System::Workflow::Runtime::WorkflowInstance ^ CreateWorkflow(Type ^ workflowType, System::Collections::Generic::Dictionary<System::String ^, System::Object ^> ^ namedArgumentValues);
public System.Workflow.Runtime.WorkflowInstance CreateWorkflow (Type workflowType, System.Collections.Generic.Dictionary<string,object> namedArgumentValues);
member this.CreateWorkflow : Type * System.Collections.Generic.Dictionary<string, obj> -> System.Workflow.Runtime.WorkflowInstance
Public Function CreateWorkflow (workflowType As Type, namedArgumentValues As Dictionary(Of String, Object)) As WorkflowInstance
Parametreler
- namedArgumentValues
- Dictionary<String,Object>
Dictionary<TKey,TValue>İş akışının bağımsız değişkenlerini temsil eden dizeye göre anahtarlı nesnelerden oluşan nesne.A Dictionary<TKey,TValue> of objects keyed by string that represents the arguments to the workflow.
Döndürülenler
Oluşturulan iş akışı örneği.The created workflow instance.
Özel durumlar
workflowType
null bir başvurudur ( Nothing
Visual Basic).workflowType
is a null reference (Nothing
in Visual Basic).
Açıklamalar
Oluşturulduktan sonra WorkflowInstance doğrulama üzerinde yürütülür.Before the WorkflowInstance is created, validation is executed on it. Herhangi bir doğrulama hatası oluşursa, WorkflowValidationFailedException oluşturulur.If any validation errors occur, the WorkflowValidationFailedException is thrown. Bu, basit senaryolar için iyi bir işlemdir, ancak bir sunucu ortamında her etkinleştirme için bir iş akışının yeniden doğrulanması gereksiz ek yük olabilir.This works well for simple scenarios, but in a server environment, revalidating a workflow for every activation might be unnecessary overhead.
Doğrulamayı devre dışı bırakma hakkında daha fazla bilgi için bkz ValidateOnCreate ..For more information about disabling validation, see ValidateOnCreate.
Parametreleri içine geçirme örneği için CreateWorkflow
bkz. Parametreler Içeren Iş akışı örneği.For an example of passing in parameters to CreateWorkflow
, see Workflow with Parameters Sample.