TIBCO Scribe® Platform API Connector Sample

Disclaimer

Copyright (c) 2019, TIBCO Software Inc. All rights reserved.

No Support. You acknowledge that TIBCO will not provide any maintenance or support for this software. You have no right to receive any upgrades, patches, enhancements, bug fixes, new versions or new releases of the software.

Internal Use Only License Grant. TIBCO hereby grants you a limited, non‐transferable, non‐exclusive license to use the software solely for your internal business purposes. The name of TIBCO Software Inc. may not be used to endorse or promote products derived from this software without specific prior written permission of TIBCO Software Inc.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT OWNERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The TIBCO Scribe® Platform API Connector is the actual source code for a Connector built by TIBCO Scribe®. This Connector is available in the TIBCO Scribe® Marketplace and is designed to be used to orchestrate and automate functions in TIBCO Scribe®. This is a great example of how the CDK can be used with a RESTful API, such as ours. The Sample includes a document that explains the methodology used to examine the API and, based on that analysis, how the Connector needed to be implemented. TIBCO Scribe® Platform API Connector Sample is available for reuse or you can add additional functionality if you wish. Access the TIBCO Scribe® Platform API Connector Sample code by clicking this link:

Sample — TIBCO Scribe® Platform API Connector

During the planning phase, we started off with a few guiding principles:

  • Be as thin as possible without adding custom logic unless necessary. This prevents extensive rewriting if the API changes.
  • Use the same language as the API, by maintaining named entities and their properties as represented in the API.
  • Return exact results without adding new data.
  • Have a one-to-one mapping between entities in the Connector and the API.

There were a few cases where, in the interest of a better user experience, we had to break some of the rules. These included providing additional data that was part of the initial request in the response from the Connector. For special operations, which do not fit the normal CRUD module, such as start Solution and clone Solution, we provided virtual entities within an operation called Command. For long running operations, which required polling for status (async), we combined the request and the polling into one action. These are just a few cases that did not match our principles.

For information on using the TIBCO Scribe® Platform API Connector through the TIBCO Scribe® UI, see TIBCO Scribe® Connector For TIBCO Scribe® Platform API in the TIBCO Scribe® Help.

General Requirements

Build Environment

  • .NET Framework 4.5.2 or Mono
    • .NET Framework 4.6 is required for building and running benchmarks because BenchmarkDotNet requires it
  • Internet connection to restore all NuGet dependencies

Runtime Environment

  • .NET Framework 4.7.2

Repository Structure

This is an example of the repository structure used during the development of the TIBCO Scribe® Platform API Connector.

When setting up your own repository, keep the following in mind:

  • Binaries Folder — Should contain any dependencies that cannot be downloaded via NuGet.
  • SolutionAssemblyInfo.cs — Contains common assembly metadata for all projects in the solution
    • Add this file as a link to all projects in the solution
    • Do not update this file manually. The Build script will update it.
  • Each project should have a test project unless there is a justification for not having it, such as auto-generated code.
  • Test projects
    • Name the test project the same as the related project with .Test appended:

      Scribe.Connector.ScribeApi.Test.csproj

    • Place test projects under the Test folder located directly in the project folder:

      Scribe.Connector.ScribeApi

      ├── Test
      │   └── Scribe.Connector.ScribeApi.Test.csproj 
      └── Scribe.Connector.ScribeApi.csproj
  • build.cmd and build.sh — Bootstrapping wrappers around the build script in build.fsx

 

See

TIBCO Scribe® Platform API Connector Sample — Solution Structure

TIBCO Scribe® Platform API Connector Sample — Dependencies

TIBCO Scribe® Platform API Connector Sample — Build