diff --git a/spiffworkflow-frontend/src/components/ProcessModelForm.tsx b/spiffworkflow-frontend/src/components/ProcessModelForm.tsx
index 7cfd4d616..84a01987a 100644
--- a/spiffworkflow-frontend/src/components/ProcessModelForm.tsx
+++ b/spiffworkflow-frontend/src/components/ProcessModelForm.tsx
@@ -8,6 +8,8 @@ import {
TextInput,
Grid,
Column,
+ Select,
+ SelectItem,
// @ts-ignore
} from '@carbon/react';
// @ts-ignore
@@ -76,6 +78,8 @@ export default function ProcessModelForm({
display_name: processModel.display_name,
description: processModel.description,
metadata_extraction_paths: processModel.metadata_extraction_paths,
+ fault_or_suspend_on_exception: processModel.fault_or_suspend_on_exception,
+ exception_notification_addresses: processModel.exception_notification_addresses,
};
if (mode === 'new') {
Object.assign(postBody, {
@@ -173,6 +177,69 @@ export default function ProcessModelForm({
updateProcessModel({ metadata_extraction_paths: cep });
};
+ const notificationAddressForm = (
+ index: number,
+ notificationAddress: string
+ ) => {
+ return (
+
+
+ {
+ const notificationAddresses: string[] =
+ processModel.exception_notification_addresses || [];
+ notificationAddresses[index] = event.target.value;
+ updateProcessModel({
+ exception_notification_addresses: notificationAddresses,
+ });
+ }}
+ />
+
+
+
+
+ );
+ };
+
+ const notificationAddressFormArea = () => {
+ if (processModel.exception_notification_addresses) {
+ return processModel.exception_notification_addresses.map(
+ (notificationAddress: string, index: number) => {
+ return notificationAddressForm(index, notificationAddress);
+ }
+ );
+ }
+ return null;
+ };
+
+ const addBlankNotificationAddress = () => {
+ const notificationAddresses: string[] =
+ processModel.exception_notification_addresses || [];
+ notificationAddresses.push('');
+ updateProcessModel({
+ exception_notification_addresses: notificationAddresses,
+ });
+ };
+
const onDisplayNameChanged = (newDisplayName: any) => {
setDisplayNameInvalid(false);
const updateDict = { display_name: newDisplayName };
@@ -182,6 +249,11 @@ export default function ProcessModelForm({
updateProcessModel(updateDict);
};
+ const onNotificationTypeChanged = (newNotificationType: string) => {
+ const updateDict = { fault_or_suspend_on_exception: newNotificationType };
+ updateProcessModel(updateDict);
+ };
+
const formElements = () => {
const textInputs = [
);
+ textInputs.push(
+
+ );
+ textInputs.push(
Notification Addresses
);
+ textInputs.push(
+
+
+
+ You can provide one or more addresses to notify if this model fails.
+
+
+
+ );
+ textInputs.push(<>{notificationAddressFormArea()}>);
+ textInputs.push(
+
+
+
+
+
+ );
+
textInputs.push(Metadata Extractions
);
textInputs.push(
diff --git a/spiffworkflow-frontend/src/interfaces.ts b/spiffworkflow-frontend/src/interfaces.ts
index 97ef763c1..9d3d17ccd 100644
--- a/spiffworkflow-frontend/src/interfaces.ts
+++ b/spiffworkflow-frontend/src/interfaces.ts
@@ -146,6 +146,8 @@ export interface ProcessModel {
files: ProcessFile[];
parent_groups?: ProcessGroupLite[];
metadata_extraction_paths?: MetadataExtractionPath[];
+ fault_or_suspend_on_exception?: string;
+ exception_notification_addresses?: string[];
}
export interface ProcessGroup {