EscherLabs / Graphene

Graphene is a fully featured Workflow, Micro Application, and Content Management Platform with a robust web-based IDE (Integrated Development Environment). Graphene is the primary engine behind Binghamton University's myBinghamton portal.
https://docs.escherlabs.com/Graphene/
MIT License
29 stars 10 forks source link

GrapheneWorkflow: List Type Field Causes Bugs When Required but Does not Exist in Workflow Object #115

Closed alikemaltanriverdi closed 2 years ago

alikemaltanriverdi commented 3 years ago

Description When a list type is a required field in the given state and does not exist in the data object, it is preventing form/ workflow to load in the next state by throwing a console error. This happens when a submission is made by public api that doesn't have that field in its attributes. Please note that: No other field has this issue. For example: If you do not include your "text" type field attribute in your workflow data, then Graphene can handle it and render the form and submission report correctly.

Feature / Subsystem Graphene Workflow

To Reproduce Steps to reproduce the behavior.

  1. Go to a workflow form
  2. Select a "List" type field and make it required
  3. Create your submission using the public api and include your fields with the pre-populated data
  4. Go to the submission report using submission id returned from your api request
  5. See error
  6. Workarounds:
    • Either include that field in your object attributes as an empty array
    • Make the field a non-required field for that state ( Adjust your required conditions) E.g. If you' are initializing the workflow from origin state, then add the following condition to your field:
      • Required Condition: _flowstate - not_matches - origin

Console Errors

Screen Shot 2021-03-31 at 11 02 30 AM Screen Shot 2021-03-31 at 11 03 03 AM

Link(s) Example Submission: http://portalawsdev.binghamton.edu/workflows/report/47823

Additional context Please contact me ( @alikemaltanriverdi ) if you need additional examples, cases or documentation

alikemaltanriverdi commented 2 years ago

@Cloverstone confirmed, fixed.