# Module: advanced

Contains all of the advanced system commands.

Author:
  - Seth Hollingsead
Copyright:
  - Copyright © 2022-… by Seth Hollingsead. All rights reserved
Source:
  - commandsBlob/commands/advanced.js, line 1

### Requires

- module:commandBroker
- module:ruleBroker
- module:workflowBroker
- module:configurator
- module:loggers
- module:data
- module:queue
- module:stack
- @haystacks/constants
- path

### Methods

#### (inner) businessRule(inputData, inputMetaData) → {array.<boolean, (string|integer|boolean|object|array)>}

Executes a user specified business rule with some input.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | array.<(boolean|string|integer)> | An array that could actually contain anything, depending on what the user entered. But the function filters all of that internally and extracts the case the user has entered a business rule name and perhaps some rule inputs. inputData[0] === 'businessRule' inputData[1] === rule 1 (including arguments with secondary delimiter) inputData[2] === rule 2 (including arguments with secondary delimiter) inputData[n] === rule n (including arguments with secondary delimiter)
`inputMetaData` | string | Not used for this command.

Author:
  - Seth Hollingsead
Source:
  - commandsBlob/commands/advanced.js, line 155

##### Returns:

An array with a boolean True or False value to indicate if the application should exit or not exit, followed by the command output.

Type
  array.<boolean, (string|integer|boolean|object|array)>

#### (inner) commandAliasGenerator(inputData, inputMetaData) → {array.<boolean, (string|integer|boolean|object|array)>}

Requests a set of inputs from the user for a command name, and a series of command words and a list of command word acronyms. The command then calls a series of business rules to in-turn generate all possible combinations of command words and command word acronyms.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | array.<(object|boolean|string|integer)> | An array that could actually contain anything, depending on what the user entered. But the function filters all of that internally and parses the data string object into a JSON object with values that are the command words and command word abbreviations. inputData[0] === 'commandAliasGenerator' inputData[1] === A JSON object containing the data necessary for defining all command words and command aliases.
`inputMetaData` | string | Not used for this command.

Author:
  - Seth Hollingsead
Source:
  - commandsBlob/commands/advanced.js, line 394

##### Returns:

An array with a boolean True or False value to indicate if the application should exit or not exit, followed by the command output.

Type
  array.<boolean, (string|integer|boolean|object|array)>

#### (inner) commandGenerator(inputData, inputMetaData) → {array.<boolean, (string|integer|boolean|object|array)>}

Takes a set of input parameters such as a command and the number of times it should be executed. Then this command will enqueue that command that number of times to the command queue.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | array.<(boolean|string|integer)> | An array that could actually contain anything, depending on what the user entered. But the function filters all of that internally and extracts the command that should be executed and the number of times it should be executed. inputData[0] === 'commandGenerator' inputData[1] === command string inputData[2] === number of times to enqueue the above command string
`inputMetaData` | string | Not sued for this command.

Author:
  - Seth Hollingsead
Source:
  - commandsBlob/commands/advanced.js, line 277

##### Returns:

An array with a boolean True or False value to indicate if the application should exit or not exit, followed by the command output.

Type
  array.<boolean, (string|integer|boolean|object|array)>

#### (inner) commandSequencer(inputData, inputMetaData) → {array.<boolean, (string|integer|boolean|object|array)>}

Takes an arguments array where the second array object would contain a list of commands that should be enqueued to the command queue.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | array.<(boolean|string|integer)> | An array that could actually contain anything, depending on what the user entered. But the function filters all of that internally and extracts the case the user has entered a list of commands that should be enqueued to the command queue. inputData[0] === 'commandSequencer' inputData[1] === command string 1 inputData[2] === command string 2 inputData[n] === command string n
`inputMetaData` | string | Not used for this command.

Author:
  - Seth Hollingsead
Source:
  - commandsBlob/commands/advanced.js, line 39

##### Returns:

An array with a boolean True or False value to indicate if the application should exit or not exit, followed by the command output.

Type
  array.<boolean, (string|integer|boolean|object|array)>

#### (inner) workflow(inputData, inputMetaData) → {array.<boolean, (string|integer|boolean|object|array)>}

Takes an arguments array where the second array object would contain a workflow name. We will lookup the named workflow in the D-data structure and send that workflow to a cal to the command sequencer. Which will in-turn convert the list of commands in that workflow into commands that are enqueued to the command queue.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | array.<(boolean|string|integer)> | An array that could actually contain anything, depending on what the user entered. But the function filters all of that internally and extracts the case the user has entered a workflow name, that we should use to look up the workflow in the D-data structure. inputData[0] === 'workflow' inputData[1] === workflowName
`inputMetaData` | string | Not used for this command.

Author:
  - Seth Hollingsead
Source:
  - commandsBlob/commands/advanced.js, line 115

##### Returns:

An array with a boolean True or False value to indicate if the application should exit or not exit, followed by the command output.

Type
  array.<boolean, (string|integer|boolean|object|array)>