diff --git a/src/components/ReactDiagramEditor.tsx b/src/components/ReactDiagramEditor.tsx index 9c5fef2..a298cdb 100644 --- a/src/components/ReactDiagramEditor.tsx +++ b/src/components/ReactDiagramEditor.tsx @@ -201,6 +201,29 @@ export default function ReactDiagramEditor({ diagramModeler.on('element.click', (element: any) => { handleElementClick(element); }); + + diagramModeler.on('spiff.service_tasks.requested', (event: any) => { + HttpService.makeCallToBackend({ + path: `/service_tasks`, + successCallback: makeApiHandler(event), + }); + }); + + function makeApiHandler(event: any) { + return function (results: any) { + console.log('results', results); + event.eventBus.fire('spiff.service_tasks.returned', { + serviceTaskOperators: results, + }); + }; + } + + // function handleServiceTask(results: any) { + // console.log('results', results); + // event.eventBus.fire('spiff.service_task.data.returned', { + // wePass: 'hello', + // }); + // } }, [diagramModelerState, diagramType, onLaunchScriptEditor, onElementClick]); useEffect(() => {