Installed version: Nintex Workflow 2010 (2.2.3.0)
After doing tests for several hours we concluded it had to do with the number of items in the library the workflow was imported in. The default threshold for lists is 5000 items. We had like 8200 items, so more than the configured threshold. When increasing the threshold above 8200, the importing and publishing went just fine.
Of course this has some implications and therefore I cannot really agree with how the Nintex code is written (did some reflector digging). According to Nintex this has to do with SharePoint limitations and I really feel this is not a correct answer. First of all, the 5000 limit threshold has to do with how many items a view in a list can return. It says nothing about how many items you can have in the list itself. Even after creating views and making sure not one view returned more than the 5000 limit threshold, the problem would persist.
It was on this moment I decided to take a look into their code to find out what is going on. The stack trace was pointing to the following functions:
1: private static SPFolder GetMetadataFolder(SPList list)
2: {
3: SPFolder result = null;
4: if (list.BaseType == SPBaseType.DocumentLibrary)
5: {
6: result = list.RootFolder.SubFolders["Forms"];
7: }
8: else
9: {
10: result = list.RootFolder;
11: }
12: return result;
13: }
14:
15: public static AutoStartRuleCollection LoadFromList(SPList list)
16: {
17: SPFolder metadataFolder = AutoStartRuleCollection.GetMetadataFolder(list);
18: return AutoStartRuleCollection.ReadRulesFile(metadataFolder, "Nintex_AutoStartRules.xml");
19: }
20:
21: private static AutoStartRuleCollection ReadRulesFile(SPFolder folder, string filename)
22: {
23: SPFile file = folder.ParentWeb.GetFile(SPUrlUtility.CombineUrl(folder.Url, filename));
24: if (!file.Exists)
25: {
26: return null;
27: }
28: byte[] bytes = file.OpenBinary();
29: string serialised = Utility.ConvertByteArrayToString(bytes);
30: return AutoStartRuleCollection.Deserialize(serialised);
31: }
The exception itself is thrown by line 6 of the first function. Because the ‘SubFolders’ property is used, in the background the threshold limit is kicking in. What they actually try to do here is construct an URL to a file called ‘Nintex AutoStartRules.xml’ and for doing this, they use the SPFolder class. The file is stored in the hidden ‘Forms’ folder in document libraries and in the root for custom lists.
I have tried other ways to get a hold of this ‘Forms’ folder without triggering the threshold limit but came to the conclusion it’s not possible (as far as I know). But when looking at the bigger picture (they just want the construct the URL to that file), we could conclude that the URL can be easily constructed without the need of the SPFolder class which would make the solution work in all circumstances because the xml file always has the same name and the location is known upfront based on the type of the list.
Thanks for the tip, just encountered the same issue and your solution solved it!
BeantwoordenVerwijderenWe just ran into this, increasing the limit worked, thanks for posting!
BeantwoordenVerwijderen