The Methods

Kaholo provides a code layer which enables the process execution become as flexible as a script.

Kaholo’s code is as simple as writing JavaScript code language.

This section describes all the methods that the SDK expose.

getProcessById(processId)

Parameters Return Description
string (processID) Object (process) This method returns the Process information such as execution results.

getProcessIteration()

Return Description
int (The iteration numnber) When running a process in a loop – this method return the number of time this process was executed.

getProcessByName(name)

Parameters Return Description
string (processName) Object (process) This method return the first process with a given name. If non return undefined.

getActionByIndex(actionIndex, process)

Parameters Return Description
int (actionIndex)
Object (process)
Object (action) This method returns the action in the index number within the process specified.

getProcessCrossAgent(processId)

Parameters Return Description
int (ProcessId) Object (action) This method returns a process from all running agents.

getConfiguration()

Parameters Return Description
int (ProcessId) Object (configuration) or undefined This method returns the configuration executed.

The Objects

currentAgent

Object type Description
kaholoAgent
declare class KaholoAgent {
    name: string;
    url: string;
    attributes: [{ name: string }]
}

trigger

Object type Description
KaholoTrigger
declare class KaholoTrigger {
    msg: string;
    payload: any;
}

configutation

Object type Description
KaholoConfiguration
declare class KaholoConfiguration{
    name:String;
    value:Object
}

vault

Object type Description
KaholoVault
declare class KaholoVault {
    /**
     * Get vault from vault by key
     * @param key 
     */
    getValueByKey(key: string): Promise<any>
}

currentAction, previousAction

Object type Description
KaholoAction
declare class KaholoAction {
    server: { type: string, name: string, id: string };
    method: String | {
        params: [
            {
                name: string,
                type: string,
                id: string
            }
        ],
        agent: {
            type: string,
            id: string
        },
        name: string,
        actionString: string,
        createdAt: string,
        updatedAt: string,
        id: string
    };
    params: [object];
    name: string;
    timeout: number;
    timeunit: number;
    retries: number;
    mandatory: boolean;
    suspend: boolean;
    result: string;
    status: number;
    id: number;
    order: number;
    lastUpdate: number
}

currentProcess, previousProcess

Object type Description
KaholoProcess
declare class KaholoProcess {
    id: number;
    name: string;
    description: string;
    order: number;
    default_execution: boolean;
    mandatory: boolean;
    actions: [KaholoAction];
    result: string;

    preRun: String;
    postRun: String;
    filterAgents: String;
    coordination: String;
    flowControl: String;
    correlateAgents: boolean;
    condition: String;
    createdAt: String;
    used_plugin: KaholoPlugin;
    uuid: String
}

currentLink, previousLink

Object type Description
KaholoLink
declare class KaholoLink {
    id: string;
    sourceId: string;
    targetId: string;
    processes: [KaholoProcess];
    result: string;
    linkIndex: 0
}
Close Menu