ApprovalPathTemplate Examples

Query Expense Approval Paths

Query for expense approval paths.

[
  {
    "Action": "Query",
    "QueryType": "ExpenseApprovalPathAll",
    "DomainType": "Replicon.Domain.Approvals.ApprovalPathTemplate",
    "Args": []
  }
]

Query Expense Approval Path by Name

Query for an expense approval path with the name "Supervisor".

[
  {
    "Action": "Query",
    "QueryType": "ExpenseApprovalPathByName",
    "DomainType": "Replicon.Domain.Approvals.ApprovalPathTemplate",
    "Args": [
      "Supervisor"
    ]
  }
]

Query TimeOff Approval Paths

Query for time off approval paths.

[
  {
    "Action": "Query",
    "QueryType": "TimeOffApprovalPathAll",
    "DomainType": "Replicon.Domain.Approvals.ApprovalPathTemplate",
    "Args": []
  }
]

Query TimeOff Approval Path by Name

Query for a time off approval path with the name "Supervisor".

[
  {
    "Action": "Query",
    "QueryType": "TimeOffApprovalPathByName",
    "DomainType": "Replicon.Domain.Approvals.ApprovalPathTemplate",
    "Args": [
      "Supervisor"
    ]
  }
]

Query Timesheet Approval Paths

Query for timesheet approval paths.

[
  {
    "Action": "Query",
    "QueryType": "TimesheetApprovalPathAll",
    "DomainType": "Replicon.Domain.Approvals.ApprovalPathTemplate",
    "Args": []
  }
]

Query Timesheet Approval Path by Name

Query for a timesheet approval path with the name "Supervisor".

[
  {
    "Action": "Query",
    "QueryType": "TimeSheetApprovalPathByName",
    "DomainType": "Replicon.Domain.Approvals.ApprovalPathTemplate",
    "Args": [
      "Supervisor"
    ]
  }
]

Query ApprovalPath by Id -- int has to be quoted by [[]]

Query for an approval path by Id.

[
  {
    "Action": "Query",
    "QueryType": "ApprovalPathById",
    "DomainType": "Replicon.Domain.Approvals.ApprovalPathTemplate",
    "Args": [
      [
        7
      ]
    ],
    "Load": [
      {
        "Relationship": "Nodes"
      },
      {
        "Relationship": "Edges"
      }
    ]
  }
]

Query Approval Sequence (Edge) by Id -- GUID

Query for an approval sequence by GUID.

[
  {
    "Action": "Query",
    "QueryType": "ApprovalPathTemplateEdgeById",
    "DomainType": "Replicon.Domain.Approvals.ApprovalPathTemplateEdge",
    "Args": [
      [
        {
          "__type": "GUID",
          "Value": "0E73B38E-1CF1-4445-A032-994065E1F525"
        }
      ]
    ],
    "Load": [
      {
        "Relationship": "StartNode"
      },
      {
        "Relationship": "EndNode"
      }
    ]
  }
]

Create a Timesheet Approval Path

Create a timesheet type of approval path.

[
  {
    "Action": "Create",
    "Type": "Replicon.Domain.Approvals.ApprovalPathTemplate",
    "Operations": [
      {
        "__operation": "SetProperties",
        "Name": "MyApprovalPath_Timesheet",
        "Type": {
          "Identity": "Timesheet"
        }
      }
    ]
  }
]

Create a Time Off Approval Path

Create a time off type of approval path.

[
  {
    "Action": "Create",
    "Type": "Replicon.Domain.Approvals.ApprovalPathTemplate",
    "Operations": [
      {
        "__operation": "SetProperties",
        "Name": "MyApprovalPath_TimeOff",
        "Type": {
          "Identity": "TimeOffRequest"
        }
      }
    ]
  }
]

Create an Expense Approval Path

Create an expense type of approval path.

[
  {
    "Action": "Create",
    "Type": "Replicon.Domain.Approvals.ApprovalPathTemplate",
    "Operations": [
      {
        "__operation": "SetProperties",
        "Name": "MyApprovalPath_Expense",
        "Type": {
          "Identity": "Expense"
        }
      }
    ]
  }
]

Create Approvers for an existing Approval Path

Create approvers (nodes) for an existing approval path.

[
  {
    "Action": "Edit",
    "Type": "Replicon.Domain.Approvals.ApprovalPathTemplate",
    "Identity": "5",
    "Operations": [
      {
        "__operation": "CollectionAdd",
        "Collection": "Nodes",
        "Operations": [
          {
            "__operation": "SetProperties",
            "NodeIndex": "1",
            "AndOr": {
              "Identity": "And"
            },
            "ApproverType": {
              "Identity": "2"
            }
          }
        ]
      },
      {
        "__operation": "CollectionAdd",
        "Collection": "Nodes",
        "Operations": [
          {
            "__operation": "SetProperties",
            "NodeIndex": "2",
            "AndOr": {
              "Identity": "And"
            },
            "ApproverType": {
              "Identity": "2"
            }
          }
        ]
      }
    ]
  }
]

Specify Approval Sequence for an existing Approval Path

Specify the approval sequence for an existing approval path.

[
  {
    "Action": "Edit",
    "Type": "Replicon.Domain.Approvals.ApprovalPathTemplate",
    "Identity": "5",
    "Operations": [
      {
        "__operation": "CollectionAdd",
        "Collection": "Edges",
        "Operations": [
          {
            "__operation": "SetProperties",
            "StartNode": {
              "Identity": "85DC50B1-7211-4B90-A9E2-07917C6F2A97"
            },
            "EndNode": {
              "Identity": "61E18647-A78E-4F87-BC34-C54BCE2019BD"
            }
          }
        ]
      },
      {
        "__operation": "CollectionAdd",
        "Collection": "Edges",
        "Operations": [
          {
            "__operation": "SetProperties",
            "StartNode": {
              "Identity": "61E18647-A78E-4F87-BC34-C54BCE2019BD"
            },
            "EndNode": {
              "Identity": "F38AD0EF-5FF9-4064-B1B5-4AA583DCC127"
            }
          }
        ]
      }
    ]
  }
]