/// <summary> /// Initializes a new instance of the <see cref="WorkflowChangesScope"/> class. /// </summary> /// <param name="entity">The entity.</param> protected WorkflowChangesScope(WorkflowDefinitionEntity entity) { this.InstanceId = entity.PrimaryKeyId.HasValue? (Guid)entity.PrimaryKeyId.Value: Guid.Empty; this.WorkflowEntity = entity; this.TransientWorkflow = McWorkflowSerializer.GetObject <CompositeActivity>((string)this.WorkflowEntity[WorkflowInstanceEntity.FieldXaml]); }
/// <summary> /// Creates the workflow view. /// </summary> /// <param name="instance">The instance.</param> /// <returns></returns> public static WorkflowView CreateWorkflowView(WorkflowInstanceEntity instance) { if (instance == null) { throw new ArgumentNullException("instance"); } return(CreateWorkflowView(McWorkflowSerializer.GetObject <Activity>(instance.Xaml))); }
/// <summary> /// Creates the workflow view. /// </summary> /// <param name="xaml">The xaml.</param> /// <returns></returns> public static WorkflowView CreateWorkflowView(string xaml) { if (xaml == null) { throw new ArgumentNullException("xaml"); } return(CreateWorkflowView(McWorkflowSerializer.GetObject <Activity>(xaml))); }
/// <summary> /// Initializes a new instance of the <see cref="WorkflowChangesScope"/> class. /// </summary> /// <param name="entity">The entity.</param> protected WorkflowChangesScope(WorkflowInstanceEntity entity) { this.InstanceId = entity.PrimaryKeyId.HasValue ? (Guid)entity.PrimaryKeyId.Value : Guid.Empty; this.WorkflowEntity = entity; if (this.InstanceId != Guid.Empty && TryLoadFromMsWorkflow()) { // TODO: Custom Login here } else { this.TransientWorkflow = McWorkflowSerializer.GetObject <CompositeActivity>((string)this.WorkflowEntity[WorkflowInstanceEntity.FieldXaml]); } }
/// <summary> /// Adds the activity. /// </summary> /// <param name="instanceId">The instance id.</param> /// <param name="parentActivity">The parent activity.</param> /// <param name="childActivity">The child activity.</param> public static void AddActivity(object parentActivity, object childActivity) { CompositeActivity parent = parentActivity as CompositeActivity; if (parent == null) { throw new ArgumentException("The parent activity should be CompositeActivity.", "parentActivity"); } Activity child = childActivity as Activity; if (child == null) { throw new ArgumentException("The child activity should be Activity.", "childActivity"); } string strChildActivity = McWorkflowSerializer.GetString <Activity>(child); parent.Activities.Add(child); // OZ Addon Alpply Modification to Workflow Instance //if (instanceId != Guid.Empty) //{ // try // { // //Guid instanceId = Guid.NewGuid(); // WorkflowInstance instance = GlobalWorkflowRuntime.WorkflowRuntime.GetWorkflow(instanceId); // Activity root = instance.GetWorkflowDefinition(); // WorkflowChanges wc = new WorkflowChanges(root); // CompositeActivity tmpParent = (CompositeActivity)wc.TransientWorkflow.GetActivityByName(parent.QualifiedName); // //Activity tmpChild = child.Clone(); // Activity tmpChild = McWorkflowSerializer.GetObject<Activity>(strChildActivity); // tmpParent.Activities.Add(tmpChild); // instance.ApplyWorkflowChanges(wc); // } // catch (Exception ex) // { // System.Diagnostics.Trace.WriteLine(ex.ToString()); // } //} // End }
/// <summary> /// Tries the load from workflow instance entity. /// </summary> /// <returns></returns> private bool TryLoadFromWorkflowInstanceEntity() { try { this.WorkflowEntity = (WorkflowInstanceEntity)BusinessManager.Load(WorkflowInstanceEntity.ClassName, new PrimaryKeyId(this.InstanceId)); this.TransientWorkflow = McWorkflowSerializer.GetObject <CompositeActivity>((string)this.WorkflowEntity[WorkflowInstanceEntity.FieldXaml]); } catch (Exception ex) { System.Diagnostics.Trace.WriteLine(ex.ToString(), "Mediachase.Ibn.Assignments::TryLoadFromWorkflowInstanceEntity"); return(false); } return(true); }
/// <summary> /// Applies the workflow changes. /// </summary> public void ApplyWorkflowChanges() { if (this.InnerWorkflowChanges != null) { // Load WorkflowInstance WorkflowInstance instance = GlobalWorkflowRuntime.WorkflowRuntime.GetWorkflow(this.InstanceId); // ApplyWorkflowChanges to WorkflowInstance instance.ApplyWorkflowChanges(this.InnerWorkflowChanges); // ApplyWorkflowChanges to WorkflowInstanceEntity this.WorkflowEntity[WorkflowInstanceEntity.FieldXaml] = McWorkflowSerializer.GetString(this.InnerWorkflowChanges.TransientWorkflow); BusinessManager.Update(this.WorkflowEntity); } else if (this.WorkflowEntity != null) { // ApplyWorkflowChanges to WorkflowInstanceEntity this.WorkflowEntity[WorkflowInstanceEntity.FieldXaml] = McWorkflowSerializer.GetString(this.TransientWorkflow); if (this.WorkflowEntity.PrimaryKeyId.HasValue) { BusinessManager.Update(this.WorkflowEntity); } else { this.InstanceId = (Guid)BusinessManager.Create(this.WorkflowEntity); } } else { throw new InvalidOperationException("The workflow has already been saved."); } Dispose(true); }
/// <summary> /// Initializes the entity. /// </summary> /// <param name="context">The context.</param> protected override void InitializeEntity(BusinessContext context) { base.InitializeEntity(context); ((WorkflowInstanceEntity)((InitializeEntityResponse)context.Response).EntityObject).Xaml = McWorkflowSerializer.GetString(new SequentialWorkflowActivity()); }
static void TestWorkflowView() { GlobalWorkflowRuntime.StartRuntime("Data source=S2;Initial catalog=ibn48portal;User ID=dev;Password="******"Data source=S2;Initial catalog=ibn48portal;User ID=dev;Password="******"23ec347d-0529-43d4-ab34-d916f754b0df")); #region xaml string string xaml = @"<?xml version=""1.0"" encoding=""utf-16""?><SequentialWorkflowActivity " + @"x:Name=""SequentialWorkflowActivity_Root"" " + @"xmlns:ns0=""clr-namespace:Mediachase.Ibn.Assignments;Assembly=Mediachase.Ibn.Assignments, " + @"Version=4.7.54.0, Culture=neutral, PublicKeyToken=null"" " + @"xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"" " + @"xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/workflow"">" + Environment.NewLine + @" <ns0:CreateAssignmentAndWaitResultActivity RequestProperties=""{x:Null}"" "+ @"x:Name=""createAssignmentAndWait_ce11db253f434983b25f7a7f5b056145"">" + Environment.NewLine + @" <ns0:CreateAssignmentAndWaitResultActivity.AssignmentProperties>"+ Environment.NewLine + @" <ns0:PropertyValueCollection>"+ Environment.NewLine + @" <ns0:PropertyValue Name=""Subject"">"+ Environment.NewLine + @" <ns0:PropertyValue.Value>"+ Environment.NewLine + @" <ns1:String xmlns:ns1=""clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, "+ @"Culture=neutral, PublicKeyToken=b77a5c561934e089"">OZ OverDue Test 3</ns1:String>" + Environment.NewLine + @" </ns0:PropertyValue.Value>"+ Environment.NewLine + @" </ns0:PropertyValue>"+ Environment.NewLine + @" <ns0:PropertyValue Name=""UserId"">"+ Environment.NewLine + @" <ns0:PropertyValue.Value>"+ Environment.NewLine + @" <ns1:Int32 xmlns:ns1=""clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, "+ @"Culture=neutral, PublicKeyToken=b77a5c561934e089"">65</ns1:Int32>" + Environment.NewLine + @" </ns0:PropertyValue.Value>"+ Environment.NewLine + @" </ns0:PropertyValue>"+ Environment.NewLine + @" </ns0:PropertyValueCollection>"+ Environment.NewLine + @" </ns0:CreateAssignmentAndWaitResultActivity.AssignmentProperties>"+ Environment.NewLine + @" </ns0:CreateAssignmentAndWaitResultActivity>"+ Environment.NewLine + @" <ns0:CreateAssignmentAndWaitResultActivity RequestProperties=""{x:Null}"" "+ @"x:Name=""createAssignmentAndWait_0c22583fd14344d9a82d43cc674ab0d7"">" + Environment.NewLine + @" <ns0:CreateAssignmentAndWaitResultActivity.AssignmentProperties>"+ Environment.NewLine + @" <ns0:PropertyValueCollection>"+ Environment.NewLine + @" <ns0:PropertyValue Name=""Subject"">"+ Environment.NewLine + @" <ns0:PropertyValue.Value>"+ Environment.NewLine + @" <ns1:String xmlns:ns1=""clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, "+ @"Culture=neutral, PublicKeyToken=b77a5c561934e089"">OZ OverDue Test 3</ns1:String>" + Environment.NewLine + @" </ns0:PropertyValue.Value>"+ Environment.NewLine + @" </ns0:PropertyValue>"+ Environment.NewLine + @" <ns0:PropertyValue Name=""UserId"">"+ Environment.NewLine + @" <ns0:PropertyValue.Value>"+ Environment.NewLine + @" <ns1:Int32 xmlns:ns1=""clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, "+ @"Culture=neutral, PublicKeyToken=b77a5c561934e089"">65</ns1:Int32>" + Environment.NewLine + @" </ns0:PropertyValue.Value>"+ Environment.NewLine + @" </ns0:PropertyValue>"+ Environment.NewLine + @" </ns0:PropertyValueCollection>"+ Environment.NewLine + @" </ns0:CreateAssignmentAndWaitResultActivity.AssignmentProperties>"+ Environment.NewLine + @" </ns0:CreateAssignmentAndWaitResultActivity>"+ Environment.NewLine + @" <ns0:BlockActivity x:Name=""blockActivity_8ef17c90ba4a4a09bd92d5dc14b3e779"">"+ Environment.NewLine + @" <ns0:CreateAssignmentAndWaitResultActivity RequestProperties=""{x:Null}"" "+ @"x:Name=""createAssignmentAndWait_0f4cb38833a643fabad5fafb88d76657"">" + Environment.NewLine + @" <ns0:CreateAssignmentAndWaitResultActivity.AssignmentProperties>"+ Environment.NewLine + @" <ns0:PropertyValueCollection>"+ Environment.NewLine + @" <ns0:PropertyValue Name=""Subject"">"+ Environment.NewLine + @" <ns0:PropertyValue.Value>"+ Environment.NewLine + @" <ns1:String xmlns:ns1=""clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, "+ @"Culture=neutral, PublicKeyToken=b77a5c561934e089"">OZ OverDue Test 3</ns1:String>" + Environment.NewLine + @" </ns0:PropertyValue.Value>"+ Environment.NewLine + @" </ns0:PropertyValue>"+ Environment.NewLine + @" <ns0:PropertyValue Name=""UserId"">"+ Environment.NewLine + @" <ns0:PropertyValue.Value>"+ Environment.NewLine + @" <ns1:Int32 xmlns:ns1=""clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, "+ @"Culture=neutral, PublicKeyToken=b77a5c561934e089"">65</ns1:Int32>" + Environment.NewLine + @" </ns0:PropertyValue.Value>"+ Environment.NewLine + @" </ns0:PropertyValue>"+ Environment.NewLine + @" </ns0:PropertyValueCollection>"+ Environment.NewLine + @" </ns0:CreateAssignmentAndWaitResultActivity.AssignmentProperties>"+ Environment.NewLine + @" </ns0:CreateAssignmentAndWaitResultActivity>"+ Environment.NewLine + @" <ns0:CreateAssignmentAndWaitResultActivity RequestProperties=""{x:Null}"" "+ @"x:Name=""createAssignmentAndWait_bf381aae62aa4732ba5328140e3b8a09"">" + Environment.NewLine + @" <ns0:CreateAssignmentAndWaitResultActivity.AssignmentProperties>"+ Environment.NewLine + @" <ns0:PropertyValueCollection>"+ Environment.NewLine + @" <ns0:PropertyValue Name=""Subject"">"+ Environment.NewLine + @" <ns0:PropertyValue.Value>"+ Environment.NewLine + @" <ns1:String xmlns:ns1=""clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, "+ @"Culture=neutral, PublicKeyToken=b77a5c561934e089"">OZ OverDue Test 3</ns1:String>" + Environment.NewLine + @" </ns0:PropertyValue.Value>"+ Environment.NewLine + @" </ns0:PropertyValue>"+ Environment.NewLine + @" <ns0:PropertyValue Name=""UserId"">"+ Environment.NewLine + @" <ns0:PropertyValue.Value>"+ Environment.NewLine + @" <ns1:Int32 xmlns:ns1=""clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, "+ @"Culture=neutral, PublicKeyToken=b77a5c561934e089"">65</ns1:Int32>" + Environment.NewLine + @" </ns0:PropertyValue.Value>"+ Environment.NewLine + @" </ns0:PropertyValue>"+ Environment.NewLine + @" </ns0:PropertyValueCollection>"+ Environment.NewLine + @" </ns0:CreateAssignmentAndWaitResultActivity.AssignmentProperties>"+ Environment.NewLine + @" </ns0:CreateAssignmentAndWaitResultActivity>"+ Environment.NewLine + @" </ns0:BlockActivity>"+ Environment.NewLine + @" <ns0:BlockActivity x:Name=""blockActivity_a6c544f45e3b4b4facba5193b307291e"">"+ Environment.NewLine + @" <ns0:CreateAssignmentAndWaitResultActivity RequestProperties=""{x:Null}"" "+ @"x:Name=""createAssignmentAndWait_7f8498d01af740eda769250ddaa8912b"">" + Environment.NewLine + @" <ns0:CreateAssignmentAndWaitResultActivity.AssignmentProperties>"+ Environment.NewLine + @" <ns0:PropertyValueCollection>"+ Environment.NewLine + @" <ns0:PropertyValue Name=""Subject"">"+ Environment.NewLine + @" <ns0:PropertyValue.Value>"+ Environment.NewLine + @" <ns1:String xmlns:ns1=""clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, "+ @"Culture=neutral, PublicKeyToken=b77a5c561934e089"">OZ OverDue Test 3</ns1:String>" + Environment.NewLine + @" </ns0:PropertyValue.Value>"+ Environment.NewLine + @" </ns0:PropertyValue>"+ Environment.NewLine + @" <ns0:PropertyValue Name=""UserId"">"+ Environment.NewLine + @" <ns0:PropertyValue.Value>"+ Environment.NewLine + @" <ns1:Int32 xmlns:ns1=""clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, "+ @"Culture=neutral, PublicKeyToken=b77a5c561934e089"">65</ns1:Int32>" + Environment.NewLine + @" </ns0:PropertyValue.Value>"+ Environment.NewLine + @" </ns0:PropertyValue>"+ Environment.NewLine + @" </ns0:PropertyValueCollection>"+ Environment.NewLine + @" </ns0:CreateAssignmentAndWaitResultActivity.AssignmentProperties>"+ Environment.NewLine + @" </ns0:CreateAssignmentAndWaitResultActivity>"+ Environment.NewLine + @" <ns0:CreateAssignmentAndWaitResultActivity RequestProperties=""{x:Null}"" "+ @"x:Name=""createAssignmentAndWait_97f018bfd3fb47cdac6c569394d2856e"">" + Environment.NewLine + @" <ns0:CreateAssignmentAndWaitResultActivity.AssignmentProperties>"+ Environment.NewLine + @" <ns0:PropertyValueCollection>"+ Environment.NewLine + @" <ns0:PropertyValue Name=""Subject"">"+ Environment.NewLine + @" <ns0:PropertyValue.Value>"+ Environment.NewLine + @" <ns1:String xmlns:ns1=""clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, "+ @"Culture=neutral, PublicKeyToken=b77a5c561934e089"">OZ OverDue Test 3</ns1:String>" + Environment.NewLine + @" </ns0:PropertyValue.Value>"+ Environment.NewLine + @" </ns0:PropertyValue>"+ Environment.NewLine + @" <ns0:PropertyValue Name=""UserId"">"+ Environment.NewLine + @" <ns0:PropertyValue.Value>"+ Environment.NewLine + @" <ns1:Int32 xmlns:ns1=""clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, "+ @"Culture=neutral, PublicKeyToken=b77a5c561934e089"">65</ns1:Int32>" + Environment.NewLine + @" </ns0:PropertyValue.Value>"+ Environment.NewLine + @" </ns0:PropertyValue>"+ Environment.NewLine + @" </ns0:PropertyValueCollection>"+ Environment.NewLine + @" </ns0:CreateAssignmentAndWaitResultActivity.AssignmentProperties>"+ Environment.NewLine + @" </ns0:CreateAssignmentAndWaitResultActivity>"+ Environment.NewLine + @" <ns0:CreateAssignmentAndWaitResultActivity RequestProperties=""{x:Null}"" "+ @"x:Name=""createAssignmentAndWait_96cf746ba7724deca0a1e3b42e8a6623"">" + Environment.NewLine + @" <ns0:CreateAssignmentAndWaitResultActivity.AssignmentProperties>"+ Environment.NewLine + @" <ns0:PropertyValueCollection>"+ Environment.NewLine + @" <ns0:PropertyValue Name=""Subject"">"+ Environment.NewLine + @" <ns0:PropertyValue.Value>"+ Environment.NewLine + @" <ns1:String xmlns:ns1=""clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, "+ @"Culture=neutral, PublicKeyToken=b77a5c561934e089"">OZ OverDue Test 3</ns1:String>" + Environment.NewLine + @" </ns0:PropertyValue.Value>"+ Environment.NewLine + @" </ns0:PropertyValue>"+ Environment.NewLine + @" <ns0:PropertyValue Name=""UserId"">"+ Environment.NewLine + @" <ns0:PropertyValue.Value>"+ Environment.NewLine + @" <ns1:Int32 xmlns:ns1=""clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, "+ @"Culture=neutral, PublicKeyToken=b77a5c561934e089"">65</ns1:Int32>" + Environment.NewLine + @" </ns0:PropertyValue.Value>"+ Environment.NewLine + @" </ns0:PropertyValue>"+ Environment.NewLine + @" </ns0:PropertyValueCollection>"+ Environment.NewLine + @" </ns0:CreateAssignmentAndWaitResultActivity.AssignmentProperties>"+ Environment.NewLine + @" </ns0:CreateAssignmentAndWaitResultActivity>"+ Environment.NewLine + @" <ns0:CreateAssignmentAndWaitResultActivity RequestProperties=""{x:Null}"" "+ @"x:Name=""createAssignmentAndWait_a05219765fec40d9bb50fb4f463110cc"">" + Environment.NewLine + @" <ns0:CreateAssignmentAndWaitResultActivity.AssignmentProperties>"+ Environment.NewLine + @" <ns0:PropertyValueCollection>"+ Environment.NewLine + @" <ns0:PropertyValue Name=""Subject"">"+ Environment.NewLine + @" <ns0:PropertyValue.Value>"+ Environment.NewLine + @" <ns1:String xmlns:ns1=""clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, "+ @"Culture=neutral, PublicKeyToken=b77a5c561934e089"">OZ OverDue Test 3</ns1:String>" + Environment.NewLine + @" </ns0:PropertyValue.Value>"+ Environment.NewLine + @" </ns0:PropertyValue>"+ Environment.NewLine + @" <ns0:PropertyValue Name=""UserId"">"+ Environment.NewLine + @" <ns0:PropertyValue.Value>"+ Environment.NewLine + @" <ns1:Int32 xmlns:ns1=""clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, "+ @"Culture=neutral, PublicKeyToken=b77a5c561934e089"">65</ns1:Int32>" + Environment.NewLine + @" </ns0:PropertyValue.Value>"+ Environment.NewLine + @" </ns0:PropertyValue>"+ Environment.NewLine + @" </ns0:PropertyValueCollection>"+ Environment.NewLine + @" </ns0:CreateAssignmentAndWaitResultActivity.AssignmentProperties>"+ Environment.NewLine + @" </ns0:CreateAssignmentAndWaitResultActivity>"+ Environment.NewLine + @" <ns0:CreateAssignmentAndWaitResultActivity RequestProperties=""{x:Null}"" "+ @"x:Name=""createAssignmentAndWait_88c79524e0ec44a5985caf02b1735400"">" + Environment.NewLine + @" <ns0:CreateAssignmentAndWaitResultActivity.AssignmentProperties>"+ Environment.NewLine + @" <ns0:PropertyValueCollection>"+ Environment.NewLine + @" <ns0:PropertyValue Name=""Subject"">"+ Environment.NewLine + @" <ns0:PropertyValue.Value>"+ Environment.NewLine + @" <ns1:String xmlns:ns1=""clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, "+ @"Culture=neutral, PublicKeyToken=b77a5c561934e089"">OZ OverDue Test 3</ns1:String>" + Environment.NewLine + @" </ns0:PropertyValue.Value>"+ Environment.NewLine + @" </ns0:PropertyValue>"+ Environment.NewLine + @" <ns0:PropertyValue Name=""UserId"">"+ Environment.NewLine + @" <ns0:PropertyValue.Value>"+ Environment.NewLine + @" <ns1:Int32 xmlns:ns1=""clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, "+ @"Culture=neutral, PublicKeyToken=b77a5c561934e089"">65</ns1:Int32>" + Environment.NewLine + @" </ns0:PropertyValue.Value>"+ Environment.NewLine + @" </ns0:PropertyValue>"+ Environment.NewLine + @" </ns0:PropertyValueCollection>"+ Environment.NewLine + @" </ns0:CreateAssignmentAndWaitResultActivity.AssignmentProperties>"+ Environment.NewLine + @" </ns0:CreateAssignmentAndWaitResultActivity>"+ Environment.NewLine + @" <ns0:CreateAssignmentAndWaitResultActivity RequestProperties=""{x:Null}"" "+ @"x:Name=""createAssignmentAndWait_7e3ed79e3a8e4c02bedb6d780f61b416"">" + Environment.NewLine + @" <ns0:CreateAssignmentAndWaitResultActivity.AssignmentProperties>"+ Environment.NewLine + @" <ns0:PropertyValueCollection>"+ Environment.NewLine + @" <ns0:PropertyValue Name=""Subject"">"+ Environment.NewLine + @" <ns0:PropertyValue.Value>"+ Environment.NewLine + @" <ns1:String xmlns:ns1=""clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, "+ @"Culture=neutral, PublicKeyToken=b77a5c561934e089"">OZ OverDue Test 3</ns1:String>" + Environment.NewLine + @" </ns0:PropertyValue.Value>"+ Environment.NewLine + @" </ns0:PropertyValue>"+ Environment.NewLine + @" <ns0:PropertyValue Name=""UserId"">"+ Environment.NewLine + @" <ns0:PropertyValue.Value>"+ Environment.NewLine + @" <ns1:Int32 xmlns:ns1=""clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, "+ @"Culture=neutral, PublicKeyToken=b77a5c561934e089"">65</ns1:Int32>" + Environment.NewLine + @" </ns0:PropertyValue.Value>"+ Environment.NewLine + @" </ns0:PropertyValue>"+ Environment.NewLine + @" </ns0:PropertyValueCollection>"+ Environment.NewLine + @" </ns0:CreateAssignmentAndWaitResultActivity.AssignmentProperties>"+ Environment.NewLine + @" </ns0:CreateAssignmentAndWaitResultActivity>"+ Environment.NewLine + @" </ns0:BlockActivity>"+ Environment.NewLine + @"</SequentialWorkflowActivity>"; #endregion Activity wf = McWorkflowSerializer.GetObject <Activity>(xaml); WorkflowView view = CreateWorkflowView(wf); view.SaveWorkflowImage(@"C:\1.png", System.Drawing.Imaging.ImageFormat.Png); }