DMC POD Plugin local development environment in VS Code
As developers, we understand the need for efficiency and convenience when working on SAP DMC POD Plugins. Traditionally, the process involved building and deploying plugins, often leading to delays and a less-than-optimal development experience. But there’s a new solution in town – the DMC POD Plugin local development environment.
An Evolution in DMC Plugin Development
In the past, developing SAP DMC POD Plugins meant building, deploying, and then waiting to see the results. It was a process that sometimes made experimentation and rapid iteration quite challenging. But we’ve changed the game.
Introducing the Local Development Environment
This local development environment is built upon a Yeoman generator that extends the work of our colleague, @kevin.hunter3. Here’s what you can expect from it:
1. Real-Time Feedback
No more waiting for deployments! With this local development environment, you can instantly see the effects of your changes. This real-time feedback streamlines your development process, allowing for faster progress and decision-making.
2. Seamlessly Integrated APIs
This environment integrates smoothly with both public and internal APIs. This means you can work with real data right in your local setup. No more juggling test environments or dealing with data transfers – everything is at your fingertips.
3. Enhanced Utility Methods
We’ve added a set of handy utility methods, including
getUser, and more. These utilities simplify your development tasks and reduce the need for repetitive code.
4. Promise-Based Ajax Requests
To handle asynchronous operations more effectively, we’ve introduced promise-based Ajax requests. This results in cleaner and more readable code.
Now, let’s explore how to get started with this local development environment:
Before diving in, ensure you have the following configurations handy:
User Email:Your SAP DMC access email.
SAP DMC Host Address:e.g., ‘yourhost.execution.eu20.dmc.cloud.sap’.
CF Endpoint URL:Obtain it from your BTP subaccount page.
Manufacturing-Execution-Integration Server URL:Found in your service key configuration file.
Public API Endpoint:Located in the service key configuration file under the UAA section.
Authorization Token URL:Also in the service key configuration file under the UAA section as ‘url’.
Client ID, and Client Secret:Both found in your service key configuration file under the UAA section.
Generating Your Project
- Ensure you have Node.js installed on your system.
- Globally install Yeoman and the
npm install -g yo npm install generator-dmcpodplugin-local
- Open your terminal or command prompt.
- Run the generator with this command:
- Follow the prompts, providing the required information. The generator will create the template code based on your responses.
Optional: Installing Build and Deploy Dependencies for VS Code
If you’re using BTP for plugin development, you can skip this step as BTP already includes pre-installed build and deploy tools.
If you’re using a local system and VS Code, you can follow these optional steps:
- Open a command prompt.
- Check if ‘choco’ is installed by running ‘choco -v’.
- incase you don’t have choco installed, install it from official website
- If ‘choco’ exists, install ‘make’ by running this command in PowerShell:
choco install make
- Open a terminal.
- Install ‘make’ by running this command:
brew install make
- Download and install Cloud Foundry CLI from the official Git repository.
- Install ‘mbt’ and ‘multiapps’ globally:
npm install -g mbt cf install-plugin multiapps
Running Your Project Locally
- Once the template is generated, start the application on your localhost by running below command in root folder:
npm run start
- To build the app, run:
npm run build
This will generate a new
.mtarfile in the ‘mta_archives’ folder.
- Before deploying the app, log in to Cloud Foundry using below command in new terminal:
npm run login
You can set the default org and space by specifying additional arguments in the ‘package.json’ file.
- Deploy the plugin to your BTP Space by running this command:
npm run deploy
If you want to run build and deploy commands together, use:
npm run bd
5. Follow the blog post post to configure the Pod plugin in SAP DMC
Check my git repository for complete Documentation.
That’s it! You’re now ready to streamline your SAP DMC POD Plugin development using this local development environment. Enjoy the coding!