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

Question

Question

pass data from workflow to sdk

asked on February 22, 2024

Hi I have a workflow that loops through data, and I want to pass through the entity ID and a mime type so that I can change a large batch of files to the new file extension.

 

How do I pass the entity and other data / tokens from workflow to the SDK?

 

0 0

Answer

SELECTED ANSWER
replied on February 22, 2024

Karl,

Here is a very short VB code snippet to reference both the BoundEntryInfo and the passed mimetype variable;

Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Data.SqlClient
Imports System.Text
Imports Laserfiche.RepositoryAccess

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 RAScriptClass104
        '''<summary>
        '''This method is run when the activity is performed.
        '''</summary>
        Protected Overrides Sub Execute()
            Dim mimeType As String = Me.GetTokenValue("ForEachEntry_CurrentEntry_MIMEType")

            Using docInfo As DocumentInfo = DirectCast(Me.BoundEntryInfo, DocumentInfo)
                If mimeType = docinfo.MimeType Then

                End If
            End Using

        End Sub
    End Class
End Namespace

 

0 0

Replies

replied on February 22, 2024

Karl,

I assume premise Workflow and the SDK reference is to the SDK Script activity? 

If so then you would bind the SDK Script activity to the Current Entry of the For Each Entry activity via the Script Default Entry property.  You can then access that entry in the SDK Script activity utilizing the BoundEntryInfo method.

As far as the MIME type is concerned you can also capture that information in the Search activity or the Find Entries activity under the Additional Properties property and then that token will be available to the For Each activity and retrievable from the SDK Script activity.

0 0
replied on February 22, 2024

Hi, thanks for that, just lastly, how do I access the scripts default entry data?

0 0
SELECTED ANSWER
replied on February 22, 2024

Karl,

Here is a very short VB code snippet to reference both the BoundEntryInfo and the passed mimetype variable;

Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Data.SqlClient
Imports System.Text
Imports Laserfiche.RepositoryAccess

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 RAScriptClass104
        '''<summary>
        '''This method is run when the activity is performed.
        '''</summary>
        Protected Overrides Sub Execute()
            Dim mimeType As String = Me.GetTokenValue("ForEachEntry_CurrentEntry_MIMEType")

            Using docInfo As DocumentInfo = DirectCast(Me.BoundEntryInfo, DocumentInfo)
                If mimeType = docinfo.MimeType Then

                End If
            End Using

        End Sub
    End Class
End Namespace

 

0 0
replied on February 22, 2024

Many thanks that is what i needed

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

Sign in to reply to this post.