You are viewing limited content. For full access, please sign in.

Question

Question

Workflow SDK Script documentation

asked on June 23, 2023

I'm working to understand a workflow that has a lot of scripts in it.  What I'm looking for it the documentation so I can read exactly what function do. For example this code I  read as 

 

  1. Take the starting entry (document) and and get it's parent (containing folder)
  2. Get the parent of that  folder (grandparent)?
  3. Look for a field called RootRecordName and if not found:
  4. Set folder to the parent folder (not sure why they don't just use parentfolder).
  5. Set parent folder to it's parent.
  bool foundRootFolder = false;

            FolderInfo folder = BoundEntryInfo.GetParentFolder();
            FolderInfo parentfolder = folder.GetParentFolder();

            while (!foundRootFolder)
            {
                string rootRecordName = string.Empty;
                FieldValueCollection fvc = parentfolder.GetFieldValues();
                if (fvc.ContainsField("RootRecordName") && fvc["RootRecordName"]!=null)
                    rootRecordName = fvc["RootRecordName"].ToString();
                else
                    rootRecordName = string.Empty;


                if (String.IsNullOrEmpty(rootRecordName))
                {
                    foundRootFolder = true;
                }
                else
                {
                    folder = Folder.GetFolderInfo(parentfolder.Id,RASession);
                    parentfolder = folder.GetParentFolder();
                }
            }

So I'm trying to find the docs to see if this script is just ignoring the containing folder. 

 

The closest I got was https://laserfiche.github.io/lf-repository-api-client-dotnet/docs/1.x/class_laserfiche_1_1_repository_1_1_api_1_1_client_1_1_folder.html but this doesn't contain the functions I see them use

0 0

Answer

SELECTED ANSWER
replied on June 26, 2023

Documentation for the SDK is available as part of the Laserfiche SDK install, which is a separate product.

Your script does ignore the containing folder because it's set to work on the parent of the containing folder.

FolderInfo folder = BoundEntryInfo.GetParentFolder();   --this gets the parent folder of the current entry, aka the containing folder.

 FolderInfo parentfolder = folder.GetParentFolder();  --this gets the parent folder of the parent folder, so you are 2 levels up from the entry.

The while loop works with the parent folder of the parent folder.

0 0
replied on June 26, 2023

Thank you. I looked in my SDK install and the "Laserfiche Workflow SDK Documentation.chm" file didn't seem to contain the function reference.  Wherein the SDK install should I look?

0 0
replied on June 26, 2023

It's not part of the Workflow SDK. You would need to install the Laserfiche SDK.

0 0
replied on June 26, 2023
0 0
replied on June 30, 2023

Anyway to access the documentation if we don't own the SDK?

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.