bpmn-js-spiffworkflow
bpmn-js-spiffworkflow copied to clipboard
Support attaching forms to message start events like we do with user tasks
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>
.
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 :
@calexh-sar do we need this for bounties?
@harmeet-status yes, this is the best way to do the initial Message Start Event.
Seems like 3 things need to happen:
- BPMN IO - Need to add form builder link to messages (1 day)
- Form Builder - switch to save to one file, rather than 3. backwards compatible with 3 (see also #1442) (2 days)
- XML Property - merge three properties into one, with a new property name. (.5) (jsonschema-single-file branch in arena)
- Messages can reference a file (absolute path) (.5 day)
Seems like 3 things need to happen:
- BPMN IO - Need to add form builder link to messages (1 day)
- Form Builder - switch to save to one file, rather than 3. backwards compatible with 3 (2 days)
- XML Property - merge three properties into one, with a new property name. (.5)
- Messages can reference a file (absolute path) (.5 day)
Are these existing tickets?
@harmeet-status all work will be done under this ticket.