Operations
Syntax
LogicalId
{
"LogicalId": "createTag"
}
Description: the LogicalId is unique, it's indicate the name of the operation.
Description
{
"Description": "Define a new tag"
}
Description: the field serve as descriptors for the operation.
ExposedAsRest
{
"ExposedAsRest": false
}
Description: it's a Boolean property that indicates whether a specific operation is accessible as a RESTful API endpoint.
- ExposedAsRest: true: The operation is available externally as part of the REST API. This means that clients can invoke this operation over HTTP using standard HTTP methods like GET, POST, PUT, DELETE, etc.
- ExposedAsRest: false: The operation is not available as a REST API endpoint. It can only be called internally within the business unit.
Type
{
"Type": "Post"
}
Description:: indicate the HTTP type of the operation, can be:
- Get
- Post
- Put
- Delete
- Patch
###Inputs
{
"Inputs": [
{
"DataType": "String",
"MaxLength": null,
"DefaultValue": null,
"RegularExpression": null,
"LogicalId": "Name",
"Description": null,
"Required": true,
"IsUnique": false,
"AutoGenerate": false
}
]
}
Description: indicate to an Array on inputs Parameters as previously defined in Object of your Code Model.
ResultType
{
"ResultType": {
"Type": "None",
"IsArray": false,
"ObjectLogicalId": null
}
}
Description: indicate the returned result type of the operation
- Type: indicate the return type, can be the following values:
- Primitive
- Object
- Pagination
- None
- IsArray: indicate the return type if it's a collection (Array) or not.
- ObjectLogicalId: refer to LogicalId that excepted to return.
Functionality
{
"Functionality": [
{
"ExpressionType": "InitiateVariable",
"TypeOf": {
"Type": "Primitive",
"IsArray": false,
"DataType": "Boolean"
},
"DefaultValue": {
"ExpressionType": "Constant",
"DataType": "Boolean",
"Value": false
},
"LogicalId": "tagexist",
"Description": null
},
{
"ExpressionType": "InitiateVariable",
"TypeOf": {
"Type": "Pagination",
"ObjectLogicalId": "RetrieveTags"
},
"DefaultValue": {
"ExpressionType": "ExecuteQuery",
"PageNumber": {
"ExpressionType": "Constant",
"DataType": "Int32",
"Value": 1
},
"PageSize": {
"ExpressionType": "Constant",
"DataType": "Int32",
"Value": 2147483647
},
"Arguments": [
{
"LogicalId": "Name",
"Value": {
"ExpressionType": "GetInput",
"Extension": null,
"LogicalId": "Name",
"Description": null
}
}
],
"Extension": null,
"LogicalId": "RetrieveTags",
"Description": null
},
"LogicalId": "existingTags",
"Description": null
},
{
"ExpressionType": "ForEach",
"ItemVariableLogicalId": "item",
"ArrayLogicalId": {
"ExpressionType": "GetProperty",
"SourceLogicalId": "existingTags",
"Extension": null,
"LogicalId": "List",
"Description": null
},
"Expressions": [
{
"ExpressionType": "IfCondition",
"LeftCondition": {
"ExpressionType": "GetProperty",
"SourceLogicalId": "item",
"Extension": null,
"LogicalId": "Name",
"Description": null
},
"Operator": "Equal",
"RightCondition": {
"ExpressionType": "GetInput",
"Extension": null,
"LogicalId": "Name",
"Description": null
},
"LogicalOperator": "And",
"Operands": null,
"OnSuccess": [
{
"ExpressionType": "SetVariable",
"Value": {
"ExpressionType": "Constant",
"DataType": "Boolean",
"Value": true
},
"LogicalId": "tagexist",
"Description": null
}
],
"OnFailure": null
}
]
},
{
"ExpressionType": "IfCondition",
"LeftCondition": {
"ExpressionType": "GetVariable",
"Extension": null,
"LogicalId": "tagexist",
"Description": null
},
"Operator": "NotEqual",
"RightCondition": {
"ExpressionType": "Constant",
"DataType": "Boolean",
"Value": true
},
"LogicalOperator": "And",
"Operands": null,
"OnSuccess": [
{
"ExpressionType": "CreateEntity",
"Arguments": [
{
"LogicalId": "Name",
"Value": {
"ExpressionType": "GetInput",
"Extension": null,
"LogicalId": "Name",
"Description": null
}
}
],
"LogicalId": "Tag",
"Description": null
}
],
"OnFailure": [
{
"ExpressionType": "ThrowError",
"Errors": [
{
"Name": "TagAlreadyExist",
"Message": "Tag already exist"
}
]
}
]
}
],
}
Description: indicate to the functionality implementation by defining expressions.