Question


Pegasystems Inc.
JP
Last activity: 4 Jun 2016 0:32 EDT
How to specify dedicated data base table for each case type in a single pega7 application (7.1.9)
I have 2 classes in a single pega7 application like below
Org-Div-Work: this class is a class group, the instances will be saved in the database table pc_orgdiv_work.
Org-Div-Work-RealWork: this class belongs to class group Org-Div-Work
I wanted to have instances of Org-Div-Work-RealWork to be saved in database table pc_orgdiv_realwork.
I've tried to define Data-Admin-DB-Table for Org-Div-Work-RealWork class without success.
It seems that instances of Org-Div-Work-RealWork still being saved in pc_orgdiv_work table.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!


Pegasystems Inc.
IN
>>> Org-Div-Work-RealWork: this class belongs to class group Org-Div-Work
- the class 'Org-Div-Work-RealWork' should be of type 'this is a class group' to save the instances to database table pc_orgdiv_realwork
Please share your observations/comments, Thank you!
psahukaru


Pegasystems Inc.
JP
Hi Phani,
I got below error message as I try to change "This class" field from "belongs to a class group" to "is a class group"
** Cannot change keys for a class with instances


Pegasystems Inc.
IN
Hi Chunzhi, Good Morning!
- The error is expected if the class has already instances.
- Please delete the instances and update the class definition.
Thank you!
psahukaru
Updated: 18 Jan 2016 0:44 EST


Pegasystems Inc.
JP
Hi Phani,
I found that after changing "This class" setting, 'Org-Div-Work-RealWork' doesn't come up in the case list as I click "+ Create" on the managers portal.
I tried adding 'Org-Div-Work-RealWork' in the work pools list on Advanced tab of my access group, however 'Org-Div-Work-RealWork' still didn't appear.


Pegasystems Inc.
IN
Is the class 'Org-Div-Work-RealWork' specified under cases & data tab of application rule & also please re-save the application rule.
Thank you!
psahukaru


Pegasystems Inc.
JP
Yes. 'Org-Div-Work-RealWork' is specified under cases & data tab of application rule.
I found that the Rule-Application.pyWorkMetaData is not updated after "This class" setting of 'Org-Div-Work-RealWork' is changed to "is a class group", and pyWorkMetaData is being looped in the activity "pzGetStartingFlows" to get a list of case type as "+ Create" is clicked.


Pegasystems Inc.
JP
Another finding is that after changing the "This class" to "is a class group", "open work item" event action doesn't work, however "open work by handle" does.
Below is the error messages when using "open work item".
Work Object Not Found
Application Workpool
Message Unable to open an instance using the given inputs Org-Div-Work C-1


Pegasystems Inc.
IN
the error is expected as the instance will be moved to dedicated table of class 'Org-Div-Work-RealWork'


Pegasystems Inc.
JP
The case is created after the "This class" setting changed to "is a class group" and I confirmed that the pzInsKey value is Org-Div-Work-RealWork C-1 and pyID value is C-1.
By the way, although "+ Create" doesn't show the case type, I am able to create the case by adding a menu item which calls "create work" event action.


Pegasystems Inc.
IN
sorry Chunzhi...
- could we try doing a test connect & re-saving Data-Admin-DB-Table, class rule forms...
- and +Create menu should show up the case type in manager portal on re-save of application rule
- is the check-box ticked for the corresponding implementation class 'Org-Div-Work-RealWork'
Updated: 19 Jan 2016 1:54 EST


Pegasystems Inc.
JP
For "open work item by pyID" issue, unfortunately, "test connect & re-saving Data-Admin-DB-Table" couldn't solve the problem.
However, after re-save of application rule 'Org-Div-Work-RealWork' came up in the "+ Create" case list and "open work item by pyID" works fine too!
Though, I couldn't figure out why this solves the problem.


Pegasystems Inc.
JP
Now, I found another pitfall with "open work item by pyID".
1. Add a new case type Org-Div-Work-OtherWork
2. Change "This class" setting to "is a class group"
3. Add a D-A-D-T for Org-Div-Work-OtherWork
4. Re-save the application rule.
5. Create an instance of Org-Div-Work-OtherWork.
6. Try to open the instance using pyID and get below error message.
Work Object Not Found
Application Workpool
Message Unable to open an instance using the given inputs Org-Div-Work-RealWork O-1
I can see there is two work pool records, (1) Org-Div-Work-RealWork and (2) Org-Div-Work-OtherWork, in the Applciation.pyWorkMetaData.
However, it seems that "open work item by pyID" picked up wrong work pool name to assemble the instance key value.
Updated: 19 Jan 2016 1:55 EST


Pegasystems Inc.
JP
This is a summary for findings so far.
Initial state |
after changing "This class" setting and adding D-A-D-T |
after re-saving D-A-D-T | after re-saving application rule | |||
---|---|---|---|---|---|---|
Class Name | Org-Div-Work | Org-Div-Work-RealWork | Org-Div-Work-RealWork | Org-Div-Work-RealWork | Org-Div-Work | Org-Div-Work-RealWork |
"This class" setting | "is a class group" |
"belongs to a class group" "Org-Div-Work" |
This is a summary for findings so far.
Initial state |
after changing "This class" setting and adding D-A-D-T |
after re-saving D-A-D-T | after re-saving application rule | |||
---|---|---|---|---|---|---|
Class Name | Org-Div-Work | Org-Div-Work-RealWork | Org-Div-Work-RealWork | Org-Div-Work-RealWork | Org-Div-Work | Org-Div-Work-RealWork |
"This class" setting | "is a class group" |
"belongs to a class group" "Org-Div-Work" |
"is a class group" | "is a class group" | "is a class group" | "is a class group" |
D-A-D-T | map to pc_orgdiv_work | N/A | map to pc_orgdiv_realwork | map to pc_orgdiv_realwork | map to pc_orgdiv_work | map to pc_orgdiv_realwork |
Is recognized as work pool? (Application.pyWorkMetaData) |
Yes | No | No | No | No | Yes |
Is recognized as case type? (listed under "+ Create" menu) |
No | Yes | No | No | No | Yes |
Can open work item by pyID? | No | Yes | No | No | No | Yes |


