Triggering a pipeline from .gitlab-ci.yml

I’m wanting to set up a generic pipeline that can execute, or trigger, a different pipeline depending on some conditions. I’ve tried various scenarios with no success. Here is a synopsis of what I am trying:

I have a file called project-info.yml containing:
##########
variables:
GITLAB_CI_YML: “gitlab-ci_java_build_deploy_only.yml”
PROJECT_LANG" “JAVA”
##########

My .gitlab-ci.yml contains:
##########
include: “project-info.yml”

script:
- ‘echo “INFO: CI_COMMIT_BRANCH: ${CI_COMMIT_BRANCH}”’
- ‘echo “INFO: PROJECT_LANG: ${PROJECT_LANG}”’
- |
   if [ $CI_COMMIT_BRANCH == “MAIN” ]; then
       if [ $PROJECT_LANG == “JAVA” ]; then
           GITLAB_CI_YML=“gitlab-ci_java_full_build.yml”
       elif [ $PROJECT_LANG == “Python” ]; then
           GITLAB_CI_YML=“gitlab-ci_python_full_build.yml”
       fi
   fi
- ‘echo “INFO: GITLAB_CI_YML: ${GITLAB_CI_YML}”’
   trigger: $GITLAB_CI_YML

##########

Any recommendations on how to accomplish this?

Thank you

Can’t you just code gitlab-ci_python_full_build.yml, gitlab-ci_java_full_build.yml, and gitlab-ci_java_build_deploy_only.yml in your .gitlab-ci.yml with rules to trigger each?

workflow:
  rules:
    - if: $CI_COMMIT_BRANCH == "MAIN" && $PROJECT_LANG == “JAVA”

See GitLab CI/CD `workflow` keyword | GitLab