Cannot see values in a virtualised collection
I have a 1:M from process entity to a collection. I have an external sql query view where I mapped certain fields to my virtualised collection entity. I mapped a Business Key in the collection called ResultID to the views index field called FKID. I want the records for the case to be displayed in the collection in a table on the form. However no values are displayed. I feel that somehow I need a FK in the view or in the virtualised collection, so that bizagi knows which 1 or many records are related to a specific case. I do have a CPReference on the process entity and in the view (character type) which could act as a relationship but not sure how or where to set this up. Please advise.
The Provider Test did work. The collection values display in Expert View, but are not showing on specific form for specific case during testing.
Good afternoon J Thompson
Bizagi does not automatically load the records of a collection, therefore a business rule must be created to display the collection, on the other hand, it is not recommended to create the 1-to-many relationship from the process entity directly to the virtualized entity. recommends a master entity in Bizagi and on this create the one to many relationship and on this new entity a 1 to 1 relationship is created with the virtualized one.
(See attached image)
I hope this is the solution you need
Greetings
Hello Andres
Ok yes that makes a lot of sense, I'll try this solution and get back to you if it worked or not.
Thank you
Jane
Yes this worked well thank you.
We just now need to add a filter to our On Enter expression so that we only see the collection records where an attribute matches the current case number, instead of all the records in virtualised table?
something like this but we get an error ... I think I have made a mistake with using the full xpath to the EWCaseNo when assigning to the AddParameter?
Good morning J Thompson,
I'm glad I was able to help you, for the filter issue in the table You can use the grid filters:
For more details, I share the following link:
https://help.bizagi.com/bpm-suite/en/index.html?filter_tables.htm
Greetings
I am still struggling ... the attached expression seems to work in Development and the correct records are displayed on form, although there is a validation error that I cannot seem to clear, no matter what I try.
Then when I deployed to Test it doesn't show any records in form, although the portal does not show an error. Can you indicate if the expression below has any silly syntax issues or anything else wrong please?
I think the filter tables is just for the display in form isnt it? I need to filter the records from the collection (virtualised) and only populate those for the current case into the in-between relationship table.
Good afternoon J Thompson,
According to the first image of the model that you sent, there seems to be a context error (this error is what the business rule shows us).
Please check if the xpath of the relation 1 to many "ExternalWayleaveApplicat.EWApplication" if it corresponds to the fact towards the intermediate entity, please send me a screenshot of how your data model was after creating the new intermediate entity, to confirm the above .
Greetings
Ok thank you, see attached data model.
We need to filter the records in the virtualised collection table based on EWCaseNo (which was previously passed to the external view) which represents the case number. So presumably we need to filter the records so only the records for the current case are used to generate the relationships/keys in the in-between table (EWSpatialResults)? else it will run the expression for all records each time I assume? user needs to just see current case records and generate a letter depending on what's returned.
Guidance on the filter syntax would be greatly appreciated.
Good morning,
Here is the latest data model after adding the new relationship and removing the old one.
We want user to see just the records from the virtualised table for the current case.
So we want to filter where EWCaseNo (previously sent Case Number to external view) equals the current case.
Presumably we need the filter as well for building the in-between relationship table, so that the correct FKs are saved in the EWSpatialResults table?
Thanks very much.
Not sure if file loaded?
Trying to upload data model.
I am not sure if you got the data model? or is this topic now closed maybe?
Data Model not uploading but Process Entity = ExternalWayleaveApplicat (1:M) relationship = called EWApplication to EWSpatialResults Entity which has FK called ResultsTable to the related entity, the virtualised EWAnalysisResults.
Good afternoon J Thompson,
The syntax of the rule seems correct, but it is showing us a context error, Please check if the xpath of the relation 1 to many "ExternalWayleaveApplicat.EWApplication" if it corresponds to the fact towards the intermediate entity.
what is the name of the fact? that is, the 1-to-many relationship between the master entity and the intermediate entity?
No data model image was loaded
Greetings
Trying to upload data model
Tried a jpg and a png, shows it uploads but then does not show as attached !?
Process Entity = ExternalWayleaveApplicat has (1:M) relationship (called EWApplication) to EWSpatialResults Entity (inbetween entity) which then has a FK (called ResultsTable) to the related entity, which is the virtualised table EWAnalysisResults.
If I use filter 'EWCaseNo = 303' then I dont get the error, just XPaths highlighted in green when I validate.
If I use the following then I get the validation error, but it does work and filters the table on my form:
var parameters = new FilterParameters();
parameters.AddParameter("@EWCase", Me.Case.CaseNumber);
var EWResults = Me.getXPath("entity-list('EWAnalysisResults','EWCaseNo = @EWCase')",parameters);
for(var i=0; i < EWResults.size(); i++)
{
var xSpatialAnalysisResult = Me.newCollectionItem("ExternalWayleaveApplicat.EWApplication");
xSpatialAnalysisResult.setXPath("ResultsTable",EWResults.get(i).getXPath("Id"));
}
I added the CHelper.usingXPath("EWAnalysisResults", "EWCaseNo") and now it deploys correctly to Test and seems to work. The form displayed is filtered correctly.
I am happy that it works, but worried about the validation error maybe causing issues down the line, like when go to Production!?
Good afternoon J Thompson,
I'm glad the business rule is working properly.
Greetings
Comments have been locked on this page!