Multi instance input collection questions

145 views
Skip to first unread message

Adrian Apthorp

unread,
Mar 4, 2021, 6:29:46 AM3/4/21
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 AM3/4/21
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 AM3/4/21
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 AM3/6/21
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 AM3/7/21
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 AM3/29/21
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.

Jakub Grabowski

unread,
Jul 5, 2021, 6:39:09 AM7/5/21
to Kogito development mailing list
Hi Adrian,

Have you made any progress on this issue? I think I hit the wall with it on 1.8.0.Final. I was using internal ArrayList, but now it fails while trying to use persistence. When I remove internal tag, it doesn't even build.

Regards,
Jakub.

Jakub Grabowski

unread,
Jul 5, 2021, 9:36:23 AM7/5/21
to Kogito development mailing list
I've created a bug in Jira and prepared reproducer for the problem https://issues.redhat.com/browse/KOGITO-5467

Regards,
Jakub.

Adrian Apthorp

unread,
Jul 5, 2021, 10:14:19 AM7/5/21
to kogito-de...@googlegroups.com
Jakub,

I gave up fighting this with 1.6.0.Final. I filed this bug report https://issues.redhat.com/projects/KOGITO/issues/KOGITO-4841

And this request for an example https://issues.redhat.com/projects/KOGITO/issues/KOGITO-5125

Unfortunately, without a workable solution for multi instance sub-processes I’ve parked  Kogito for now.

Regards

Adrian

On 5 Jul 2021, at 9:36 PM, Jakub Grabowski <ja...@perfectsource.pl> wrote:

I've created a bug in Jira and prepared reproducer for the problem https://issues.redhat.com/browse/KOGITO-5467

Adrian Apthorp

unread,
Jul 24, 2021, 11:42:15 PM7/24/21
to Kogito development mailing list
I've just updated to 1.8.0.Final and have exactly the same issue. It seems multi-instance handling needs looking at. Its not supported for embedded sub-processes and persistence doesn't seem to work.

Jakub Grabowski

unread,
Jul 26, 2021, 9:32:52 AM7/26/21
to Kogito development mailing list
Yes, 

It's been confirmed by Cristiano. There's no implementation for collections in protobuf generator.

Regards,
Jakub.

Reply all
Reply to author
Forward
0 new messages