Skip to main content


 

Symptoms


I am just trying to deploy a SmartObject in K2 for Visual Studio and it cannot find the parent. The parent does exist, the GUID is the same. It's a SharePoint list.

Error 2 Deploy SmartObjects: Task error: SmartObject Server Exception: Dependency could not be created: System.Exception: Dependency could not be created. Parent does not exist in this environment. Check Data property of exception.
at SourceCode.Hosting.Services.DependancyService.VerifyObjects(List`1 parents)
at SourceCode.Hosting.Services.DependancyService.CreateDepenancyBatch(Dictionary`2 depenancyBatch). SmartObject: This is a long name that contains more than 49 characters]
Parent ID = 'SomeGuidValue'
Parent Name = 'This is a long name that contains more than 49 characters'
Parent Class Name = ''
Parent Version = ''
Parent Extra Data = 'SourceCode.SmartObjects.Services.SharePointV2.SharePointService'
 

Diagnoses


It was determined that in the source environment, the SharepointV2 service instance had been registered on an earlier K2 blackpearl version with 'Version' Service Key '4.11284.11347.4' which recognized the full list name 'This is a long name that contains more than 49 characters'. But when attempting to register a new service instance in the target environment (of a later K2 blackpearl version) it is pre-populating with 'Version' Service Key '4.14050.14218.6' this will only recognize the list with truncated name 'This is a long name that contains more than 49 ch' and as such will also surface the Service Object with a truncated name. Due to this behavior, the Smartobject definition and its referenced Service Object method were not matching up to resolve the issue, we set the 'Version' Service Key in the destination environment to match the source environment.

Below are some additional information regarding the 'Version' Service Key:

1. By default, a new service instance will populate the "Version" Service Key with the current "File version/Product version" value from the "SourceCode.SmartObjects.Services.SharePointV2.dll" assembly located at "C:Program Files (x86)K2 blackpearlServiceBroker".

2. The issue that we were seeing is the result of 2 factors:

a. Starting with K2 blackpearl version 4.6.4, a change was made to the Sharepoint V2 broker to use the "Root Folder" instead of the "Title" usually this would work with the exception of this case due to point (b)

b. Sharepoint 2010 seems to truncate the "Root Folder" Property if the listlibrary name is greater than 49 characters although I was not able to find any Microsoft documentation regarding this behavior, except the following which indicates otherwise:

"SharePoint Server 2010 truncates the URL source parameter if the total URL length to be passed to Internet Explorer is more than 1950 bytes. The source parameter is a reference to a previously visited page. The result of the truncation of the source parameter is that the user will be referred back to default location rather than the location specified in the source parameter.
Other parameters, such as sort orders, root folder parameters, and views are not truncated."

https://technet.microsoft.com/en-us/library/ff919564(v=office.14).aspx
 

Resolution

To resolve the issue, the SharepointV2 'Version' Service Key in the destination environment was configured to match the 'Version' Service Key from the source environment this way the service instances will match in behavior.




 
Be the first to reply!

Reply