In many projects, business logic already exists as code—perhaps in Java, JavaScript, or another programming language. The Corticon AI Assistant allows you to quickly convert such logic into rules for your rulesheet, helping bridge the gap between technical requirements and business automation.

How it works:

  • You can paste a code snippet that represents your business rule logic into the Assistant’s prompt area.

  • The Assistant will read the code, interpret the logic, and generate corresponding rules using the vocabulary in your open rulesheet.

Just like with plain text prompts, the Assistant will only add new rules to your rulesheet—it will not modify or delete existing rules.

Steps to create rules from code snippets:

  1. Open the rulesheet where you want to add new rules.
  2. Paste your code snippet into the AI Assistant’s prompt area.
  3. Click Send. The Assistant will analyze the code and generate rules based on its logic, mapped to your rulesheet’s vocabulary.

Review and test the generated rules to confirm they meet your needs.

Here are a few example code-based prompts you might use:

  • if (customerType == "Gold" && purchaseAmount > 1000) { discount = 0.15; }

  • if (claim.dateOfService < policy.effectiveDate) { claim.status = "Rejected"; }

  • if (age >= 65 && drivingMiles < 50) { insuranceRate = 0.07; }

Complex Example:

The AI Assistant can also interpret more sophisticated business logic from longer code blocks, including multiple conditions and nested logic. For example, you can paste the following JavaScript-style code to create a comprehensive set of insurance cost rules:



Tips for the best results:

  • Use clear code that reflects business intent, and ensure the terms in your code match entities and attributes in your rulesheet’s vocabulary.

  • The Assistant supports code snippets in any language recognized by your AI provider.