Code Monkey home page Code Monkey logo

Comments (11)

marstamm avatar marstamm commented on August 13, 2024 2

We created the following example to showcase what we would need from the form integration:
diagram
This Task uses 2 different error events, distinguished by the error code. The second one uses the optional error message. In the form, it could look like this if we embedd the buttons into the form
form-embedded-buttons
Here, the error would be handled by Tasklist the same as a submit, e.g. with an form.on('errorTrigger') event. The event needs the error code and message.

If we want to use external submit buttons
form-external-buttons
The schema needs to contain information whether errors are possible, as well as the error codes and labels. We could reuse the programatic submit event if we know which element could contain the error message.

from form-js.

marstamm avatar marstamm commented on August 13, 2024 1

I will try my best :)

Real life scenario
In a human task workflow to review invoices. In case the Invoice is missing details, such as the correct Tax-ID, I want to trigger an error boundary event by clicking on a "Invoice incomplete" button in the form.
image

The button would be styled like the default button with custom label.

Data to be passed

  • error or escalation ID: this does not depend on user input and is needed to identify which error event is triggered.
  • (optional) error message: In case the user wants to add details for the error. This would depend on user input.
  • Variables: The Form can still be completed and variable changes submitted. I am open to discuss if this would be the expected behavior or if the edit should be "aborted"

from form-js.

marstamm avatar marstamm commented on August 13, 2024 1

Sorry for not getting back to you, I wanted to run our options by product management first :)

In our case, external buttons would not be feasible, as Tasklist uses forms provided by the user. Not all Tasks will have error boundaries, so we need information whether the Form contains "error fields". We could define naming convention for error fields, but that would be inconvenient for the user.

@ThorbenLindhauer and me would like to discuss the possibilities in the next cross-team sync

from form-js.

nikku avatar nikku commented on August 13, 2024

To better understand the overall scenario, could you back up your issue with a simple, real world scenario?

How would that throw button look like?

What data would be passed? Would it depend on user input?

from form-js.

nikku avatar nikku commented on August 13, 2024

Thanks, I do understand better now.

From the core form renderer point of view that is likely two different kinds of submit buttons, that trigger submit of different data.

From the Form SDK perspective, that is handling the different submits and triggering the respective follow up actions.

We'll keep this one on the back of our heads. Thanks for reporting.

from form-js.

nikku avatar nikku commented on August 13, 2024

Given the nature of this library (a pure form renderer / editor) we're inclined to not add such feature.

Do you see a way to handle the custom events use-case outside the form? Especially when you have external submit buttons, adding an extra button that extracts some form element value and does not complete but trigger an error seems to be straight forward to me.

from form-js.

nikku avatar nikku commented on August 13, 2024

@marstamm any feedback on https://github.com/bpmn-io/camunda-forms/issues/3#issuecomment-780635394?

from form-js.

nikku avatar nikku commented on August 13, 2024

Next step: Get a end-to-end example to work with further regarding this topic.

from form-js.

jonathanlukas avatar jonathanlukas commented on August 13, 2024

Additionally to this, I would like to have the possibility to create any kind of event (free text) and react to it.

Example scenario is a Form, where a field is used to enter a search term. A button (that does not submit the complete form) will then throw a custom event (for example 'search') that my js this form is embedded to can be subscribed to with a custom function.

from form-js.

nikku avatar nikku commented on August 13, 2024

Additionally to this, I would like to have the possibility to create any kind of event (free text) and react to it.

Could you share a mock-up of a form that requires this? Without having the full context I'd assume this is better handled via a custom form control.

from form-js.

jonathanlukas avatar jonathanlukas commented on August 13, 2024

After our very insightful talk, I created this issue: 230. Please regard my comment on this as obsolete.

from form-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.