After spending few days, it become common for workflow designer to display validation errors every now and then which happened because SPD kept mysteriously deleting the variable references from the workflow actions.
Finally, i reached the stage where my workflow will not open in text-based designer mode, no matter what i do. It always opened in Visual designer mode with empty visio page.
Exporting the workflow as vsdx file and re-importing as new workflow didn't solve the problem.
After some experimentation, i was able to recover my workflow using the following procedure.
- I exported the original workflow as vsdx file using export to visio function.
- I deleted the workflow from SharePoint designer
- In SharePoint designer, I created a new workflow “temp” and associated with my original SharePoint List.
- New workflow had only 1 line which was logging to history list. I published the workflow
- On my computer, I renamed the .vsdx file (step 1) to .zip and extracted all its contents.
- In SharePoint designer, I went to navigation windows on left hand side, there i clicked All Files -> WfSvc1 (this is a known folder where SPD stores workflow files)
- In that folder, there were many sub-folders, each having a guid as its name. each folder represents a workflow
- Went inside each folder and picked the folder which has most recent last modified date for workflow.xaml file (this represents workflow created in step 1)
- From the extracted folder (step 5) I copy pasted the file workflow.xaml to the SPD folder (step 8)
- Restarted SharePoint designer
- Opened the workflow designer page for the new workflow "temp" and it showed the restored workflow J
- Renamed & published the workflow
As a lesson learned, i decided to break the workflow into smaller manageable workflow pieces, so that the damage remains minimum in case of future corruption.
0 comments:
Post a Comment