Chilkat Examples

ChilkatHOMEAndroid™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi DLLGoJavaJavaScriptNode.jsObjective-CPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwiftTclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

Xojo Plugin Examples
Web API Categories

AI
ASN.1
AWS KMS
AWS Misc
Amazon EC2
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Apple Keychain
Async
Azure Cloud Storage
Azure Key Vault
Azure Service Bus
Azure Table Service
Base64
Box
CAdES
CSR
CSV
Cert Store
Certificates
Cloud Signature CSC
Code Signing
Compression
DKIM / DomainKey
DNS
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
EBICS
ECC
Ed25519
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
GMail SMTP/IMAP/POP
Geolocation
Google APIs
Google Calendar
Google Cloud SQL
Google Cloud Storage
Google Drive
Google Photos
Google Sheets
Google Tasks
Gzip
HTML-to-XML/Text
HTTP
HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)
Java KeyStore (JKS)
JavaScript
MHT / HTML Email
MIME
Markdown
Microsoft Graph
Misc
NTLM
OAuth1
OAuth2
OIDC
Office365
OneDrive
OpenSSL
Outlook
Outlook Calendar
Outlook Contact
PDF Signatures
PEM
PFX/P12
PKCS11
POP3
PRNG
REST
REST Misc
RSA
Regular Expressions
SCP
SCard
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
ScMinidriver
Secrets
SharePoint
Signing in the Cloud
Socket/SSL/TLS
Spider
Stream
Tar Archive
ULID/UUID
Upload
WebSocket
X
XAdES
XML
XML Digital Signatures
XMP
Zip
curl
uncategorized

 

 

 

(Xojo Plugin) Execution Plan Failure Due to Circular Dependencies

See more CURL Examples

This example demonstrates what happens when an execution plan cannot be created due to a cycle in the dependency graph.

The target curl command requires {{report_id}}. A helper function is defined to produce report_id, but it depends on user_id. In turn, user_id depends on account_id, and account_id depends back on report_id.

This creates a circular dependency:

  • report_id → user_id
  • user_id → account_id
  • account_id → report_id

Because each required value ultimately depends on itself, there is no starting point with a known or independently resolvable input. As a result, it is impossible to construct a valid execution plan.

When ExaminePlan is called, it detects this cycle and reports that the execution plan cannot be created.

This example highlights that dependency resolution requires an acyclic graph. Every chain of dependencies must eventually terminate in a known value. If a cycle exists, the system correctly identifies it and prevents execution.

Note: This example requires Chilkat v11.5.0 or greater.

For more information, see https://www.chilkatsoft.com/curl_dependency_engine.asp

Chilkat Xojo Plugin Download

Xojo Plugin for Windows, Linux, Mac OS X, and ARM, ARM64

Dim success As Boolean
success = False

Dim httpCurl As New Chilkat.HttpCurl

// This example uses fake URLs and fake variables to demonstrate a dependency cycle.
// No requests are sent because we only call ExaminePlan.

// The target curl command requires {{report_id}}.
Dim targetCurl As String
targetCurl = "curl -X GET https://api.example.com/reports/{{report_id}}"

// getReportId can produce report_id, but it requires user_id.
Dim fnName As String
fnName = "getReportId"
success = httpCurl.AddFunction(fnName,"curl -X GET https://api.example.com/report-id?user={{user_id}}")
success = httpCurl.AddOutput(fnName,"report.id","report_id")

// getUserId can produce user_id, but it requires account_id.
fnName = "getUserId"
success = httpCurl.AddFunction(fnName,"curl -X GET https://api.example.com/user-id?account={{account_id}}")
success = httpCurl.AddOutput(fnName,"user.id","user_id")

// getAccountId can produce account_id, but it requires report_id.
// This creates a cycle:
// 
//   report_id -> user_id -> account_id -> report_id
// 
// In other words:
//   - targetCurl needs report_id
//   - report_id requires user_id
//   - user_id requires account_id
//   - account_id requires report_id
// 
// There is no starting point where the dependency chain can be resolved.
fnName = "getAccountId"
success = httpCurl.AddFunction(fnName,"curl -X GET https://api.example.com/account-id?report={{report_id}}")
success = httpCurl.AddOutput(fnName,"account.id","account_id")

// Examine the execution plan without sending any requests.
// The plan cannot be created because the dependencies contain a cycle.
Dim planJson As New Chilkat.JsonObject
planJson.EmitCompact = False

success = httpCurl.ExaminePlan(targetCurl,planJson)

// Success is expected to be false.
System.DebugLog("success = " + Str(success))

System.DebugLog(planJson.Emit())

// Expected result:
// 
// {
//   "errors": [{
//     "variable": "report_id",
//     "msg": "Cycle detected"
//   },{
//     "variable": "account_id",
//     "msg": "Unable to resolve"
//   },{
//     "variable": "user_id",
//     "msg": "Unable to resolve"
//   },{
//     "variable": "report_id",
//     "msg": "Unable to resolve"
//   }]
// 

 

© 2000-2026 Chilkat Software, Inc. All Rights Reserved.