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

Question

Question

From Workflows, retrieving email and manager info for LFDS Thrustees

asked on September 24, 2018 Show version history

I need to configure a Workflow to retrieving email and manager info for LFDS Trustees.  All user info are properly configured in LFDS (user account, user email, department and manager).

My WF config is set with two Trustee DIrectories, Active Directory for all domains accounts and Laserfiche for all Repository related accounts.

However, I have not seen a configuration related to LFDS within Workflow.

My repository is set to link LFDS trustees.

When my WF uses FindUser or FindManager using the repository, it does find the user but no other info is retrieved.

 

What would be the best way to configure this?

0 0

Answer

SELECTED ANSWER
replied on October 3, 2018

Hi Miruna,

I have found a way by directly queringing the LFDS SQL DB.

My query is:

SELECT p.[id]
      ,p.[sid]
      ,p.[name]
      ,s.[claim_id]
      ,s.[str_val]
FROM [LF_RIO_DirectoryServer].[dbo].[directory_objects] as p
INNER JOIN [LF_RIO_DirectoryServer].[dbo].[additional_claims] as s
ON p.sid = s.sid
WHERE p.name = ?
and s.claim_id = '1'


where the "?" will be the "User's LFDS login account"

 

But this would be great if Laserfiche would modify his own FindUser activity to incorporate this and also find the manager for this account in LFDS.

 

Regards,

Daniel

4 0

Replies

replied on September 24, 2018

Workflow does not read users from LFDS. For AD users, you can configure an active directory trustee provider.  Laserfiche users in LFDS can be up with attributes like regular repository users and Workflow will read that through the repository trustee provider.

0 0
replied on September 24, 2018 Show version history

Thanks for this info Miruna, but not the answer I expected.

 My customer did set everything up in LFDS for over 200 users. Not very convenient to manage these through attributes at the repository level when you have that great interface in LFDS.

I need to ask this question... why LF did provide this LFDS configuration interface if we can't use this?  Unless LF is planning on releasing an updated WF configuration to allow retrieving from LFDS.  Can you confirm if it will be part of a next release?

1 0
SELECTED ANSWER
replied on October 3, 2018

Hi Miruna,

I have found a way by directly queringing the LFDS SQL DB.

My query is:

SELECT p.[id]
      ,p.[sid]
      ,p.[name]
      ,s.[claim_id]
      ,s.[str_val]
FROM [LF_RIO_DirectoryServer].[dbo].[directory_objects] as p
INNER JOIN [LF_RIO_DirectoryServer].[dbo].[additional_claims] as s
ON p.sid = s.sid
WHERE p.name = ?
and s.claim_id = '1'


where the "?" will be the "User's LFDS login account"

 

But this would be great if Laserfiche would modify his own FindUser activity to incorporate this and also find the manager for this account in LFDS.

 

Regards,

Daniel

4 0
replied on July 16, 2019

Hi Miruna,

Will Workflow be updated to read LFDS group members?

-Ben

0 0
replied on March 31, 2020

Any update on this Miruna?

0 0
replied on June 29, 2020

Need an update on this also please, thank you.

0 0
replied on June 30, 2020

The LFDS SDK was released for VARs, so while there still are no built in activities in Workflow to interact with LFDS, we can start scripting what we need to do.

1 0
replied on June 30, 2020

I just tried to create a workflow with a SDK Script activity to get a LFDS User email.  I added the reference for LicenseManagerObjects.dll (located at C:\Program Files\Laserfiche\Directory Server\Web\LFDS\bin) and in the script editor, everything built without error.  When the script is run by the workflow, it throws an error:

Could not load file or assembly 'LicenseManagerObjects, Version=10.4.4.0, Culture=neutral, PublicKeyToken=3f98b3eaee6c16a6' or one of its dependencies. The system cannot find the file specified.

