- This project contains the API to interact with FIWARE context broker - Orion.
- All communication between the backend and Orion is through this API, this means that all the other components (LATTE, Fi-BREW, COFFEE) access this API to perform some action in the Broker. This action can be anything: create/get/update/delete an entity, or manipulate subscriptions for example.
Install the following tools:
- Clone this repo to your local machine using
https://gitlab.com/bright-technologies/dalma/broker.git - Compile API
$ cd <project_cloned>
$ mvn clean install- Broker requires mongo database, thus install the following two docker images:
$ docker run --name mongodb -d mongo:3.4$ docker run -d --name orion1 --link mongodb:mongodb -p 1026:1026 fiware/orion -dbhost mongodb- Enter in project cloned folder and execute api:
java -jar broker-api-web/target/dalma-broker-api.jar
- All endpoints are exposed in Swagger at:
http://localhost:8090/swagger-ui.html. - All controllers expose the CRUD actions for the related entities:
Idle Station,Robot,Subscription,Warehouse,Warehouse Material,Work Order,Work Station. - Critical endpoints at Robot Controller:
/notification/status: This is the endpoint used in Orion callback to notify about Robot attributes change:battery,status,locationandheartbeat.
- Critical endpoints at WorkOrder Controller:
/integrate: This is the endpoint called by COFFEE to integrate work orders from SAP in Orion./notification/integrate/latte: This is the endpoint used in Orion callback to notify that Work Order integration has finished. This Broker API will call LATTE to schedule the work orders execution./notification/integrate/fibrew: This is the endpoint used in Orion callback to notify that Work Order integration has finished. This Broker API will call Fi-BREW to integrate work orders in Modula's database.
This notion of "work order integration finished" was created because the integration is not just insert the work order in Orion, then it is associated with references the warehouse and the workstation. Only when everything is updated in Orion, it is created the attribute integrated that will trigger these callbacks.
- The system was prepared to support multiple robots, and therefore multiple idle stations. But the idle station is not reserved forever to a specific robot.
- Every time that a robot ends a work order, the system search for a idle station that is not occupied by any other robot, picks the first one, mark the idle station as occupied and insert in Orion a
referenceattribute to the Robot that is using the idle station. - Following the same logic, every time that the robot starts a new work order, the idle station is marked as available to be usable by any robot.
- The attribute location in all entities is a
geo:jsonfield, with the typePoint. - This type, by default, contains an array of
coordinateswhere the first value islatitudeand the secondlongitude. - However, the robot is not expecting this order, thus, it is being used the order
longitudeand thenlatitude.
- If for some reason the work order did not start with the log exception
NoneRobotAvailableExceptioncheck the following in Orion's robot entity:- Attribute
available: This attribute is defined with the addition of thebattery level,status, and if is executing awork order - Check if the minimum battery level was changed
- Attribute
- The postman collection for all FEATS system is available in LATTE repository.