+export const openRunProcess = (uuid: string) =>
+ (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ const workflows = getState().runProcessPanel.searchWorkflows;
+ const workflow = workflows.find(workflow => workflow.uuid === uuid);
+ if (workflow) {
+ dispatch<any>(navigateToRunProcess);
+ dispatch<any>(goToStep(1));
+ dispatch(runProcessPanelActions.SET_STEP_CHANGED(true));
+ dispatch(runProcessPanelActions.SET_SELECTED_WORKFLOW(workflow));
+ } else {
+ dispatch<any>(snackbarActions.OPEN_SNACKBAR({ message: `You can't run this process` }));
+ }
+ };
+