Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kogito-codegen-processes ProcessContainerJavaTemplate.java #2983

Open
danstancu opened this issue May 13, 2023 · 4 comments
Open

kogito-codegen-processes ProcessContainerJavaTemplate.java #2983

danstancu opened this issue May 13, 2023 · 4 comments

Comments

@danstancu
Copy link

Describe the bug

I am using Kogito BPMN and DMN on a Wildfly application server (CDI environment).
I have 1 main process definition and about 7 subprocesses definitions.
In order to instantiate the main process, I inject the ProjectRuntime and the Application in a singleton bean which is initialized at @startup.
I have a @stateless session bean with a method where I want to start the main process instance. The singleton bean is injected is this session bean.
In the method where I want to start the process instance I use:
`
Application application = startBean.getApplication();

Processes processes = application.get(Processes.class);
Process<? extends Model> process = processes.processById(MAIN_PROCESS_ID);
I got the error: "java.lang.IllegalStateException: Recursive update java.util.concurrent.ConcurrentHashMap.computeIfAbsent". I found a workaround, in that I instantiate all subprocesses:
processes.processIds().stream()
.filter(id -> !id.equals(MAIN_PROCESS_ID))
.forEach(processes::processById);
`
and then getting the main process, after all others are already in the map in the Processes object.
It would be nice to have this issue fixed.

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Kogito version or git rev (or at least Quarkus version if you are using Kogito via Quarkus platform BOM)

1.37.0.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Intellij - mvn 3.8.1

Additional information

No response

@danstancu
Copy link
Author

An example on how to use messages with JMS would be nice.

@danstancu
Copy link
Author

Now I have subprocesses that in turn have child subprocesses, and the fix I used previously is not working anymore, so I had to give numbers to process ids, like "main_process_1", "subprocess_11", "subprocess_112", and so on, then sort the process ids by their number in descending order, and initialise them, which is not so nice.

@radtriste
Copy link
Contributor

radtriste commented May 23, 2023

@pefernan @cristianonicolai @fjtirado any idea there ?

Hi @danstancu a small reproducer would be really helpful

@danstancu
Copy link
Author

Hello @radtriste @pefernan @cristianonicolai @fjtirado , here is a small reproducer. I tested it on a Wildfly 16 server.
https://github.com/danstancu/demo-bpmn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants