Multi instance input collection questions

29 views
Skip to first unread message

Adrian Apthorp

unread,
Mar 4, 2021, 6:29:46 AMMar 4
to Kogito development mailing list
Hi,

I've come across a couple of questions / issues with multi instance input collections:

1) It's necessary to extend the native java collection class (in my case java.util.Arraylist) otherwise I get the complier throws an error as per this thread. Is this a known / expected constraint even though the practice of extending Arraylist seems to be a controversial topic.

2) Unless I mark the collection process variable internal swagger returns error "Could not render r, see the console" when displaying that API endpoint. I'm not sure if this is a Swagger, Quarkus or Kogito issue.

I these known issues or limitations? I couldn't see them in Jira, but happy raise a Jira to at least have them covered in the documentation.

Jakub Grabowski

unread,
Mar 4, 2021, 10:02:36 AMMar 4
to Kogito development mailing list
Hi,

Ad. 1) I'm currently running on 1.12.0.Final and regarding ArrayList - it seems to be no longer an issue. I've changed all input collections for multiple instance to ArrayList and it works just fine.
Ad. 2) I'm also observing such issue but haven't correletad it with using ArrayLists - it might be true as it was happening while I was using collections. I'll check and report back whether it's connected with collections in my case.

Regards,
Jakub.

Jakub Grabowski

unread,
Mar 4, 2021, 10:06:36 AMMar 4
to Kogito development mailing list
Ad.2) Yes, the swagger-ui rendering issue seems to be connected with using arraylist not marked as "internal" variable.

Cheers,
Jakub.

Adrian Apthorp

unread,
Mar 6, 2021, 8:09:43 AMMar 6
to kogito-de...@googlegroups.com
Ok logged the swagger UI issue in JIRA.

Also, upgraded to 1.12 and it compiles now with ArrayList.

On 4 Mar 2021, at 11:06 PM, Jakub Grabowski <ja...@perfectsource.pl> wrote:

Ad.2) Yes, the swagger-ui rendering issue seems to be connected with using arraylist not marked as "internal" variable.
--
You received this message because you are subscribed to the Google Groups "Kogito development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kogito-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kogito-development/4e3164aa-69b0-4ff4-85fd-f22a45241c31n%40googlegroups.com.

Adrian Apthorp

unread,
Mar 7, 2021, 3:17:03 AMMar 7
to Kogito development mailing list
The reason why it compiled is because it was marked as 'internal' i.e. it wasn't included in the protobuf. Removing 'internal' gives the compile error even Quarkus 1.12. So back to using my extended class. And this time mark as 'output' to ensure the swagger UI error doesn't appear. This compiles and is in the protobuf.

Adrian Apthorp

unread,
Mar 29, 2021, 5:42:01 AMMar 29
to Kogito development mailing list
After some more digging there still seems to be an issue with multi input collections when the process management add-on is enabled. If the add-on is enabled I can only get it to work if I extend ArrayList and configure as Output. It seems to work but depending on the structure of my ArrayList I get one of a couple of runtime errors. The following if I just populate the ArrayList with simple objects:

infinispan_1          | 09:12:01,761 ERROR (blocking-thread--p3-t3) [org.jboss.threads.errors] Thread Thread[blocking-thread--p3-t3,5,ISPN-blocking-thread-group] threw an uncaught exception java.lang.IllegalStateException: Field 'my_collection' is not an array
infinispan_1          |     at org.infinispan.protostream.ProtobufUtil.processArray(ProtobufUtil.java:595)
infinispan_1          |     at org.infinispan.protostream.ProtobufUtil.processObject(ProtobufUtil.java:417)
infinispan_1          |     at org.infinispan.protostream.ProtobufUtil.processJsonDocument(ProtobufUtil.java:357)
infinispan_1          |     at org.infinispan.protostream.ProtobufUtil.fromCanonicalJSON(ProtobufUtil.java:239)
infinispan_1          |     at org.infinispan.encoding.ProtostreamTranscoder.transcode(ProtostreamTranscoder.java:88)
infinispan_1          |     at org.infinispan.encoding.DataConversion.toStorage(DataConversion.java:223)
infinispan_1          |     at org.infinispan.cache.impl.EncoderCache.valueToStorage(EncoderCache.java:107)
infinispan_1          |     at org.infinispan.cache.impl.EncoderCache.putAsync(EncoderCache.java:456)
infinispan_1          |     at org.infinispan.server.hotrod.CacheRequestProcessor.putInternal(CacheRequestProcessor.java:178)
infinispan_1          |     at org.infinispan.server.hotrod.CacheRequestProcessor.lambda$put$4(CacheRequestProcessor.java:171)
infinispan_1          |     at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
infinispan_1          |     at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
infinispan_1          |     at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
infinispan_1          |     at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1348)
infinispan_1          |     at java.base/java.lang.Thread.run(Thread.java:834)
infinispan_1          |

Or if I use a domain object then the error indicates that it can't find a definition for the first field in the object.

If I set to Internal then I get an NPE.
Reply all
Reply to author
Forward
0 new messages