Creating data objects in App Studio

I have a question relating to where in the class structure data objects are created in App Studio. This is for Pega 8.8.3 and is a brand-new application built on Theme-Cosmos in hybrid mode.

We have the following application structure: MyApp_Dev is built on MyApp

MyApp_Dev is just where we create branches for development so that MyApp doesn’t ‘see’ them until we merge.

From App Studio, we went to add a new data object and called it ‘Country’. In the Advanced section, the ‘Reuse assets from’ dropdown was empty. Then clicked Next and got the message “This record has 1 error(s) in 1 place(s). Parent Class—Class MyOrg-MyApp-Data does not exist. Please define an existing parent class.”

The MyOrg-MyApp-Data does exist though!

Then in Dev Studio we verified the class existed, created a class manually and then deleted it

Back in App Studio we went to create the DO again. This time we got no error message and we then went through the process of creating the DO by importing the field names from a spreadsheet and all this went well - the properties, data pages etc we all created. The problem is where they were created.

  • We wanted the class to be MyOrg-MyApp-Data-Country
  • The actual class created was MyOrg-MyApp_Dev-SR-Country

I need to understand why it created this new class (MyOrg-MyApp_Dev-SR) and why I wasn’t given the choice about where it should be created. We do want data classes/objects to be in MyOrg-MyApp-Data.

If anyone can shed any light on this we’d be most appreciative.

Hi @andwww: This shouldn’t be the case and it is working good for me. Can you also check the data class mentioned in application rule Cases and data tab?

When it worked without error, what did you selected in the “Reuse Assets from”?

Thanks.

@ArulDevan Thanks for the reply.

Both the MyApp and MyApp_Dev application rules have the associated data class as MyOrg-MyApp-Data

As a test, I changed the associated data classes listed on both apps to “MyOrg-Data”, saved and logged out and back in. I also cleared out any ‘old’ classes that I’d created. I then went back into App Studio to create another data object and get the same problem with the empty dropdown.

The time I did see something in the dropdown was after I had created a new class through Dev Studio - then it appeared ok in App Studio

So I’ve just discovered something.

When creating a data object from MyApp_Dev, initially there were no entries in the “Reuse assets from” dropdown. However, when creating a data type in Dev Studio that class subsequently became visible in the dropdown. I wondered if it was because the data class specified on the Cases & data tab in the application definition was abstract rather than concrete, although I didn’t see the logic in this.

When creating a data object from MyApp, the “Reuse assets from” dropdown is populated as expected.

I’ve since deduced that the MyApp:01-01 ruleset needs to be explicitly referenced on the application rule for MyApp_Dev - it doesn’t pick it up by being a built-on application!

@andwww I too faced this problem recently and understood that the Reuse assets from dropdown is populated based on Associated data classes list below. If you add your Org-App-Data class to the below list you can see the same in the dropdown. I know that the class is Abstract but still we can add to make it work :slight_smile: