> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/application-security/application-security-posture-management-aspm/applications/defining-business-applications/define-applications-by-code-criteria/reference-b-code-criteria-references-and-examples.md).

# Reference B: Code Criteria references and examples

Use these examples to understand how grouping, unification, and scope filters affect generated applications.

For toggle dependencies and deployment behavior, see [Reference A: Code Criteria grouping and unification](/application-security/application-security-posture-management-aspm/applications/defining-business-applications/define-applications-by-code-criteria/reference-a-code-criteria-grouping-and-unification.md).

## Grouping and unification examples

### Merge within a provider

A Criteria targets GitHub with **Group by** set to **Repository**. Two projects in `acme-eng` expose repositories named `payments-api`.

| Provider | Organization | Project    | Repository     |
| -------- | ------------ | ---------- | -------------- |
| GitHub   | `acme-eng`   | `checkout` | `payments-api` |
| GitHub   | `acme-eng`   | `billing`  | `payments-api` |

| Merge toggle | Result                                                                    |
| ------------ | ------------------------------------------------------------------------- |
| **Off**      | Two separate `payments-api` applications, one for each source repository. |
| **On**       | One `payments-api` application containing both repositories.              |

### Unify across providers

A Criteria targets GitHub and GitLab with **Group by** set to **Repository**. Both providers host `payments-api`.

| Provider | Organization or group | Repository     |
| -------- | --------------------- | -------------- |
| GitHub   | `acme-eng`            | `payments-api` |
| GitLab   | `acme-platform`       | `payments-api` |

| Merge toggle | Unify toggle | Result                                                                 |
| ------------ | ------------ | ---------------------------------------------------------------------- |
| **Off**      | **Off**      | Two applications: `payments-api_GitHub` and `payments-api_GitLab`.     |
| **On**       | **Off**      | The same two applications. Merging operates only within each provider. |
| **On**       | **On**       | One `payments-api_GitHub_GitLab` application spanning both providers.  |

## Multi-provider scope filtering

A Criteria targets three provider tabs. Each tab has its own grouping level and filters.

* **GitHub** — **Group by: Organization**. **Organization Name Contains** `payments`.
* **GitLab** — **Group by: Repository**. **Repository Name Equal** `api-gateway`.
* **Bitbucket** — **Group by: Project**. No filters.

The final scope is the union of all tabs.

| Tab       | Included assets                                                                      |
| --------- | ------------------------------------------------------------------------------------ |
| GitHub    | Every repository under organizations containing `payments`, grouped per organization |
| GitLab    | Every repository named `api-gateway`, grouped per repository                         |
| Bitbucket | Every connected repository, grouped per project                                      |

The result sets are added together. They do not intersect. The unfiltered Bitbucket tab includes all connected Bitbucket projects.

If unification is enabled, identically named applications then merge according to [Reference A: Code Criteria grouping and unification](/application-security/application-security-posture-management-aspm/applications/defining-business-applications/define-applications-by-code-criteria/reference-a-code-criteria-grouping-and-unification.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/application-security/application-security-posture-management-aspm/applications/defining-business-applications/define-applications-by-code-criteria/reference-b-code-criteria-references-and-examples.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
