@@ -100,14 +100,14 @@ function useDeployment(definitionId: string, initialData?: DeployedProcessInfo)
100100 } ) ;
101101
102102 const startInstance = async ( versionId : string , variables : { [ key : string ] : any } = { } ) => {
103- if ( engines ?. length ) {
104- // TODO: in case of static deployment or different versions on different engines we will have
105- // to check if the engine can actually be used to start an instance
106- return await startInstanceOnMachine ( definitionId , versionId , engines [ 0 ] , variables , {
107- processInitiator : session ?. user . id ,
108- spaceIdOfProcessInitiator : space . spaceId ,
109- } ) ;
110- }
103+ if ( ! engines ?. length ) return userError ( 'No fitting engine found' ) ;
104+
105+ // TODO: in case of static deployment or different versions on different engines we will have
106+ // to check if the engine can actually be used to start an instance
107+ return await startInstanceOnMachine ( definitionId , versionId , engines [ 0 ] , variables , {
108+ processInitiator : session ?. user . id ,
109+ spaceIdOfProcessInitiator : space . spaceId ,
110+ } ) ;
111111 } ;
112112
113113 const activeStates = [ 'PAUSED' , 'RUNNING' , 'READY' , 'DEPLOYMENT-WAITING' , 'WAITING' ] ;
@@ -171,7 +171,8 @@ function useDeployment(definitionId: string, initialData?: DeployedProcessInfo)
171171 }
172172
173173 async function getStartForm ( versionId : string ) {
174- if ( ! engines ) return ;
174+ if ( ! engines ?. length ) return userError ( 'No fitting engine found' ) ;
175+
175176 try {
176177 // TODO: in case of static deployment or different versions on different engines we will have
177178 // to check if the engine can actually be used to start an instance
0 commit comments