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

Select process variables from defined components #1115

Merged
merged 24 commits into from
Dec 30, 2021

Conversation

sergei-maertens
Copy link
Member

@sergei-maertens sergei-maertens commented Dec 23, 2021

Relates to #326

First phase - simple process variable mapping.

Changes

  • Manage process variables from the registration options
  • Every form component can be added as a proces variable
  • The Camunda variable name can be overridden, by default the Formio component.key is used
  • Handle formio schema changes after the variable mapping is configured (deleted components are deleted from mapping, changed components are updated in the mapping)
  • Mapped variables are now included on process instance create. Formio types are converted to python types, which are in turn serialized to Camunda types through django-camunda.

@sergei-maertens sergei-maertens marked this pull request as draft December 23, 2021 15:21
@codecov-commenter
Copy link

codecov-commenter commented Dec 23, 2021

Codecov Report

Merging #1115 (8ab6f4f) into master (adcb343) will increase coverage by 0.04%.
The diff coverage is 95.52%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1115      +/-   ##
==========================================
+ Coverage   89.03%   89.07%   +0.04%     
==========================================
  Files         422      424       +2     
  Lines       11761    11815      +54     
  Branches     1084     1098      +14     
==========================================
+ Hits        10471    10524      +53     
  Misses       1066     1066              
- Partials      224      225       +1     
Impacted Files Coverage Δ
.../openforms/registrations/contrib/camunda/plugin.py 90.00% <88.88%> (+1.29%) ⬆️
...orms/registrations/contrib/camunda/type_mapping.py 96.15% <96.15%> (ø)
src/openforms/api/exception_handling.py 96.66% <100.00%> (+0.11%) ⬆️
src/openforms/forms/api/serializers.py 95.08% <100.00%> (+0.02%) ⬆️
...rc/openforms/registrations/contrib/camunda/apps.py 100.00% <100.00%> (ø)
...forms/registrations/contrib/camunda/serializers.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update adcb343...8ab6f4f. Read the comment docs.

@sergei-maertens sergei-maertens force-pushed the feature/326-select-process-variables branch 4 times, most recently from ec6ded8 to 160ccc3 Compare December 24, 2021 10:30
Copy link
Contributor

@SilviaAmAm SilviaAmAm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just some small comments/questions

@sergei-maertens sergei-maertens force-pushed the feature/326-select-process-variables branch 3 times, most recently from 8da0088 to 4a39955 Compare December 24, 2021 16:35
@sergei-maertens sergei-maertens marked this pull request as ready for review December 24, 2021 16:40
@sergei-maertens
Copy link
Member Author

@joeribekker backend is ready for review

@sergei-maertens sergei-maertens force-pushed the feature/326-select-process-variables branch from 4a39955 to 67df43a Compare December 27, 2021 09:15

class CamundaApp(AppConfig):
name = "openforms.registrations.contrib.camunda"
label = "registrations_camunda"
verbose_name = _("Camunda registration plugin")

def ready(self):
patch_django_camunda()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not update django_camunda? This doesn't seem OF specific?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as discussed during standup - mapping a Python Decimal with fixed precision to a Java Double (with floating point precision errors) is probably not guaranteed to be correct, but a best effort we can do.

At some point we'll probably include it in django-camunda with a disclaimer or a setting to enable/override it.

@sergei-maertens sergei-maertens merged commit 7b239d7 into master Dec 30, 2021
@sergei-maertens sergei-maertens deleted the feature/326-select-process-variables branch December 30, 2021 10:38
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.

4 participants