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?
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?
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
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.
Hi, thanks for that, just lastly, how do I access the scripts default entry data?
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
Many thanks that is what i needed