sync users to m-files - unitfly · unitfly sync users to m-files 11 4. after saving properties, new...
TRANSCRIPT
unitfly.com
Sync Users to M-Files
unitfly.com
Unitfly Sync Users to M-Files 2
Table of Contents
Flight agency customer........................................................................................................................................................................ 3
Customer goals .................................................................................................................................................................................. 3
Customer objective ........................................................................................................................................................................... 3
What we have done with customer ................................................................................................................................................ 4
How we’ve done it ................................................................................................................................................................................. 5
Prerequisites ........................................................................................................................................................................................ 5
M-Files ................................................................................................................................................................................................... 5
BizTalk Server ...................................................................................................................................................................................... 7
Adapters ........................................................................................................................................................................................... 7
Visual Studio ..................................................................................................................................................................................... 10
Get property schema from M-Files Server ....................................................................................................................... 10
Create business logic using BizTalk orchestration ........................................................................................................ 12
Results ..................................................................................................................................................................................................... 15
Contact Us ......................................................................................................................................................................................... 16
Social Networks ............................................................................................................................................................................... 16
Unitfly Sync Users to M-Files 3
Flight agency customer
Customer is a flight agency with more than 1000 people in their espadrille. They are using legacy HR
application where they have all the records about employees. That application is using Oracle database as a
place for storing data and processes. Documents are stored on a file share and there are paths in HR
application to those files. Customer is using Active Directory for rights delegation, sign-on and hierarchy
representation.
Customer goals Customer goals are to have extend and nurtured performance and satisfaction among their staff. With
modern approach they want to reach every employee individually.
Customer objective Customer plans are to have a central system for employees with all the information and documents. With
central system in place they will have a platform to automate all other processes and follow individual
employee on a larger scale:
• Performance
• Schedule
• Education
• Satisfaction
Customer goals are to have that process in place with single sign-on on all future systems.
Unitfly Sync Users to M-Files 4
What we have done with
customer
We have done implementation in a few steps:
• We implemented M-Files platform as a central system for Human Resources processes and
document management system. M-Files platform will be a steady and agile ground for future
development.
• BizTalk environment was set up on Microsoft Azure Platform. With Microsoft BizTalk integration
system we have established a connection with the Oracle database and file share to pick up files and
metadata, plus a connection with the Active Directory.
• Final step while orchestrating BizTalk integration was a connection to M-Files trough BizTalk M-Files
Adapter. All documents and metadata from Oracle and Active directory where transformed and
saved to M-Files.
Unitfly Sync Users to M-Files 5
How we’ve done it
We will describe the way we have used technologies to develop and configure this use case. For this
scenario, with M-Files and BizTalk we will use Microsoft Visual Studio.
Prerequisites • Document needs to have an ID in a file name.
o That way we can get additional information about that file from database using that unique
ID.
• Legacy system needs to be aware of the fact that BizTalk deletes files after collecting them.
o If not aware, some additional logic needs to be implemented to address that issue.
• All additional properties for M-Files documents can be fetched from database.
M-Files M-Files is to be used as a new document management system, therefore, a new vault has to be prepared
for the import of legacy documents. For this scenario, in M-Files Admin console, we have created a new
Unitfly Sync Users to M-Files 6
document class for a Document object named “Legacy Document”. On a “Legacy Document” class we have
added all properties that existed in legacy DMS and are required in M-Files.
Properties added are:
• Name or title
• Name
• Legacy ID
• Document Type
• Project Name
• Responsible Person
Unitfly Sync Users to M-Files 7
BizTalk Server
Adapters
To enable integration between two systems, BizTalk server is set up on Microsoft Azure with both, native
and WCF adapters as well as other artifacts. As legacy system has information, both on share and in the
database, we use FILE and WCF adapters to communicate with the system and gather all needed
information. For communication with M-Files, we use BizTalk M-Files adapter.
BizTalk M-Files Adapter
To successfully configure “send BizTalk M-Files Adapter”, we have to define three main things:
1. Common connection properties and custom properties for send adapter such as Property override.
2. Server and vault connection is environment specific, they will not be described here. It is only
important to enter correct values which can be tested with Test connection buttons on Server and
Vault Tabs. How to configure BizTalk M-Files Adapter is explained here.
3. To define static properties for file movement, we used Property Override tab on BMA send adapter.
Unitfly Sync Users to M-Files 8
As seen on the picture, we have enabled override context properties checkbox together with some other
properties on the list.
Chosen properties are:
• Document type: File
o That means that every BizTalk message that goes through that send port will be uploaded to
M-Files vault as a document, and not as an object. That is important because our initial case
was to upload documents from legacy DMS.
• Object Type: 0
o Here we have set up Object Type ID for uploaded documents to be 0 which is defined to be
“Document Object Type” in M-Files. This is default value for built-in type and all vaults
should have Document Object Type ID = 0.
Unitfly Sync Users to M-Files 9
• Object Class: 3
o We want all documents classified as a Legacy Document Class in Object Type Document. Our
Legacy Document class has ID 3. This is vault specific as ID is dynamically set when new
object class is defined, meaning that in some other case there will be some other ID.
All other properties were left on default values.
WCF
In this scenario we connected BizTalk to Microsoft SQL database, however BizTalk can connect to an Oracle
database out of the box or to any other database with custom adapters.
To enable enrichment of collected document we need WCF-Custom adapter with specific binding, in our
case sqlBinding.
Schemas and bindings were defined through Visual Studio and Consume Adapter Service dialog. There
were some initial problems with sqlBinding, including the fact that BizTalk Azure VM does not come with
LOB adapters preinstalled. More on this in some other post.
FILE
File adapter is used to collect a document from share where our legacy system keeps all the documents.
There is no additional logic set up here except Folder and File mask that were defined.
Unitfly Sync Users to M-Files 10
Visual Studio This scenario needed some custom development in Visual Studio. To be able to migrate or sync Legacy
System to M-Files we need to do two main things in VS:
1. Get property schema from M-Files
2. Create BizTalk orchestration for business logic implementation
For start, we need to generate property schema. Property schemas are from M-Files vaults and they are
specific for every vault. This can be done following this steps:
Get property schema from M-Files Server
1. On BizTalk Project, click Add -> Add Generated Items -> choose Add Adapter Metadata
2. On the list, choose M-Files as desired adapter.
a. On this window we can but don’t have to choose port. If we choose port, server and vault
connection will be collected from port definition. If we leave port blank, than we can choose
server and vault connection in the next window. As we haven’t configured port just yet, we
will leave it blank.
3. Enter Server and Vault properties and save.
Unitfly Sync Users to M-Files 11
4. After saving properties, new BizTalk Orchestration and MFilesPropertiesSchema will be generated in
a solution.
MFilesPropertiesSchema contains all properties from M-Files vault mapped to BizTalk property schema so
we can define properties when uploading files/objects with BMA.
Unitfly Sync Users to M-Files 12
Create business logic using BizTalk orchestration
We have reused orchestration generated from previous step and added required logic inside.
This orchestration is in charge of management and enhancement of collected documents as described in
the following steps:
1. Collects initial document - ReceiveDocument Receive shape that receives message Document of
message type System.Xml.XmlDocument
2. Extracts Document ID from file name and creates request message for database - CreateReq
Message Assigment shape with following code:
// get id from file name
ID = Document(FILE.ReceivedFileName);
ID = ID.Substring(ID.IndexOf('-') + 1, ID.IndexOf('.') - ID.IndexOf('-') - 1);
// put id in request message
xmlDoc = new System.Xml.XmlDocument();
xmlDoc.LoadXml("<ns0:GetDocumentInfo
xmlns:ns0='http://schemas.microsoft.com/Sql/2008/05/TypedProcedures/dbo'>"
+ "<ns0:DocumentID>" + ID + "</ns0:DocumentID>"
+ "</ns0:GetDocumentInfo>");
DocInfoRequest = xmlDoc;
GetDocumentInfo - stored procedure in a legacy database which returns data for a specific file ID.
DocInfoRequest - request for database and its message type is defined with schema consumed with
Consume Adapter Service dialog for WCF adapter. As for ID, it was defined that ID will be in filename after ‘-
’ character and before the file name extension.
3. Sends request and receives response - SendInfoReq and ReceiveInfoResp shapes that are
responsible for communication with database.
4. Adds additional properties to received document - UpdateDocument Message Assigment shape
with following code:
Unitfly Sync Users to M-Files 13
UpdatedDocument = Document;
UpdatedDocument(*) = Document(*);
// adding mfiles properties
Xpath = "string(/*[local-name()='GetDocumentInfoResponse' and namespace-
uri()='http://schemas.microsoft.com/Sql/2008/05/TypedProcedures/dbo']/*[local-
name()='StoredProcedureResultSet0' and namespace-
uri()='http://schemas.microsoft.com/Sql/2008/05/TypedProcedures/dbo']/*[local-
name()='StoredProcedureResultSet0' and namespace-
uri()='http://schemas.microsoft.com/Sql/2008/05/ProceduresResultSets/dbo/GetDocumentInfo']/*[lo
cal-name()='DocumentID' and namespace-
uri()='http://schemas.microsoft.com/Sql/2008/05/ProceduresResultSets/dbo/GetDocumentInfo'])";
UpdatedDocument(UC3.LegacyID_1024__1) = xpath(DocInfoResponse, Xpath);
Xpath = "string(/*[local-name()='GetDocumentInfoResponse' and namespace-
uri()='http://schemas.microsoft.com/Sql/2008/05/TypedProcedures/dbo']/*[local-
name()='StoredProcedureResultSet0' and namespace-
uri()='http://schemas.microsoft.com/Sql/2008/05/TypedProcedures/dbo']/*[local-
name()='StoredProcedureResultSet0' and namespace-
uri()='http://schemas.microsoft.com/Sql/2008/05/ProceduresResultSets/dbo/GetDocumentInfo']/*[lo
cal-name()='DocumentName' and namespace-
uri()='http://schemas.microsoft.com/Sql/2008/05/ProceduresResultSets/dbo/GetDocumentInfo'])";
UpdatedDocument(UC3.Name_1021__1) = xpath(DocInfoResponse, Xpath);
Xpath = "string(/*[local-name()='GetDocumentInfoResponse' and namespace-
uri()='http://schemas.microsoft.com/Sql/2008/05/TypedProcedures/dbo']/*[local-
name()='StoredProcedureResultSet0' and namespace-
uri()='http://schemas.microsoft.com/Sql/2008/05/TypedProcedures/dbo']/*[local-
name()='StoredProcedureResultSet0' and namespace-
uri()='http://schemas.microsoft.com/Sql/2008/05/ProceduresResultSets/dbo/GetDocumentInfo']/*[lo
cal-name()='DocumentType' and namespace-
uri()='http://schemas.microsoft.com/Sql/2008/05/ProceduresResultSets/dbo/GetDocumentInfo'])";
UpdatedDocument(UC3.DocumentType_1025__1) = xpath(DocInfoResponse, Xpath);
Xpath = "string(/*[local-name()='GetDocumentInfoResponse' and namespace-
uri()='http://schemas.microsoft.com/Sql/2008/05/TypedProcedures/dbo']/*[local-
name()='StoredProcedureResultSet0' and namespace-
uri()='http://schemas.microsoft.com/Sql/2008/05/TypedProcedures/dbo']/*[local-
name()='StoredProcedureResultSet0' and namespace-
uri()='http://schemas.microsoft.com/Sql/2008/05/ProceduresResultSets/dbo/GetDocumentInfo']/*[lo
cal-name()='ResponsiblePerson' and namespace-
uri()='http://schemas.microsoft.com/Sql/2008/05/ProceduresResultSets/dbo/GetDocumentInfo'])";
UpdatedDocument(UC3.ResponsiblePerson_1027__1) = xpath(DocInfoResponse, Xpath);
Xpath = "string(/*[local-name()='GetDocumentInfoResponse' and namespace-
uri()='http://schemas.microsoft.com/Sql/2008/05/TypedProcedures/dbo']/*[local-
name()='StoredProcedureResultSet0' and namespace-
uri()='http://schemas.microsoft.com/Sql/2008/05/TypedProcedures/dbo']/*[local-
name()='StoredProcedureResultSet0' and namespace-
uri()='http://schemas.microsoft.com/Sql/2008/05/ProceduresResultSets/dbo/GetDocumentInfo']/*[lo
cal-name()='Project' and namespace-
uri()='http://schemas.microsoft.com/Sql/2008/05/ProceduresResultSets/dbo/GetDocumentInfo'])";
UpdatedDocument(UC3.ProjectName_1026__1) = xpath(DocInfoResponse, Xpath);
Unitfly Sync Users to M-Files 14
Where each property from database is mapped to context property on a new message.
5. Sends updated document - SendDocument Send shape that sends updated document out of the
BizTalk.
With this combination of orchestration and property schema, we are able to implement dynamic properties,
so every document has its own values when uploaded to M-Files.
Unitfly Sync Users to M-Files 15
Results
Our cooperation with customer brought fantastic results. With our help, customer has migrated all the
documents and data from legacy DMS. We have also configured synchronization with Legacy DMS and M-
Files for a smooth transition and also implemented single sign-on across their systems and built sustainable
platform for future integration and identity management. People management, motivation, per user
approach have never been easier to handle.
Unitfly Sync Users to M-Files 16
Contact Us Feel free to contact us, we believe that together we can
transform and improve your business.
Web
unitfly.com
Social Networks
https://twitter.com/unitfly
http://facebook.com/unitfly
http://linkedin.com/company/unitfly