Accenture
IN
Hi Hong San,
Your above analysis is very useful. With respect to this I have the below scenario to be implemented in my project for a multi-country implementation. Please let me know if this is feasible:
Class |
‘This Class’ setting |
Table |
Country (location of the Database) |
Org-Div-Work |
Is a Classgroup |
map to pc_orgdiv_work |
USA |
Org-Div-Work-RealWork |
Hi Hong San,
Your above analysis is very useful. With respect to this I have the below scenario to be implemented in my project for a multi-country implementation. Please let me know if this is feasible:
Class |
‘This Class’ setting |
Table |
Country (location of the Database) |
Org-Div-Work |
Is a Classgroup |
map to pc_orgdiv_work |
USA |
Org-Div-Work-RealWork |
Belongs to a Classgroup(Org-Div-Work) |
map to pc_orgdiv_realwork |
UK |
Org-Div-Work-ActualWork |
Belongs to a Classgroup(Org-Div-Work) |
map to pc_orgdiv_actualwork |
Singapore |
In this example, Org-Div-Work is the global application used across several countries. The application server and database is in USA.
However, Org-Div-Work-RealWork Case Type is used only by the customers of UK, so the case data needs to be stored in the database located in UK.
Similarly, Org-Div-Work-ActualWork Case Type is used only by the customers of Singapore, so the case data needs to be stored in the database located in Singapore.
But since this is a global application, the cases created in USA, UK, Singapore etc.. should have consecutive numbering. (Eg. RW-1 (created in USA), RW-2(created in UK), RW-3(created in SG)). That is why I want to have the Org-Div-Work-RealWork class(UK Class) and Org-Div-Work-ActualWork class(Singapore) belonging to the same Classgroup Org-Div-Work.
lease let me know if this is feasible in Pega.


Pegasystems Inc.
JP
Hi Praveen,
You can NOT specify a table for a work class which "Belongs to a Classgroup".
Only the work class which "is a Classgroup" can have associated database table to save instances of the class.
Cheers!
Chunzhi


Accenture
IN
Hi Hong San,
Thanks a lot for your response. Just wanted one more confirmation in this regard. I have a single application with 3 different Case Types with the below settings:
Class |
‘This Class’ setting |
Table |
Country (location of the Database) |
Org-Div-Work |
Is a Classgroup |
map to pc_orgdiv_work |
USA |
Org-Div-Work-RealWork |
Is a Classgroup |
map to pc_orgdiv_realwork |
UK |
Org-Div-Work-ActualWork |
Is a Classgroup |
map to pc_orgdiv_actualwork |
Singapore |
Hi Hong San,
Thanks a lot for your response. Just wanted one more confirmation in this regard. I have a single application with 3 different Case Types with the below settings:
Class |
‘This Class’ setting |
Table |
Country (location of the Database) |
Org-Div-Work |
Is a Classgroup |
map to pc_orgdiv_work |
USA |
Org-Div-Work-RealWork |
Is a Classgroup |
map to pc_orgdiv_realwork |
UK |
Org-Div-Work-ActualWork |
Is a Classgroup |
map to pc_orgdiv_actualwork |
Singapore |
Though the 3 Case Types are stored in different country databases, they can be assigned to a reviewer who sits in USA (the PRPC server is installed here). Hence the Assign-Worklist table is in USA. If the reviewer is trying to open any of the cases assigned to him, created in UK or Singapore, will there be any technical issues involved in opening the cases? Please confirm.
Thanks & Regards,
Praveen.


Pegasystems Inc.
JP
If three DB servers are physically located in the same data center, I think it should work as long as your PRPC instances are properly configured to support two phase commit.
if three DB servers are physically located in each country, the network latency and the network stability will be a huge challenge.
You have to answer below questions before attempting such an integration.
Is three DB servers are all accessable from USA AP sever ?
If yes, By what means? Public internet or VPN?
Chunzhi


Accenture
IN
Hi Hong San,
Yes I agree that DB servers are physically located in each country, the network latency and the network stability will be a huge challenge, but this is the scenario that we are talking about. All the country specific DB servers are accessible from USA Application server. The means of connection is not yet decided, but VPN is considered heavily. Pleases let me know your recommendation.
Thanks & Regards,
Praveen.
Updated: 11 May 2016 8:25 EDT


Pegasystems Inc.
JP
Perhaps VPN is more reliable than the public internet, however, network latency still can play a critical role on various timeout threshold value, transaction timeout threshold for instance.


Org-Div-Work: This is you Work Pool.
Org-Div-Work-RealWork : This is you work type.
Why do you want to keep your work types in a different table? normally the approach is that the worktypes should go to the work pool. Thats why the Classgroup/WorkPool is for.
I would say If you have different DB in different countries then have one FW and three different Implementations mapped with respective DB!! That is a a cleaner approach you can still inherit everything from your Framework.As long as your schema is properly defined and mapped in you App server it hardly matters where the physical location of the DB or you can also research the feasibility of creating Remote work object.