Hi everyone,
I’m trying to create custom activity for Workflow and I want to use RepositoryAccess 9.2 to validate a LoginName and if it is a valid account I gets its identifier for others validations.
So I have to use a Session like this:
Dim acctRef As New AccountReference(loginName, MySession)
I noticed in the documentation for creating a custom activity, the code contains a method that creates a session. I tried one with LFSO and the other just with the ActivityExecutionContext
Using wrapper As ConnectionWrapper = executionContext.OpenConnection90()
Dim MyDatabase As ILFDatabase = CType(wrapper.Database, ILFDatabase)
Dim MySession As Session = Laserfiche.RepositoryAccess.Session.CreateFromSerializedLFConnection(MyDatabase.CurrentConnection.SerializedConnection)
Dim loginName As String = Me.ResolveTokensInText(executionContext, Me.LoginName)
Dim acctRef As New AccountReference(loginName, MySession)
acctRef.ToSecurityIdentifier()
...
End Using
or
Dim auten As AuthenticationInfo = executionContext.GetAuthenticationInfo()
Using MySession As Session = Session.Create(auten.Server, auten.Repository)
Dim loginName As String = Me.ResolveTokensInText(executionContext, Me.LoginName)
Dim acctRef As New AccountReference(loginName, MySession)
acctRef.ToSecurityIdentifier()
...
End Using
Is this correct, don't impact in the Global Sessions or should we use a different method that uses the current existing session?
Thanks for your support
Regards.