Hi
I created a workflow definition with a flowdecision in it and forgot to set the condition
I saved and Activated the workflow and then initiated an XPO object which would trigger the
workflow( the desinger is letting you activate wf defintions which are not valid). However, the workflow server service fails to start as it has the incorrect workflow definition, which is correct. Now I delete the XPO object and modify the workflow definition to set the flow decision condition. This is saved as version 2. I debug and test this works fine. Now I start the workflow server service. This fails to start because it is seeing the incorrect workflow definition in version 1. At this point there are no active XPO objects or workflow instances for version 1.The only way to resolve this issue is to delete the version 1 workflow definition in the DB.
Am I missing somethig here Or is there a better way to do this.
Thanks
Savy
We have closed this ticket because another page addresses its subject:
Workflow - Ensure compatibility with WF 4.5 features
Hello Savy,
Thank you for using our workflow module. I should consult with our developers regarding this issue. We will answer you ASAP.
Thanks,
Anatol
Hello Savy,
I apologize for the delayed response.
With the default functionality, the only way to resolve this problem is to delete the incorrect version. You can also extend this functionality in the following way:
public class ShowWorkflowInstancesForActivityVersionController : ViewController<ObjectView> { internal const string ActiveKey_HasAccessToRunningWorkflowInstanceInfoType = "HasAccessToRunningWorkflowInstanceInfoType"; internal const string ActiveKey_NonRunningWorkflowInstanceInfoType = "NonRunningWorkflowInstanceInfoType"; internal const string ListViewCriteriaName = "RunningWorkflowInstanceInfoViewer"; private void ShowWorkflowInstances_Execute(object sender, SimpleActionExecuteEventArgs e) { ShowWorkflowInstances(e); } protected virtual void ShowWorkflowInstances(SimpleActionExecuteEventArgs e) { ListView listView = Application.CreateListView(Application.CreateObjectSpace(), RunningWorkflowInstanceInfoType, true); string workflowId = ((DevExpress.ExpressApp.Workflow.Versioning.XpoUserActivityVersion)(e.CurrentObject)).WorkflowUniqueId + "_" + ((DevExpress.ExpressApp.Workflow.Versioning.XpoUserActivityVersion)(e.CurrentObject)).Version; listView.CollectionSource.Criteria[ListViewCriteriaName] = new BinaryOperator("WorkflowUniqueId", workflowId); e.ShowViewParameters.CreatedView = listView; e.ShowViewParameters.TargetWindow = TargetWindow.NewWindow; } public ShowWorkflowInstancesForActivityVersionController() { TargetObjectType = typeof(DevExpress.ExpressApp.Workflow.Versioning.XpoUserActivityVersion); ShowWorkflowInstancesAction = new SimpleAction(this, "ShowWorkflowInstancesForActivityVersion", WorkflowModule.WorkflowActionCategory); ShowWorkflowInstancesAction.ImageName = "Action_Workflow_ShowWorkflowInstances"; ShowWorkflowInstancesAction.SelectionDependencyType = SelectionDependencyType.RequireSingleObject; ShowWorkflowInstancesAction.Execute += new SimpleActionExecuteEventHandler(ShowWorkflowInstances_Execute); } protected override void OnViewChanging(View view) { base.OnViewChanging(view); if(RunningWorkflowInstanceInfoType != null) { Active[ActiveKey_HasAccessToRunningWorkflowInstanceInfoType] = SecuritySystem.IsGranted(new ObjectAccessPermission(RunningWorkflowInstanceInfoType, ObjectAccess.Read)); Active[ActiveKey_NonRunningWorkflowInstanceInfoType] = view is ObjectView && view.ObjectTypeInfo != null && !typeof(IRunningWorkflowInstanceInfo).IsAssignableFrom(view.ObjectTypeInfo.Type); } } protected override void OnActivated() { Frame.GetController<DevExpress.ExpressApp.Workflow.Controllers.RunningWorkflowInstanceInfoViewer>().Active["ByActivityVersionsViewer"] = false; base.OnActivated(); } protected override void OnDeactivated() { Frame.GetController<DevExpress.ExpressApp.Workflow.Controllers.RunningWorkflowInstanceInfoViewer>().Active.RemoveItem("ByActivityVersionsViewer"); base.OnDeactivated(); } protected override void OnFrameAssigned() { base.OnFrameAssigned(); if(Frame.Application != null) { WorkflowModule module = Frame.Application.Modules.FindModule<WorkflowModule>(); if(module != null) { RunningWorkflowInstanceInfoType = module.RunningWorkflowInstanceInfoType; } } Active["RunningWorkflowInstanceInfoType"] = (RunningWorkflowInstanceInfoType != null); } public SimpleAction ShowWorkflowInstancesAction { get; private set; } public Type RunningWorkflowInstanceInfoType { get; set; } }
As a result, it will be possible to view versions where the error occurs, see what workflows were started for them and how they were finished. Based on this information, it will be possible to decide whether it is required to exit XAML, wait for the workflow completion, or delete version immediately.
We are going to provide a better way to handle erroneous definitions. For example, we will probably be able to reuse the workflow versioning mechanism that MS is going to provide in .NET Framework 4.5. I have converted your report to a suggestion. You will be automatically notified when its state is changed.
Thanks,
Anatol