In this how-to, you are going to expand the shipments that will be tracked by the app and also improve the input form.
This how-to will teach you how to do the following:
- Add a new shipment with a sensing device
- Improve the input form
Before starting with this how-to, make sure you have completed the following prerequisite:
- Use the previous how-to in this series: How to Build a Logistics IoT App Step 5: Create Alerts
3 Expanding the IoT App Tracking (Step 6)
3.1 Adding a New Shipment with a Sensing Device (Step 6.1)
To add a new shipment, follow these steps:
- In the Desktop Modeler, open the Homepage.
- Right-click the first row of the Layout grid and select Insert row above. Select the default full row option.
- In this new row, right-click and add a Create button.
- In the Select entity dialog box, select the Shipment entity.
- Right-click the New button and select Generate page….
- Enter Shipment_New for the Page name, then select PopupLayout for the Navigation layout.
- Select Forms > Form basic horizontal, then click OK.
- Right-click the New button and select Go to page.
- On this new form, delete the input fields that you don’t want to provide yet: Lat, Lng, Is alerted for temperature, Latest sensor update, and Sensor view.
- Select the drop zone below Cargo value and in the Connector, expand Shipment_CargoType and double-click Cargo Type > Description to create a reference selector.
- Select the drop zone below Cargo Type and in the Connector, expand Shipment_Topic and double click Topic > Name to create another reference selector.
- Select the whole page and in the Properties pane, set Navigation > Visible for to User.
- Save the changes, click Run Locally, then click View.
- On the Global shipments page of the app, click New. This adds a new shipment to the homepage. If you’d like to see a detailed shipment instance on the app homepage, you can fill in the details on the Edit Shipment form.
3.2 Improving the Input Form (Step 6.2)
To improve the input form, follow these steps:
- In the Desktop Modeler, open the Shipment_New form and select Topic.
- In the Properties pane, select Selectable objects > Source > Microflow.
- Click Microflow and then click New to create a new microflow. Name the new microflow GetAvailableTopics, and then open this new microflow.
- Add a Retrieve activity to the microflow. Select From database as sthe ource and set the Entity to Topic.
- For the XPath constraint, enter
- Open the End Event. For the Return value, enter
- In the Properties for the microflow, set Allowed roles to User.
- Save the changes, click Run Locally, and click View. Observe how the Topic drop-down menu only includes the topics that are available.
Congratulations! You have completed this how-to.
We are very interested in your feedback. Please take this short survey to let us know what you think about this how-to.
5 Related Content
- How to Build a Logistics IoT App
- How to Build a Logistics IoT App Step 1: Connect App Pages
- How to Build a Logistics IoT App Step 2: Configure the Sensor Data Subscription
- How to Build a Logistics IoT App Step 3: Handle the Sensor Data
- How to Build a Logistics IoT App Step 4: Add Another Data Dimension
- How to Build a Logistics IoT App Step 5: Create Alerts