Bug 1322106 - Unable to create and pre-populate multiple-object subform -- no available documentation
Summary: Unable to create and pre-populate multiple-object subform -- no available doc...
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: Documentation
Version: 6.2.0
Hardware: x86_64
OS: Windows
unspecified
urgent
Target Milestone: ---
: ---
Assignee: Dawn Eisner
QA Contact: Lukáš Petrovický
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-29 20:03 UTC by brandon.buteau
Modified: 2020-03-27 19:47 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-27 19:47:58 UTC
Type: Bug


Attachments (Terms of Use)
Project example (29.05 KB, application/zip)
2016-04-01 16:24 UTC, Pere Fernàndez
no flags Details

Description brandon.buteau 2016-03-29 20:03:35 UTC
Description of problem:

I have read all the documentation from the user guide about forms, took the BPM Suite 6 partner class, looked at various online troubleshooting resources, etc., and am still unable to successfully create a subform of multiple objects with pre-populated data. There are no examples of this floating around that I can find. The problem lies in setting up a binding variable for the parent multiple-form field that will contain a list of objects to be displayed in the subform.

Version-Release number of selected component (if applicable):

6.2.0

How reproducible:

Reliably, but it takes a bit of work to set it up.

Steps to Reproduce:
1) Create a data object (class) -- call it Foo, with attributes A1, A2, etc. -- for representing the objects to be displayed in the subform.
2) Create another data object -- call it FooList -- for representing a list of the Foo objects to be displayed in the subform. I have tried various ways of implementing this object, but the simplest seems to be to simply have the class extend ArrayList<Foo>. The different methods don't seem to make a difference to the outcome.
3) Create a process variable -- call it MyFoos of type FooList -- for containing a FooList. (Made sure that all necessary imports are specified in the process for java.util.ArrayList, fully-qualified-Foo, and fully-qualified-FooList.)
4) Create a script task that constructs some Foo instances, a FooList instance, adds the Foos to the FooList, and saves the FooList in MyFoos by calling kcontext.setVariable.
4) Create a subform -- call it FooSubform -- for displaying multiple Foo objects. The subform uses MyFoos as both the input and output IDs and Foo as the data model type (so that all A1, A2, etc. attribute fields from the Foo class are available and populated on the subform). The A1 subform field uses "MyFoos/A1" (without the quotes) as the input and output binding expressions; other attributes fields have analogous bindings. THERE ARE NO INSTRUCTIONS FOR SPECIFYING SUBFORM FIELD INPUT/OUTPUT BINDINGS, so this is a guess as to what is right. (This method at least does not produce errors at build or deploy time.)
5) Create a user task -- call it DisplayFoos -- for invoking a user form, and assign it MyFoos as a data input (haven't even tried data output yet). The user task runs sequentially after the script task that sets a value into MyFoos.
6) Create an associated parent form (DisplayFoos-taskform) with a multiple-subform field (intended to display multiple Foos). The multiple-subform field identifies FooSubform.form as the Default form, the Preview form, and the Table form. THERE ARE NO INSTRUCTIONS FOR SPECIFYING MULTIPLE-SUBFORM FIELD INPUT/OUTPUT bindings. I have only found two methods that are deployable without errors. If I leave the multiple-subform field input/output bindings empty, the parent form displays, but without any data showing in the field (on the label shows). If I assign "MyFoos" to the input/output bindings for the multiple-subform field, I get an exception at the time the user task form is displayed.

Actual results:

An exception and stack trace on the console output beginning with:
Error showing CreateDynamicObject input javax.servlet.jsp.JspException: java.lang.ClassCastException: <fully-qualifed>.FooList cannot be cast to [Ljava.lang.Object;

I also note that the user guide does not contain documentation on how to set input/output bindings correctly for either subforms for multiple objects or parent form multiple-subform fields.

Expected results:

I should see a list of Foo objects displayed in the FooSubform of the parent form. I should also see documentation in section 4.8.10 of the 6.2 user guide that explains how to set input/output bindings correctly for subforms for multiple objects and for parent form multiple-subform fields. And there should be an example that shows pre-populating multiple objects on a subform.

Additional info:

Comment 2 Pere Fernàndez 2016-04-01 16:24:46 UTC
Created attachment 1142639 [details]
Project example

Comment 3 Pere Fernàndez 2016-04-01 16:38:42 UTC
Hi,

that's actually possible to do, check the example project I attached to the BZ to see how it can be done.


Note You need to log in before you can comment on or make changes to this bug.