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

The kogitobusinesskey process attribute is not propagated to subprocess #3286

Open
andleosab opened this issue Nov 16, 2023 · 12 comments
Open

Comments

@andleosab
Copy link

Describe the bug

The kogitobusinesskey process attribute does not get propagated to subprocess from the parent process

Expected behavior

the parent process's business key should be set in its subprocess(es)

Actual behavior

the business key is null:

{
"data": {
"ProcessInstances": [
{
"id": "236945bc-6363-4eb5-86c4-9e6c2e7246dd",
"businessKey": null,
"parentProcessInstanceId": "c8b3e3e3-7f6d-47ce-847d-a3fcee26793d",
"processId": "subProcess",
"processName": "subProcess",
"state": "COMPLETED",

How to Reproduce?

to reproduce:

  1. have a process with subprocess
  2. start the process with businesskey included
  3. query the subprocess to check the result

{ ProcessInstances
(where: {parentProcessInstanceId: {equal: "c8b3e3e3-7f6d-47ce-847d-a3fcee26793d"}} )
{
id,
businessKey,
parentProcessInstanceId,
processId,
processName,
state
}
}

Output of uname -a or ver

kogito runtime 1.27.0.Final

Output of java -version

11

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)

No response

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

No response

Additional information

No response

@dekaido
Copy link

dekaido commented Mar 21, 2024

Any action on this issue?

@ricardozanini
Copy link
Member

There are a few issues we are working on related to this topic. This issue missed my sight, sorry. @fjtirado can you include this in the businessKey issue you're currently working on?

@fjtirado
Copy link
Contributor

fjtirado commented Apr 1, 2024

@elguardian Wdyt? Should the business key of the parent propagated to the subprocess?

@fjtirado
Copy link
Contributor

fjtirado commented Apr 1, 2024

@dekaido From my point of view, businessKey is intended to optionally provide a human readable identifier to a given workflow. Therefore, it can be argued that businesskey attribute does not really belong to the subprocess and the steps to associate a subprocess to a process given a businnes key are the ones that you are following, first get the process id given the business key, then use the parent process id to get the subprocesses.
So, the question here is, besides providing an easier mapping between all the subprocesses opened by the process associated with that business key, what do you need the business key in the subprocess for?
@krisv I think this might also interest you.

@dekaido
Copy link

dekaido commented Apr 1, 2024

@fjtirado I am with you, I was expecting to use the businessKey as a human readable identifier. Maybe the wording is wrong here, or I have another issue. But I can't find anything in the documentation so I expect functionality to work as it's stated in this article.

If you wanted to start an order process correlated to the business key ORDER-0001, for instance, you would issue a request like this one:

POST /orders?businessKey=ORDER-0001
You would then be able to retrieve the new process instance with the new reference ID:

GET /orders/ORD-0001
You could also delete the process instance by sending an HTTP delete request with the same reference ID:

DELETE /orders/ORD-0001

When I am creating instances with the businessKey set, POST returns success and a new process instance is deployed. But the service does not recognize the businessKey (i.e. ORD-0001) as an identifier for any GET/DELETE/etc request. This is where I am assuming the attribute/field is not being saved to the subprocess/instance.

Edit: the documentation only mentions businessKey in the managment console and dev ui.

@fjtirado
Copy link
Contributor

fjtirado commented Apr 1, 2024

@dekaido
But thats a completely different issue ;)
I mean, GET and DELETE using business key is not supported by runtimes API (that expects the process instance id). You can use business key in your data index queries and as header of cloud event to resume a paused workflow.
I do not think business key being null for a subprocess is necesarily wrong.

@dekaido
Copy link

dekaido commented Apr 1, 2024

@fjtirado okay... so the "HTTP request" with the "same reference ID" was a lie? 😞

You could also delete the process instance by sending an HTTP delete request with the same reference ID:

@fjtirado
Copy link
Contributor

fjtirado commented Apr 1, 2024

@dekaido Not necesarily a lie, this is not supported by runtime API, but might be supported in the gateway API (which migh translate businesskey into process instance id) , which one are you calling?

@fjtirado
Copy link
Contributor

fjtirado commented Apr 1, 2024

In any case, I think GET and DELETE using business key on runtimes should be addressed with a different issue. Lets keep this one focus on businesskey on subprocess.

@elguardian
Copy link
Contributor

business key should be unique among process instances. so propagate the same business keys is a no go from my point of view. In the past we have a way to generate unique keys. I am not sure whay is the use case for sonata flow for business keys but in the case of bpmn2 requires to be unique.
@fjtirado ^^

@elguardian
Copy link
Contributor

And option that was in the past was a BusinesskeyFactory to be used and plug anytime a subprocess instances was created (CorrelationKeyFactory) in the past.

@fjtirado
Copy link
Contributor

fjtirado commented Apr 3, 2024

@elguardian I think the scenario is the same both for bpmn and swf, embedded subprocess should have either a unique business key or not business key at all. To be honest, I do not see a use case for embedded subprocess business key, maybe the author of the issue, @andleosab can provide one.
CorrelationKeyFactory is still there in the kie api (what was basically imported as it was when the initial fork was done), but also as part of this fork it seems the implementation was removed (I guess following the rational that there is not use case for embedded subprocess business key)

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

5 participants