function getActiveExecution(exId) {
        const str = terminalStatusList().map(state => ` _status:${state} `).join('OR');
        const query = `ex_id: ${exId} NOT (${str.trim()})`;
        return searchExecutionContexts(query, null, 1, '_created:desc')
            .then((ex) => {
                if (ex.length === 0) {
                    const error = new Error(`no active execution context was found for ex_id: ${exId}`);
                    error.code = 404;
                    return Promise.reject(error);
                }
                return ex[0];
            });
    }
function getActiveExecution(exId) {
        const str = terminalStatusList().map(state => ` _status:${state} `).join('OR');
        const query = `ex_id: ${exId} NOT (${str.trim()})`;
        return searchExecutionContexts(query, null, 1, '_created:desc')
            .then((ex) => {
                if (ex.length === 0) {
                    const error = new Error(`no active execution context was found for ex_id: ${exId}`);
                    error.code = 404;
                    return Promise.reject(error);
                }
                return ex[0];
            });
    }
function getActiveExecution ( exId ) { const str = terminalStatusList ( ) . map ( state => ` ${ state } ` ) . join ( 'OR' ) ; const query = ` ${ exId } ${ str . trim ( ) } ` ; return searchExecutionContexts ( query , null , 1 , '_created:desc' ) . then ( ( ex ) => { if ( ex . length === 0 ) { const error = new Error ( ` ${ exId } ` ) ; error . code = 404 ; return Promise . reject ( error ) ; } return ex [ 0 ] ; } ) ; }
encompasses all executions in either initialization or running statuses
encompasses all executions in either initialization or running statuses