Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents
minLevel3
maxLevel3
includeapi.get
typeflat
|api.getDirect|api.post|api.postDirect

api.get

Sends get request to endpoint by specified url. Is asynchron method.

...

Expand
titleExample
Code Block
//get list of all endpoints provided for MyStore application
var response = await api.get('myst2/meta');

api.getDirect

Sends get request to endpoint on specified CMA API server by specified url. Is asynchron method.

...

Expand
titleExample
Code Block
//get list of all endpoints provided for MyStore application
var response = await api.getDirect('myst2/meta', 'cmaeu3');

api.post

Sends post request to endpoint by specified url. Is asynchron method.

...

Expand
titleExample
Code Block
let newProduct = { 
    "number": "000TS-01",
    "name": "T-short Adidas White XS",
    "vatType": 31
};
var response = await api.post('trip2/product', newProduct);

api.postDirect

Sends post request to endpoint on specified CMA API server by specified url. Is asynchron method.

...

Description

Workflow level

Account level

Writes key and value into myVault dictionary

set

setGlobal

Writes key and value into myVault dictionary on the workflow complete event

setOnComplete

setGlobalOnComplete

Reads value from myVault dictionary by specified key

get

getGlobal

Removes key-value pair from myVault dictionary by specified key

remove

removeGlobal

Determines whether the myVault dictionary contains the specified key

contains

containsGlobal

myVault.set

Writes key and value into myVault dictionary belonged to the workflow.

...

Expand
titleexample #3
Code Block
let keys =  [1, 2, 3, 4, 5];
let value = fx.utcNow();
await fx.forEach(keys, async(key)=> { 
    await myVault.set(key, value); 
});

myVault.setGlobal

Writes key and value into Global myVault dictionary belonged to the account.

...

Expand
titleexample #3
Code Block
let keys =  [1, 2, 3, 4, 5];
let value = fx.utcNow();
await fx.forEach(keys, async(key) => { 
    await myVault.setGlobal(key, value); 
});

myVault.setOnComplete

Writes key and value into myVault dictionary belonged to the workflow.

...

Please see conditionas for “Workflow complete“ by this link

myVault.setGlobalOnComplete

Writes key and value into Global myVault dictionary belonged to the account.

...

Please see conditionas for “Workflow complete“ by this link

myVault.get

Reads value from myVault dictionary by specified key.

...

Expand
titleexample #3
Code Block
let keys =  [1, 2, 3, 4, 5];
let values = [];
await fx.forEach(keys, async(key) => { 
    values.push(await myVault.get(key)); 
});

myVault.getGlobal

Reads value from Global myVault dictionary by specified key.

...

Expand
titleexample #3
Code Block
let keys =  [1, 2, 3, 4, 5];
let values = [];
await fx.forEach(keys, async(key) => { 
    values.push(await myVault.getGlobal(key)); 
});

myVault.remove

Removes key-value pair from myVault dictionary by specified key.

...

Expand
titleexample #3
Code Block
let keys =  [1, 2, 3, 4, 5];
await fx.forEach(keys, async(key) => {
    await myVault.remove(key); 
});

myVault.removeGlobal

Removes key-value pair from Global myVault dictionary by specified key.

...

Expand
titleexample #3
Code Block
let keys =  [1, 2, 3, 4, 5];
await fx.forEach(keys, async(key) => {
    await myVault.removeGlobal(key); 
});

myVault.contains

Determines whether the myVault dictionary contains the specified key

...

Expand
titleexample #3
Code Block
let keys =  [1, 2, 3, 4, 5, 6, 7, 8, 9];
keys = await fx.filter(keys, async(key) => { 
    return await myVault.contains(key); 
});

myVault.containsGlobal

Determines whether Global myVault dictionary contains the specified key

...