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

Question

Question

Change RM properties in Workflow SDK

asked on September 9, 2014

Hello Everybody,

Need some help in the Workflow SDK record management integration. The task is to import some records from the third party application and then setup filing date accordantly from the date obtained from their DB(sometimes 10 years back). I found how to do it in the SDK Toolbox but it assumes new connection to the Repository. Can it be done through the Workfllow SDK? For example I create a Record Folder inside record series and pass ID to the Worflow SDK. SDK Script then finds this Record Folder and changes filing date, checks eligibility for cutoff, cutting off and destroys if eligible.

 

Thank you very much,

Vladimir 

0 0

Answer

SELECTED ANSWER
replied on September 10, 2014

Some key points about scripting in Workflow:

  • One of the great things about using Workflow to run SDK scripts is that you don't have to manage your connection to the repository--Workflow handles that for you. It's pretty easy to grab the starting entry for your script. The this.BoundEntryInfo property will give you the DocumentInfo class you need to operate on the starting entry.
  • To get at Workflow's session, use the this.RASession property.
  • To get tokens, you can use the this.GetTokenValue(string tokenName) method. Multivalue tokens can be worked with as detailed in this Answers post.

 

The "Creating a Script" help article, found on the Workflow help page, has a sample script that shows how to grab the starting entry and operate on it. Other than that, I recommend taking a look at the sample code included with the SDK. The help files include a section on records management, and using the stuff above, it should be pretty easy to write the script.

0 0

Replies

replied on September 23, 2014

Here is some code to retrieve a RepositoryAccess Session the way Zachary described, but set up for a scheduled rule, where you may not have a starting entry:

 

           Dim LF_Session As Laserfiche.RepositoryAccess.Session
           LF_Session = RASession

 

In general, it looks like the construction, This.Something can be edited for a scheduled rule by lopping off the "This" part.

As an example, this code also works in a scheduled rule:

           For Each sTempToken In WorkflowApi.GetTokenAsMultiValue("tkCompanyList")
               Redim Preserve sValueArray(nIndex)
               sValueArray(nIndex) = sTempToken
               'Set the counter for the next iteration
               nIndex = nIndex + 1
           Next

Where the syntax would be

This.WorkflowApi.GetTokenAsMultiValue("tkCompanyList")

if you had a starting entry. Simple, but only when you already know how.

2 0
replied on September 10, 2014

This has nothing to do with the Workflow SDK, it's all done with the Laserfiche SDK. If you are using Workflow through a SDK Script activity, the connection is made for you and you can just pass it in as "RASession" (assuming Workflow 9.1 and higher).

0 0
replied on September 11, 2014

Hi Vladimir, 

 

If your question has been answered, please let us know by clicking the "This answered my question" button on the response.

 

If you still need assistance with this matter, just update this thread. Thanks!

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

Sign in to reply to this post.