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

List variable serialized #88

Open
kyahia opened this issue Jun 25, 2023 · 1 comment
Open

List variable serialized #88

kyahia opened this issue Jun 25, 2023 · 1 comment

Comments

@kyahia
Copy link

kyahia commented Jun 25, 2023

I have variables of type 'list in my BPMN. When I use get_variable() method I'm getting a serialized Java object. How can I convert it to a python list ?

exemple :

  • On bpmn : my_var = [ "hello", "world" ]
  • In python external task workder:
    print(task.get_variable('my_var')) => rO0ABXNyABNqYXZhLnV0aWwuQXJyYXlMaXN0eIHSHZnHYZ0DAAFJAARzaXpleHAAAAACdwQAAAACdAAHIndvcmxkInQAByJoZWxsbyJ4

print(base64.b64decode(task.get_variable('my_var'))) => b'\xac\xed\x00\x05sr\x00\x13java.util.ArrayListx\x81\xd2\x1d\x99\xc7a\x9d\x03\x00\x01I\x00\x04sizexp\x00\x00\x00\x02w\x04\x00\x00\x00\x02t\x00\x07"world"t\x00\x07"hello"x'

@pelt
Copy link

pelt commented Sep 15, 2023

Hi, I had a similar issue with a JSON variable that contains a list of object. I needed to disable the deserializeValues so that Camuda passed the value as a JSON string.

client = ExternalTaskClient(
    worker_id,
    engine_base_url,
    config={
        "deserializeValues": False,
        ...
    },
)

It might be unrelated to your issue, but you can give it a try.

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

No branches or pull requests

2 participants