Crime Journey
For this section, we will use Crime Journey as the example to show how to use TIBCO Cloud Integration(TCI) to integrate your own car plate detection model with Project Journey. This tutorial will guide you to build the following architecture.
When you witness a crime and report the car plate number on the liveapp, it would trigger the car plate detection model to find the criminal’s car then send the car information to the dashboard. The dahboard will show the camera’s captured video then identify the criminal’s escaping route, also display the criminal’s relationships by graph for investigation.
In the healthcare journey, we already showed you how to custom your own tgdb and spotfire mods. For this tutorial, we will use pre-built components in GitHub and focus on how to integrate them to create the crime journey.
1. Build the flogo application in TCI
a. Run the script and type the connection information to create the flogo application from template. Since we would co-locate the car plate simulator container with tgdb instance, so type the tgdb domain name as car plate simulator endpoint url. The TCM url will be in the tcm-config.yaml file which you downloaded from TCM portal -> Authentication.
cd labs-journey/src/journey_tci
sh install.sh
b. After running the script, the flogo.json would be created in journey_tci folder.
c. Go the the TCI portal, click Create/Import button on the top right.
d. Select Messaging/Event-base Integration on the left menu, then click Create Flogo App
e. Click Import App
f. Drag and drop your flogo.json then click Upload and click Import.
g. Now, we need to modify some configuration. Click the Connections on the top menu then click Create
h. Select the TIBCO Cloud Messaging eFTL Connection
i. Type the connection information accordind to your tcm-config.yaml then save
j. Back to the App and find your flogo application, then click the flow car_plate_processor
k. Replace the 2 connections in flogo with the one you just created then save
l. Verify the flogo then click Push. you will see the status is deploying
m. Scale the instance from 0 to 1 to run the flogo
n. Check the flogo app is workable by launch configuration
Click into the addCarPlateNumber flow
Click the Test button on the top right
Create a new launch configuration for testing
Type the content for each variable under body
e.g.
id = “30A61235”
manufacturer = “honda”
model = “speed”
color = “red”
caseRef = “c00004”
Click Run then check the return code is 200 in log
o. Set the enpoint visibility to TIBCO Cloud Mesh, click Update
p. Set the deployment stage, click set as live
q. The flogo status would like the picture below
Now, leave it first, we will back to change liveapp configurations after we build the liveapp.
2. Build the liveapp
a. Go the the TIBCO Live App Designerr portal and click New application
b. Select Case Data and follow the configuration below to create Data Field
Id
CaseType
CaseDesc
City
Country
Latitude
Longtitude
State
Street
PostCode
CarPlateNumber
c. Go to the States and add the states as below. Only the Expired is end state, others are all active state
d. Go to the Application and follow the configurations below to create actions
Create Data Journey
Click Edit on the initiate task and configure the Form and Exit state
Drag a Task named InsertRecord and link with initiate task
Configure the following information. For serice, please select the flogo application you publish and specify the addCarPlateNumber
CloseCase
CollectEvidence
UpdateCase
UpdateState
e. Test it and lock for publish, then you can go to Application Admin to publish
3. Back to flogo to configure your liveapp
a. Stop the running flogo by scale down the instance from 1 to 0
b. Modify 3 liveapp configuration in car_plate_processor flow and save
c. Scale up the instance from 0 to 1 again to run the flogo
3. Build the Spotfire Data Stream
a. Go to the TIBCO Cloud Spotfire Data Stream, click Create new
b. Configure with the following information, your TCM connection information would be in tcm-config.yaml
c. Start your Data stream and you will see the status turn to Running
4. Start the Crime journey backend
Install Crime journey backend on the tgdb server
cd labs-journey/src/journey_backend
sh install
Check the containers run successfully
docker container ps -a
5. Start the Crime journey mods
There are 2 mods we would use, one is for graph visualization, the other is for captured video. Start graph mods with your instance information and specify one of journey.
cd labs-journey/src/journey_mods
sh start_mods_server.sh
Then, open another tab and start the video mod
cd labs-journey/src/journey_mods
sh start_video_mods_server.sh
Note: The port number would be different for video mod since the graph mod is running on 9001
6. Build the Spotfire Dashboard
You would build the dashboard base on the template in GitHub. Using Spotfire Desktop to change the data connection in formation then using TIBCO Cloud Spotfire to add the mods.
a. Download the template and open it by Spotfire Desktop on the Window machine.
b. Modify the connection information of TGDB, Data Stream and LiveApp in Data connection properties
c. Check all components in the dashboard used your own sources(TGDB, Data Stream, LiveApp)
d. Save it as dxp
e. Go to the TIBCO Cloud Spotfire and upload the dxp file
f. Add the graph mod and video mod to the dahsboard.(two mods are running on different ports)
For the detail of adding mods, please reference this getting started section. If the graph or video do not show successfully, please follow the Troubleshooting section to check the certification.
7. Start the Crime journey UI
You would use TIBCO Cloud Composer to pack all components into one application.
Run the start_journey_ui.sh with your connection information
cd labs-journey/src/journey_ui/
sh start_journey_ui.sh
The sucessful message would show as below
8. Test the Crime journey
a. Open the Crime journey ui on browser(e.g. https://localhost:4200)
b. Turn on the simulator on the top right
c. Create a crime case
e.g.
CaseType = “Transportation Violation”
CaseDesc = “Speeding”
CarPlateNumber = “30A61235”
d. The car which matched the reported car plate number would be detected. The crime escape route, captured video, and the criminal relationships graph would show on the dahsboard instantly.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.