Callback Workflow
The Callback Workflow Type is used to manage validation logic in Advantage Platform applications, such as CPQ or CLM, without relying on custom code. Validation callbacks can be implemented through workflows as a no-code solution, making them easier to configure and maintain.
Sample Callback: Quantity Validation
using Conga.Revenue.Common.Callback;
using Conga.Revenue.Common.Callback.Models;
using Conga.Platform.Extensibility.CustomCode.Library;
using System.Collections.Generic;
using System.Threading.Tasks;
using Conga.Revenue.Common.Callback.Entities;
using Conga.Revenue.Common.Callback.Messages;
namespace CallbackProject {
public class ValidationCallback : CodeExtensibility, IValidationCallback {
public async Task BeforePricingValidationAsync(IActionRequest actionRequest) {
await Task.CompletedTask;
}
// This method will trigger on Validate API call
public async Task OnCartValidationAsync(IActionRequest actionRequest) {
var cartContext = actionRequest.GetCartContext();
var cartName = cartContext.GetCart().GetEntity().Name;
// Trigger validation callback on Save action if QTY > 5
if (cartName.Contains("ValidationCallback02")) {
if (actionRequest.ActionName == "Save") {
foreach (var lines in cartContext.GetLineItems()) {
var chargelines = lines.GetChargeLines();
foreach (var line in chargelines) {
var li = line.GetEntity();
if (li.Quantity > 5) {
li.PricingStatus = "Error";
var message = "Quantity is > 5 for LineItem " + li.Name;
line.SetErrorDetails(message);
lines.SetToRePricing();
}
}
}
}
}
// Trigger validation callback Warning on Save action if QTY > 5
if (cartName.Contains("ValidationCallbackWarning01")) {
if (actionRequest.ActionName == "Save") {
foreach (var lines in cartContext.GetLineItems()) {
var chargelines = lines.GetChargeLines();
foreach (var line in chargelines) {
var li = line.GetEntity();
if (li.Quantity > 5) {
var message = "Quantity is > 5 for LineItem " + li.Name;
line.SetWarning(message);
lines.SetToRePricing();
}
}
}
}
}
// Validation callback for Submit For Approval action if QTY > 5
if (cartName.Contains("C0ValidationCallback")) {
if (actionRequest.ActionName == "SubmitForApproval") {
foreach (var lines in cartContext.GetLineItems()) {
var chargelines = lines.GetChargeLines();
foreach (var line in chargelines) {
var li = line.GetEntity();
if (li.Quantity > 5) {
li.PricingStatus = "Error";
var message = "Quantity is > 5 for LineItem " + li.Name;
line.SetErrorDetails(message);
lines.SetToRePricing();
}
}
}
}
}
}
}
}
Equivalent Callback Workflow
The same validation is implemented using a Callback Workflow. This workflow evaluates cart details such as the cart name, the action being performed, and line item quantities.
Start – The workflow is triggered when a cart action occurs (Save, Finalize, or Submit for Approval).
Validate Name and Action (Decision activity) – The workflow checks the cart name and action to determine which validation rule to apply. For example:
ValidationCallbackWarning01 → generates a warning.
ValidationCallback02 → shows an error on Save.
C0ValidationCallback → shows an error on Submit for Approval.
Check Quantity (Decision activity) – The workflow evaluates whether any line item quantity exceeds 5.
Error on Quantity (Error activity) – If the condition is true, the workflow raises an error message. Depending on the earlier decision branch, the action may be blocked or allowed with a warning.
