This content has been marked as final. Show 6 replies
Hi,1 person found this helpful
It depends a little bit on what specifically you want to do.
If you want the user to enter a number (say 3) on page n, and then want 3 instances to be automatically created by OPA which the user can then manipulate by filling in base attributes... you won't be able to do this out-of-the-box. In 10.4, inferred entities cannot contain base attributes. You could achieve this functionality by implementing a custom inferencing listener (Java or .NET).
There used to be a great example in the developer help (http://docs.oracle.com/html/E36316_01/toc.htm) about creating an inference listener but I can't seem to find it online (it showed how to implement pretty much exactly the functionality you describe). I have a local copy in the 10.3 help so post back if this is the functionality you are after and I can paste it in here.
Instead of the number field, you could have an entity collection screen where the user clicks the Add Instance button 3 times and initially just fills in a name for each person, then they visit a details screen for each instance afterwards (this is a quite common approach). If the user is restricted by the number of instances they can enter, you can use an Error() event rule to stop them entering more than the required number of instances.
I may have mis-understood your requirements but if you want to dynamically create instances from a number field, and then input base attributes into them, you won't be able to do it out-of-the-box.
Thank you for replying.
As you had mentioned, one way of doing this is by collecting primary information as entity instance in one screen, and then collect other details in a new screen - appears as new 'page' for each person.
However, the specification is strict and has to be implemented at any cost. I'm trying to stick to it.
My goal is to allow the user to enter the number of people in one screen. Then I have to collect information about each person in new 'page'. The number of 'pages' should be equal to the number of people (input).
I haven't marked this question as 'answered' yet. I'm expecting a complete solution. Someone (someone I know) mentioned the term 'addinstance' offhand, but I'm unable to find the syntax in the function reference. Can someone help me out with this?
I believe this is the sample Ben is pointing at http://docs.oracle.com/html/E27555_01/toc.htm (OPA 10.3.1 docu) where a number attribute is used to generate the number of entity instances.
That link directs me to "Developer Help". Please mention the exact topic to search for.
Tutorials and Examples > Example: Infer entity instances with an inferencing listener
There are Java and C# implementations.
Thanks Jerome. That's an exact match!
Question marked as 'answered'.