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

Support attaching forms to message start events like we do with user tasks #77

Open
burnettk opened this issue Mar 14, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@burnettk
Copy link
Contributor

burnettk commented Mar 14, 2024

right now the bpmn xml for user tasks can look like this with our extensions:

    <bpmn:userTask id="user_task_one" name="User Task One">
      <bpmn:extensionElements>
        <spiffworkflow:properties>
          <spiffworkflow:property name="formJsonSchemaFilename" value="second-form-schema.json" />
          <spiffworkflow:property name="formUiSchemaFilename" value="second-form-uischema.json" />
        </spiffworkflow:properties>
        <spiffworkflow:allowGuest>false</spiffworkflow:allowGuest>
        <spiffworkflow:instructionsForEndUser />
        <spiffworkflow:guestConfirmation># Thanks

We hear you. Your name is **{{incoming_request['firstName']}}**.</spiffworkflow:guestConfirmation>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_12pkbxb</bpmn:incoming>
      <bpmn:outgoing>Flow_14h4dnh</bpmn:outgoing>
    </bpmn:userTask>

we would like to be able to use most of the same ability to attach json schemas to message start events. we'd like to be able to specify a formJsonSchemaFilename and formUiSchemaFilename, as well as specify instructionsForEndUser and guestConfirmation. i think we do not need allowGuest, eh, @jasquat ? these extensions are respected in backend, but we'd like to be able to craft the appropriate xml through our bpmn js properties panel extensions.

so something like this, but maybe without the [object Object], which may be an existing bug:

    <bpmn:startEvent id="message_start_event_one" name="Message Start Event One" messageRef="[object Object]">
      <bpmn:extensionElements>
        <spiffworkflow:properties>
          <spiffworkflow:property name="formJsonSchemaFilename" value="entry-form-schema.json" />
          <spiffworkflow:property name="formUiSchemaFilename" value="entry-form-uischema.json" />
        </spiffworkflow:properties>
        <spiffworkflow:instructionsForEndUser>Hi</spiffworkflow:instructionsForEndUser>
        <spiffworkflow:guestConfirmation>Thanks</spiffworkflow:guestConfirmation>
      </bpmn:extensionElements>
      <bpmn:outgoing>Flow_17db3yp</bpmn:outgoing>
      <bpmn:messageEventDefinition id="MessageEventDefinition_13ctnqx" messageRef="Message_1rfi4qj" />
    </bpmn:startEvent>

maybe we should get rid of <spiffworkflow:properties> ? it seems weird to have just those two form properties in there. perhaps we support <spiffworkflow:formJsonSchemaFilename> and <spiffworkflow:formUiSchemaFilename> and deprecate <spiffworkflow:properties>.

@calexh-sar calexh-sar added this to the Bounties MVP milestone Apr 4, 2024
@calexh-sar calexh-sar changed the title support attaching forms to message start events like we do with user tasks Support attaching forms to message start events like we do with user tasks Apr 4, 2024
@theaubmov
Copy link
Collaborator

theaubmov commented Apr 8, 2024

Form is going to be generated from the message's JSON schema. This will necessitate enhancements to the JSON schema to support UI attributes.

The XML that defines a start event with a message element that includes forms can be structured as follows:

<bpmn:startEvent id="message_start_event_one" name="Message Start Event One" messageRef="basic_message">
  <bpmn:extensionElements>
    <spiffworkflow:instructionsForEndUser>Hi</spiffworkflow:instructionsForEndUser>
    <spiffworkflow:guestConfirmation>Thanks</spiffworkflow:guestConfirmation>
  </bpmn:extensionElements>
  <bpmn:messageEventDefinition id="MessageEventDefinition_13ctnqx" messageRef="basic_message" />
  <bpmn:outgoing>Flow_17db3yp</bpmn:outgoing>
</bpmn:startEvent>

<bpmn:message id="basic_message" name="basic_message" schemaLocation="grp1/p1" />

UI :

image image

@harmeet-status
Copy link
Collaborator

@calexh-sar do we need this for bounties?

@calexh-sar
Copy link

@harmeet-status yes, this is the best way to do the initial Message Start Event.

@danfunk
Copy link
Contributor

danfunk commented Apr 23, 2024

Seems like 3 things need to happen:

  1. BPMN IO - Need to add form builder link to messages (1 day)
  2. Form Builder - switch to save to one file, rather than 3. backwards compatible with 3 (see also #1442) (2 days)
  3. XML Property - merge three properties into one, with a new property name. (.5) (jsonschema-single-file branch in arena)
  4. Messages can reference a file (absolute path) (.5 day)

@harmeet-status
Copy link
Collaborator

Seems like 3 things need to happen:

  1. BPMN IO - Need to add form builder link to messages (1 day)
  2. Form Builder - switch to save to one file, rather than 3. backwards compatible with 3 (2 days)
  3. XML Property - merge three properties into one, with a new property name. (.5)
  4. Messages can reference a file (absolute path) (.5 day)

Are these existing tickets?

@calexh-sar
Copy link

@harmeet-status all work will be done under this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

6 participants