A cab booking application uses decision management.
A decision data (proposition) Cab is created to hold different Cabs. Each Cab has characteristics like RegistrationNo, Model, make etc. As proposition can not be updated dynamically (e.g. Availability of Cab, CurrentLocation) a data set is created which represents Cab inventory.
Cab Proposition Class: MyCo-IFare-SR-TravelService-Cab
Cab Inventory Data class: MyCo-IFare-Data-Vehicle-Cars
The class MyCo-IFare-Data-Vehicle-Cars has similar properties as present in proposition. It is mapped with a database table called pr_data_ifare_Cars. The property registrationNo is key of the table. The proposition class MyCo-IFare-SR-TravelService-Cab has key as pyName by default. The proposition also has the RegistrationNo which is same as in inventory.
For a single car, there is one entry in proposition class with registrationNo and one entry in MyCo-IFare-Data-Vehicle-Cars class with same registrationNo. This way we can offer propositions and also change availability status and current location of a car in inventory.
We have created a data flow and a strategy. This data flow and strategy rule are in a class called MyCo-IFare-Data-Route. Inside strategy we are using a Data import shape to import car inventory. A thread level data page is used to import list of cars from inventory. There is a proposition data shape to load Cab propositions. After that we are using a Data Join shape to join the propositions with inventory data. Join condition matches RegistrationNo in proposition with registrationNo in Data-Vehicle-Cars class.
When we run the case or strategy rule alone, even if registrationNo in proposition class and Data class are matching the Data Join returns zero results. By running strategy rule along with tracer we can see that, data import shape populates the D_CarsList data page correctly; also the proposition data is populated. But the data join shape fails to join the two datas using registrationNo.
Implementation Steps :
1. Run Pega application wizard to create implementation layer application.
2. Create a Business Issue as TraverService and add a group called Cab in it. this creates a class MyCO-IFare-SR-TravelService-Cab
3. Create propositions for various cars under Cab. Each proposition will have a unique RegistrationNo.
4. create a data type Cars with class MyCo-IFare-Data-Vehicle-Cars. Add the Car details using records tab. These car details should match with that of propositions.
5. Create another class MyCO-Ifare-Data-Route. From the case flow call a data flow GetNextCar in this class. The data flow should call the strategy GetNextCar.
6. Inside the strategy, add a data import shape and mention the source as D_CarsList. The data page D_CarsList is a thread level data page of type MyCo-IFare-Data-Vehicle-Cars.
7. Add a proposition data shape to import the Cab proposition data
8. Create a Data join shape to match the results from above two shapes using RegistrationNo as the matching key.
9. Run the strategy rule to see the results. The data import shape will populate the D_CarsList data page, the proposition data shape loads the propositions, but after data join shape there are no results