This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jsValue = new JsonParser(JsEngine).Parse(myJsonString); //Parse myJsonString into JsValue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jsValue = JsValue.FromObject(JsEngine, myObject); //Convert myObject to JsValue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var methodPointer = processEngine.JsEngine.GetValue(jsMethod.Name); //Get the JS function from the Engine | |
jsMethod.Result = methodPointer | |
.Invoke(jsMethod.Parameters | |
.Select(p => processEngine.Results[p.Name]) | |
.ToArray()); //Invoke the JS function with all the parameters it has defined by reading them from the Results dictionary | |
processEngine.Results.TryAdd(jsMethod.Name, jsMethod.Result); //Add the output of the invoked function to the Results dictionary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public sealed class Output | |
{ | |
/// <summary> | |
/// The HTTP status. | |
/// </summary> | |
public int? HttpStatus { get; set; } = (int) HttpStatusCode.OK; | |
/// <summary> | |
/// The response. | |
/// </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
.. | |
{ "key": "method1", "value": { "val1": "Sample Data" } }, | |
{ "key": "method2", "value": "Sample Data" }, | |
... | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
function method2(method1) { | |
return method1.val1; //The output of method1 is available as input as requested as parameter | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Process1", | |
"tasks": [ | |
{ "id": "method1", "type": "js", "parameters": [ "request", "process" ] }, | |
{ "id": "method2", "type": "js", "parameters": [ "method1" ] }, | |
... | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// A DSL response. | |
/// </summary> | |
public sealed class ConnectorResponse | |
{ | |
/// <summary> | |
/// Creates a new empty DSL Connector Response. | |
/// </summary> | |
public ConnectorResponse(string errorMessage, string status) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// The DSL connector interface. | |
/// </summary> | |
public interface IConnector | |
{ | |
/// <summary> | |
/// The connector's name for reference from the orchestration file. | |
/// </summary> | |
string Name { get; } | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function method1(request, process) { | |
... | |
return val1; | |
} |
NewerOlder