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

fix(client): File variables now get properly loaded in case of that they are provided as local variables. #103

Closed
wants to merge 1 commit into from

Conversation

klajmajk
Copy link

@klajmajk klajmajk commented Sep 17, 2020

Hi,

When using the client I came across a problem when passing file variables to external task.

If a file variable is passed to a ExternalTask as inputParameter (local variable) loading the variable value fails because the variable is not present in result of query /execution/<PROCESS_INSTANCE_ID>/localVariables/<NAME>/data. (It is however present in /execution/<EXECUTION_ID>/localVariables/<NAME>/data but the global variables are missing here...)

I fixed this by using /variable-instance endpoint where all variables both local and global are present. From this endpoint I first load the variable's ID and than load the data by calling /variable-instance/<VARIABLE_ID>/data. This solution consists of two API requests but I don't think this could be done in a single request because in fetchAndLock there is no data based on which we could differentiate whether the variable is local or global.

Adam

@CLAassistant
Copy link

CLAassistant commented Sep 17, 2020

CLA assistant check
All committers have signed the CLA.

@marstamm marstamm self-assigned this Sep 18, 2020
@marstamm
Copy link
Member

Hi @klajmajk ,

Thank you for you contribution. I created the ticket CAM-12463 to track it's progress.
We will review your contribution shortly and be back with feedback.

Cheers
Martin

@ThorbenLindhauer
Copy link
Member

Hi @klajmajk ,

Thanks for raising this PR. We will review it as soon as we can, however we are currently in the final preprations for the 7.14 release. It may be that we can only get back to you after we have finished the release.

Cheers,
Thorben

@mboskamp
Copy link
Member

Hi @klajmajk,

Thank you very much for opening this PR.
Sorry for the long wait. As Thorben already mentioned the team has been busy with the 7.14.0 release. Now that it is out of the door, I had a chance to look at your contribution.
I was not able to reproduce the behavior you are describing. When I started a simple test process and passed a file variable to an external task via input mapping, I was able to retrieve it via /execution/<PROCESS_INSTANCE_ID>/localVariables/<NAME>/data and /execution/<EXECUTION_ID>/localVariables/<NAME>/data. So currently I don't think there is a problem with using these endpoints in the client.

Also, note that your solution does not work, when there are two variables (global, local) with the same name. Your approach will also find variables that are neither local nor global.

I will close this PR and the ticket we created for it for now. If you still have a strong feeling that there is an issue here, feel free to re-open both. In that case please provide detailed instructions on how to reproduce the erroneous behavior.

If you need help to make the described setup work, I encourage you to ask in our forum.

Have a nice weekend!
Cheers,
Miklas

@mboskamp mboskamp closed this Oct 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants