Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

????This description is based on development with Visual Studio as tool which is also what we recommend?????

Anchor
_Toc98833917
_Toc98833917
Visual Studio Extension

How to install the Visual Studio 2019 enterprise integration extension

...

5 Click “Close” in the appearing window:

...

Anchor
_Toc98833918
_Toc98833918
How to create a local integration Account project in Visual Studio 2019

This example shows how to create a local Integration Account project i.e., without using a code-repository such as Azure DevOps.

...

You could name the Solution/Project “MySampleEnterpriseIntegration”

Anchor
_Toc98833919
_Toc98833919
How to create an XSD Schema in the project?

Create an XSD file by right clicking the projectname and choose Add -> New Item

...

Open the MySecondSchema.xsd file in Visual Studio and create a simple schema of your own choice, or use the schema below and save your file

...

Anchor
_Toc98833920
_Toc98833920
How to create a visual map in the project?

If you want to create mappings between fields in XSD files, then you must create a map file in the project.

...

The map file is now added to your project

...

If you want to map fields using the visual mapper (.btm), then you must open the file in Visual Studio

...

C:\Users\[user]\source\repos\MySampleEnterpriseIntegration\bin\Debug

...

Getting the XSLT is just a matter of right clicking the project name and choose “Build”

...

C:\Users\[user]\source\repos\MySampleEnterpriseIntegration\bin\Debug

...

You will not find XSD files in the same location as the XSLT file that gets generated via Build.

...

C:\Users\[user]\source\repos\MySampleEnterpriseIntegration

...

When you right click a .xsd file in the Visual Studio project, then you get three options of interest, but we will only focus on one option now.

...

Change those default values into values of your own choice and save the file

To test your visual map by providing an input file, follow these steps:

...

  1. To locate the generated output file, you must look in the “Output” window.

  2. Look for the location specified right after this sentence “The output is stored in the following file: <your file location is here>

  3. Open that file in your desired texteditor. You should see something like this.

...

If you want to use Functoids in your visual map, then follow these steps:

...

If you inspect the generated XSLT file, you will see that required namespaces have automatically been added and that the Functoid code has become inline C# code:

If you do not want to work with visual maps, then you can apply the method explained below.

...

When working solely with the XSLT file, then you can add the file(s) to the project and not have to use Build to get a new version of the XSLT, as you would when only working with the visual mapper.

If you have chosen not to use the visual mapper, and only work directly with XSLT, then you still have the option to use inline C# to build custom logic.

...

Ignore the error message. It has no functional influence when you right click your .btm file and select “Test map”. An output will get generated and the return value from the method call will be inserted in the generated file.

...

Anchor
_Toc98833929
_Toc98833929
Link Functoids

To set up a custom functoid you must place the functoid .dll file in this location (Visual Studio 2019 Community), if not done so already in the environment you work in. If you need to set it up yourself, then you must get hold of the required .dll file from Bizbrains.

...

  1. Now try and drag and drop “DistributionObjectName” into the map canvas and drag a connection from it to a target element.

  2. Right click your project of type “Integration Account” and choose Build/Rebuild.

  3. Go to the bin/Debug folder and verify that an XSLT file has been created. Try opening the file in e.g., Notepad++

  4. The XSLT file contains code that is inserted by the custom functoid. That code will be executed in a runtime scenario, where data from Link will be retrieved and inserted as part of the actual data transformation.

<xsl:variablename="var:v1"select="ScriptNS0:GetDocumentDistributionObjectName()" />

Anchor
_Toc98833930
_Toc98833930
Unit test

There are a couple of activities associated with unit testing an XSLT, and below we will describe the necessary steps to set it up.

At a glance, you must download and install a special Visual Studio project that Bizbrains has prepared. Next, you must install a Nuget package which will make it possible to communicate with Link’s Rest API.

Local testing is possible without setting up a unit test project. I.e., you can test a mapping that does not query data from Link using Test Map facility, which we will not describe here.

...

it is expected that you have created an integration account project and want to add a unit test project to the solution.

  1. Download the Visual Studio project template below. At the moment of writing, you can download the project template as a .zip package from this location: /wiki/spaces/PT/pages/2386493483

  2. Follow the instructions from the same Wiki page.

  3. Do not proceed if you are not able to see the installed project template in Visual Studio.

  4. Now you must right-click your solution (.sln) in the Visual Studio Solution Explorer and choose Add > New Project…

  5. Search for “Bizbrains” or scroll to the bottom to locate this project template:

...

  1. Open Tools > Options and search for ‘just’ in the Search Options field.

  2. Ensure that this checkbox is not checked

...

Assumption: you have created a unit test project based on the Bizbrains Visual Studio project template.

...

Assert.AreEqual(xmlOutput.SelectSingleNode("//SomeXpath/someElement").InnerText, "Testing123");