ProcessTemplateSchemeService

Hierarchy

  • ProcessTemplateSchemeService

Methods

get

  • Retrieving the process template by namespace and code.

    Parameters

    • namespace: string
    • code: string

    Returns Promise<ProcessTemplateScheme | undefined>

    An object containing process information. The method does not support processes created in a module. Example of retrieving a system process name 'task':

    const taskProcessTemplate = await  System.scheme.process.get('system', 'task');
    if (!taskProcessTemplate) { 
      throw new Error('Process template task not found'); 
    } 
    const name =  taskProcessTemplate.__name; 
    

    Example of retrieving the context of a process created at the workspace level:

    const  myNamespaceProcess = await System.scheme.process.get ('my_namespace', 'process_code');
    if  (!myNamespaceProcess || !Array.isArray(myNamespaceProcess.context)) { 
      throw new Error('Process context not found'); 
    } 
    for  (const field of myNamespaceProcess.context) { 
     // Working with context data  <a href="_501_scheme_.fieldscheme.html">FieldScheme</a> 
    } 
    

    Example of retrieving a process created at the app level. To retrieve an app-level process, use a composite key. It is formed from the workspace code and app code separated by a dot. For example, my_namespace.my_app.

    const myAppProcess = await  System.scheme.process.get('my_namespace.my_app', 'process_code');
    if  (!myAppProcess) { 
     throw new Error('Process of application not found'); 
    }  
    // Working with process template data <a href="_501_scheme_.processtemplatescheme.html">ProcessTemplateScheme</a> 
    const name  = myAppProcess.__name; 
    

list

  • list(namespace: string): Promise<readonly BaseProcessTemplateScheme[]>
  • list(namespace: string, code: string): Promise<readonly BaseProcessTemplateScheme[]>
  • Retrieving the list of process templates by namespace and app code.

    Parameters

    • namespace: string

    Returns Promise<readonly BaseProcessTemplateScheme[]>

    An array of objects containing information about app process templates.
    Example of retrieving a list of processes created at the app level:

    const myAppProcesses = await System.scheme.process.list ('my_namespace', 'my_app');
    for (const processTemplate of myAppProcesses) {  
     // Working with process data created at the app level  <a href="_501_scheme_.baseprocesstemplatescheme.html">BaseProcessTemplateScheme</a> 
    } 
    
  • Retrieving the list of process templates by namespace and app code.

    Parameters

    • namespace: string
    • code: string

    Returns Promise<readonly BaseProcessTemplateScheme[]>

    An array of objects containing information about app process templates.
    Example of retrieving a list of processes created at the app level:

    const myAppProcesses = await System.scheme.process.list ('my_namespace', 'my_app');
    for (const processTemplate of myAppProcesses) {  
     // Working with process data created at the app level  <a href="_501_scheme_.baseprocesstemplatescheme.html">BaseProcessTemplateScheme</a> 
    }