Tech Demo | Step 5 – Set up AIM scripting
1. Configure AIM for the tech demo
We’ll be running a REST API using Ruby on port 4567 for this tech demo, and so we need to tell AIM where that endpoint is.
Start up AIM Modeller.exe
click File, then Options, and then make these changes
- Check Run in background so that the model still runs even if AIM is not the foreground app.
- Check ‘HTTP’ for the AIM Server Transport Mode field, since we’ll be doing REST over HTTP.
- Enter ‘localhost://4567’ in the AIM Server HTTP field.
Then click Save Options.
2. Start MongoDB
Review and edit the run-mongodb.bat script to make sure the paths match where you installed the tech demo, e.g. c:/files.
Then start MongoDB.
3. Configure MongoDB data for tech demo
RUn this script to set up some default data in MongoDB, that the tech demo scenarios need.
This just populates the stock collection in the warehouse DB, so when an order is received we have stock to ship.
4. Start the Ruby scripting servers
Run this script. The -with-restart script requires that you did a ‘gem install restart’ (in the Setup Ruby) step, so that any changes to the Ruby scripts (.rb files) in c:/files/techdemo/scripts will be auto-reloaded, i.e. you don’t need to stop/start the REST API servers.
You should get 3 windows appearing, each with 1 Ruby REST API server. The title of each window is:
- AIM SERVER – The main REST API that AIM communicates with on port 4567
- WAREHOUSE – Manages the warehouse domain. Receives requests from AIM SERVER and communicates with the ‘techdemo-warehouse’ Mongo db.
- ORDERS – Manages the ordering domain. Receives requests from AIM SERVER and communicates with the ‘techdemo-orders’ Mongo db.
5. Run a business scenario
Check that AIM can see the scenario servers
Pick a scenario and run it.
Check the state of MongoDB collections