Skip to main content

Domain Service

🎯Overview

In this course you will learn about Domain Service development in IBM Industry Solutions Workbench and how it helps you to speed up your microservice development.

Exercise

Estimated time: 30 minutes Supported languages: TypeScript and Java

During the courses around Domain Service Development, you will extend the existing service project "Orders" of Pizza Universe which cares about handling all the incoming orders from the web shop.

Therefore, you will import the Orders asset from the local marketplace in the Solution Designer with already prepared content.

ℹ️note

Please note that the links to the workbench tools in this tutorial only apply to the IBM Education Environment we provide. If you are using a different environment, e.g. your own installation, you will need to navigate directly to the required tools.

Import Asset and create Orders Project

  1. Open your Workspace in the Solution Designer and click on "Add Project".
  2. Select "Create project from asset".
  3. Select asset catalog Education Assets.
  4. Select asset
    • ORDLCTS if you want to use TypeScript or
    • ORDLCJ if you want to use Java as implementation language.
  5. Skip the step "View Details" and choose an unique Acronym (e. g. ORDLCXYZ where XYZ represents your shorthand) for your project.
  6. Finally choose a Repository Group and click on Import to create your Project.
ℹ️note

If you have chosen the Java asset, you must also specify a Package name of your choice.

  1. Open the created Project and discover the already existing content. You will see that there is already an API defined as well as some domain content modeled and also some integration scenarios defined.
🌟Well Done!

You have successfully created your project from the Orders asset. You can now use this project base for the upcoming exercises in the Domain Service courses.

Create and trigger a pipeline

In this section, we will create and trigger a pipeline for the project that has been imported into your workspace. This steps are done to get changes directly build and deployed to a target destination.

Please perform the following steps:

  1. Click on CI/CD section in the navigation menu.

  2. You need to create a pipeline configuration for your project once. To do so, click on the "Create" button.

  3. Choose "Deploy Pipeline" as type and use <your-deployment-target> as Deployment Target.

  4. Click "Create" at the bottom of the wizard.

  5. In case the pipeline does not get triggered automatically, use the three dot menu on right side of table row and click on the “Run” button.

🌟Well Done!

You have successfully created and triggered pipeline for your project from the Orders asset.

Setup local development

For the implementation of a Domain Service project, it is mandatory to install the Solution CLI and clone the project with it.
Therefore, the following steps only have to be executed if you plan to execute the implementation exercises of the Domain Service training.

❗️Before continuing
  • Ensure that you have setup the necessary prerequisites for local development
    • For installing the CLI, NodeJS has to be available on your machine (https://nodejs.org)
    • For TypeScript please install at least TypeScript see here
    • For Java please install Java SDK and Maven see here

Install Solution CLI

  1. Open your before created project.
  2. Please click in the bottom on "Solution CLI" and open the section "Solution CLI Setup".
  1. Follow the instructions of the section to download and install the CLI. It is recommended to use the Git Bash for the commands.
  1. After installing, please continue with the instructions to setup the CLI. Use your credentials from the Solution Designer to log in.

Clone Project

  1. Stay in the bottom area for the "Solution CLI" and open the section "Implementation".
  2. Follow the instructions to clone the Project.
  1. Open the cloned Project directory with your IDE of choice and inspect the files.
🌟Congratulations!

You have successfully prepared your environment for local development!

Please find more information about Domain Service development: