Integration with database to populate fields in Pega.
First, let me try to explain what the purpose of this idea was. As for learning and demo purposes, I wanted to populate a dropdown in my local PRPC client using an external source (database) with its contents.
Since I'm BA & SA certified, this topic is briefly discussed but certainly not good enough to fully do it yourself. I've followed this guide to setup my local database (Using MySQL) and making the connections with Pega.
When I run the activity that was created by running the Connector and Metadata Accelerator ("Browsecustomer", as my scheme name is customer) I do see the records as the guide itself shows. The guide ends with: Now you can use the activity to populate a dropdown field in your local PRPC.
This is where I got and still am stuck and don't know what to do. I've discussed with a few colleagues who amongst them were CSA certified and tried to make this work. The point where I am now is I've created a Data Page of List Type. The Data Source for this Data Page is the activity created and mentioned above "Browsecustomer". I've then added one of the fields generated in Pega (first_name wich is one of my records in the database) into a section and used a Data Page as list source for this field. The Data Page mentioned is the one I've sourced with the activity. Property for value was entered with .id and for display .first_name.
Running this section gives me an XML (see attachments). I'm not sure what it is I have to do to make this populating work, I've tried adding a page list with the Data Page source as well.
I'm curious if anyone has any insights on how I can resolve / make this work.
***Updated by Moderator: Lochan. Removed user added helpme tag. Apologies for confusion, shouldn't have been an end-user option***
If you want a simple drop down implementation from an external table, you can use 'Database external class mapping' wizard, where you can map your any concrete class with the external DB table. Next, you can map properties created in that class to the columns in DB table. This should suffice for getting a list of values in dropdown where you give shource as from single property.
If you want to go with the data page, then first go for the external class mapping. Create a report definition rule for the properties you want to use for drop down, and use that report definition as source for your datapage.Using Report Definition rule will allow to control the results you want to fetch from database.
Sorry for not responding earlier. Good news is: problem resolved! I've created an SQL rule that uses the created database. The SQL rule is being used as a method for an activity which populates the data page. This does not return the XML while running the section as the activity uses a method made for the SQL rule which supports mySQL. This workaround most likely works because the default method does not support mySQL as you mentioned.
Thank you for your reply. I did look into the definition rule and the wizard, did not get really far but I do understand how that would work in regular instances.