initial work to get service tasks from backend w/ burnettk

This commit is contained in:
jasquat 2022-08-30 17:32:13 -04:00
parent 3bcc867957
commit 4f27f5d103
1 changed files with 23 additions and 0 deletions

View File

@ -201,6 +201,29 @@ export default function ReactDiagramEditor({
diagramModeler.on('element.click', (element: any) => { diagramModeler.on('element.click', (element: any) => {
handleElementClick(element); 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]); }, [diagramModelerState, diagramType, onLaunchScriptEditor, onElementClick]);
useEffect(() => { useEffect(() => {