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

Question

Question

import files via workflow

asked on December 17, 2014 Show version history

Hi All, 

I have a table in database in SQL Server that contains a few columns:

LFPath - The path in LF repository (e.g. /test/one/)

File - The file name (e.g. one.pdf)

FilePath - The path to the file on the local machine (e.g. C:/test/one.pdf)

Template - The default template I want to assign to the path

Field1 - A metadata field I will assign to the entry once created 

 

The table with the above has a lot of records and was used for an older document repository that we want to bring into LF and assign the metadata to the corresponding fields. 

 

I would like to do the following in Workflow (I have most working):

Query the table

For each row

Create the LF folder path (if it doesn't exist)

***Add the file to the LF folder path

Assign the template to the file

Assign the metadata to the file

 

The main hurdle I'm running into is with adding the file. I don't think workflow has an import entry (it has create entry), so would I need to create an SDK Script at that point to import the file with the path I have from the query? If so, can someone please help me (or point me to some docs) where I can do the following in SDK Script:

- import a file into LF with the LF destination path and the path of the file

- as I import the file, assign the template and metadata

 

-----------------------Below empty SDK Script------------------------

Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Data.SqlClient
Imports System.Text
Imports LFSO90Lib

Namespace WorkflowActivity.Scripting.SDKScript
    '''<summary>
    '''Provides one or more methods that can be run when the workflow scripting activity is performed.
    '''</summary>
    Public Class Script1
        Inherits SDKScriptClass90
        '''<summary>
        '''This method is run when the activity is performed.
        '''</summary>
        Protected Overrides Sub Execute()
            'Write your code here.
        End Sub
    End Class
End Namespace

--------------------------------------------------------------------------------

If you have another approach to tackle this, please let me know. 

Thanks!

0 0

Replies

replied on December 17, 2014

Why not use Import Agent or Quick Fields to bring the files in? Quick Fields could do the look up and set the paths and fields for you.

0 0
replied on December 17, 2014

On our local server, we have the files like such:

C:/temp/one.pdf

However, in the database table, it has a column called LFPath that we want to drop the files into on LF. 

DB Table:
LFPath = 
/Sample/test/AA/one.pdf
File = one.pdf
FilePath = C:/temp/one.pdf
Template = Adminstration
Field1 - 65
 

So as I am importing the files, I need to drop the files into the LFPath folder (that may or may not exist in LF). 


From what I tested, Import Agent can't do this (I can import all of the files but not do mapping). This is why I was going to script something to do that. I don't think I have access to Quick Fields. 

0 0
replied on December 17, 2014

Quick Fields, like Import Agent, is part of your VAR Demo Kit so you should be able to test it out and come up with a proof of concept.

1 0
replied on December 17, 2014

Thanks. Does anyone know for Workflow SDK Script using LFSO, how or if you can import a file (sample code if possible)? 

You are not allowed to follow up in this post.

Sign in to reply to this post.