I believe the error is due to the fact that the workflow scripts are using .NET 4.0 or 4.5 and the  LicenseManagerObjects.dll is using .NET 4.7.2.  Any way to run the script with .NET 4.7.2 or higher?

0 0
replied on June 30, 2020

What version of Workflow are you using?

0 0
replied on June 30, 2020

I was running WF 10.4.0.119 so I upgraded and now it is WF 10.4.2.246.

I rebuilt the script and republished the workflow and still get the same error.

0 0
replied on June 30, 2020

WF 10.4.2 targets .Net 4.8. Can you try referencing the version of LicenseManagerObjects that comes with Forms instead of the one that came with LFDS?

0 0
replied on July 1, 2020 Show version history

Yes, changing the reference to "C:\Program Files\Laserfiche\Laserfiche Forms\Forms\bin\LicenseManagerObjects.dll" works.

Below is my code.  Make sure that the Workflow service is running as a user that has permissions to query LFDS.

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

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()
            'Write your code here. The BoundEntryInfo property will access the entry, RASession will get the Repository Access session
            Dim LFDSServer As String = GetTokenValue("LFDSServer")
            Dim LFDSRealm As String = GetTokenValue("LFDSRealm")
            Dim LFDSUser As String = GetTokenValue("LFDSUser")
            Dim sEmail As String = GetUserEmail(LFDSServer, LFDSRealm, LFDSUser)
            SetTokenValue("UserEmail", sEmail)
        End Sub

        Private Function GetUserEmail(ByVal LFDSServerName As String, ByVal LFDSRealmName As String, ByVal LFDSUserName As String) As String
            Dim returnEmail As String = Nothing
            Try
                Using lfds As LMO.Server = LMO.Server.Connect(LFDSServerName, False, False)
                    Dim db As LMO.Database = lfds.GetDatabaseByRealmName(LFDSRealmName)
                    db.LoginWindows()
                    Dim LFDSUser As LMO.User = db.GetUser(LFDSUserName, "ROOT")
                    Dim claims As LMO.TrusteeClaims = LFDSUser.GetClaims()
                    Dim CV As LMO.ClaimValue = claims.Item("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress")
                    Dim Vals() As String = CV.Value()
                    If Vals IsNot Nothing Then
                        returnEmail = Vals(0)
                    End If
                End Using
            Catch ex As Exception
                WorkflowApi.TrackError(ex.Message)
                returnEmail = Nothing
            End Try
            Return returnEmail
        End Function

    End Class
End Namespace

NOTE:

There are 5 Claim values that we can get from the LFDS user:

  • Display Name = "http://laserfiche.com/identity/claims/displayname"
  • First Name = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname"
  • Last Name = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname"
  • Email Address = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"
  • Department = "http://laserfiche.com/identity/claims/department"
1 0
replied on July 1, 2020

LicenseManagerObjects (LMO) 10.4 has a dependency on NewtonSoft version 11. If you make a folder called Newtonsoft under the WF install folder and place a copy of the dll in it, you should be able to reference LMO 10.4 without errors. A copy of Newtonsoft 11 can be found in the same folder as LicenseManagerObjects in LFDS. I would recommend copying LMO to Workflow's install folder and referencing it from there to protect your scripts from breakage when future versions of LFDS update it.

We'll update the LFDS SDK documentation to indicate how to properly reference the library in scripts and applications.

1 0
replied on July 1, 2020 Show version history

Thank you Miruna.  Following your directions worked perfectly (as always)!

 

I spoke too soon.  The Reference list still had the LMO in the Forms directory and I selected that one by mistake.  After correcting it and selecting the LMO in the Workflow folder, then I get the following error:

Could not load file or assembly 'Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

This is because there is an older version of Newtonsoft.Json.dll already in the Workflow install location and the newer version which was copied to "C:\Program Files\Laserfiche\Laserfiche Workflow 10.4\Newtonsoft" is not being seen.

Can the newer version of Newtonsoft.Json.dll replace the version that is in the Workflow install location without causing issues?

0 0
replied on August 3, 2020

Oops, missed this one.  Sounds like you referenced LMO from its original location or Workflow's install folder? Please copy LicenseManagerObjects.dll and Newtonsoft.JSON.dll to the Newtonsoft folder under WF's install folder and reference it from there.

(.Net assembly probing will look in the same folder first when attempting to resolve references)

0 0
replied on May 12, 2021 Show version history

It looks like I am having the same issue. When I look in the Workflow Administration Console after enabling the Fusion!EnableLog to 1, it looks like it is trying to load the LicenseManagerObjects.dll file from C:\Program Files\Laserfiche\Laserfiche Workflow 10.4\LicenseManagerObjects.dll rather than the C:\Program Files\Laserfiche\Laserfiche Workflow 10.4\Newtonsoft\LicenseManagerObjects.dll.

If I copy the LicenseManagerObjects.dll to C:\Program Files\Laserfiche\Laserfiche Workflow 10.4\ folder instead I get the error message "Could not load file or assembly 'Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)" in the script in Workflow.

If I replace the new Newtonsoft.Json.dll, after backing up the original, in C:\Program Files\Laserfiche\Laserfiche Workflow 10.4\ in Forms I get an error message: 

  • An unexpected error has occurred. [LFF502-UnexpectedError] Details: URL: Error: UnexpectedError Date: 5/12/2021 2:49:29 PM (Central Standard Time) HTTP Status Code: 500 Business Process ID: 11 Instance ID: 2465 Business Process Name: Professional Development Stack Trace: Caught exception: Laserfiche.Forms.CommonUtils.Exceptions.LFFormsException Message: An unexpected error has occurred. [LFF502-UnexpectedError] Inner exception: System.Exception Message: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) at Laserfiche.Forms.Routing.ServiceTask.Execute(Int32 instanceId, IRoutingContext routingContext)

I made sure that in the workflow I am referencing C:\Program Files\Laserfiche\Laserfiche Workflow 10.4\Newtonsoft\LicenseManagerObjects.dll. I also added a reference to the C:\Program Files\Laserfiche\Laserfiche Workflow 10.4\Newtonsoft\Newtonsoft.Json.dll.

How do I get the script to reference the 10 version of Newtonsoft.Json.dll and Workflow to reference the 6 version of Newtonsoft.Json.dll so things do not crash?

0 0
replied on December 30, 2021

I can't figure this out either, tried referencing the LicenseManagerObjects.dll from the Forms directory and it still throws the same error.

I think I am just going to go to version 11 for this instance since it only seems to be an issue with version 10

0 0
replied on January 3, 2022

The newest version of Laserfiche Workflow fixes the issue, but there is a catch. Workflow does two things when running. It checks if the file exists and then loads the file. I expect it performs other tasks like checking the version, but not pertinent. When it checks if the referenced file exists, it checks in the Laserfiche Workflow folder, so you must have a copy of the file there. It does not have to be the same version. When it actually loads the referenced file, it now picks it from the right location rather than the Laserfiche Workflow folder.

0 0
replied on January 3, 2022

Well just in case, I did try putting a copy of the file under 

C:\Program Files\Laserfiche\Laserfiche Workflow 10.2

This doesn't help it load the assembly though, it does not load it in either version 10 or 11 for me.

0 0
replied on January 4, 2022

It worked for me in 11.0.2102.264. Could not on 10. The new version seems to have the folder named C:\Program Files\Laserfiche\Workflow\ instead, but realize that can be changed at time of install.

0 0
replied on January 4, 2022

10.2 refers to the original version installed from a fresh install when the server was first created, I think the install wizard does this as a way to track which version was the first installed before any updates, since the folder name doesn't change with each upgrade.

0 0
replied on July 5, 2019
Hello,

Is there a solution for this or Workflow still can not see the LFDS users?
You are not allowed to follow up in this post.

Sign in to reply to this post.