Upgrade to Pro — share decks privately, control downloads, hide ads and more …

[KieLive#2] jBPM: Syncing Business Central proj...

KIE Community
December 08, 2020

[KieLive#2] jBPM: Syncing Business Central projects with external repos, by Esthatios Rouvas

If you work with jBPM or Red Hat Process Automation Manager (RHPAM), you probably heard about the fact that Business Central uses an internal git repository to version the projects and assets you author. How do you keep the processes and rules you are authoring within Business Central synchronized with an external repository like for example GitHub, GitLab or Gitea?

In this talk you will hear from an experienced RHPAM specialist about possible ways to automate the integration of you project in Business Central with external git repositories.

You will learn what are git hooks, how to configure them in jBPM to trigger commits based on Business Central actions and what other functionalities you can take advantadge of when using Git Hooks.

Link to the live streaming: https://www.youtube.com/watch?v=EkZziuFYVCY

Who's the speaker?
Stathis is a Middleware Consultant in Red Hat UK&I working primarily in RHPAM. His past experience also includes working with JBoss EAP, Fuse and Application Development. He has been following Drools and jBPM since 2008. His community work can be found at https://gitlab.com/erouvas and is also contributing to https://github.com/redhat-cop/businessautomation-cop

KIE Community

December 08, 2020
Tweet

More Decks by KIE Community

Other Decks in Technology

Transcript

  1. Developer Workstation Authoring Server / Controller Business Central Runtime Server

    (cluster) KIE Server SCM Server (Git) Maven Artefact Repository Continuous Integration Server push pull import check out publish deploy fetch High Level Overview of deployment without post-commit git hooks Local working directory clone / pull 2
  2. Authoring Server / Controller Business Central Runtime Server (cluster) KIE

    Server SCM Server (Git) Maven Artefact Repository Continuous Integration Server push / git hook import check out publish deploy fetch High Level Overview of deployment with post-commit git hooks author 3
  3. Git hooks are bash scripts that execute before or after

    Git events such as git commit or git push. In Business Central, you can use Git hooks to configure repositories to trigger specified actions every time events happen. You can integrate remote Git repositories with Business Central by using post-commit Git hooks. This enables you to automate content replication between Business Central and remote repositories. A post-commit Git hook executes after every commit as a sync operation. Business Central waits for the post-commit bash to complete and no other write operation occurs in the repository. Git integration through git hooks 4
  4. Post-commit git hooks in BC - nota benum 5 •

    All modifications to the project must be done through BC ◦ BC cannot ‘git pull’, cannot merge changes from external repos • Branches can be created in BC, but propagated to remote git after a “save” operation • Git hooks do not “delete” ◦ Projects deleted in BC will not be deleted in external git repo ◦ Branches deleted in BC will not be deleted in external git repo • But, projects assets, for example BPMN, DMN, Rules, etc, WILL be deleted Use BC REST endpoints to delete and re-import project • DELETE <bc_url>/rest/spaces/MySpace/projects/$PRJ_NAME • POST <bc_url>/rest/spaces/MySpace/git/clone
  5. Post-commit git hooks in BC - implementations 6 Java Based

    • Linked to by RHPAM documentation ◦ https://github.com/kiegroup/bc-git-integration-push ▪ Can handle GitHub, GitLab and GitLab Enterprise ◦ Porcelli’s original ▪ https://github.com/porcelli/bc-git-integration-push ▪ Additionally can handle Bitbucket V2 Bash based • bcgithook: https://github.com/redhat-cop/businessautomation-cop/tree/master/bcgithook • Handles any (GitLab, GitHub, Bitbucket, Azure, Gitea, Gogs, …)
  6. Post-commit git hooks in BC - installation 7 3 steps

    1. Configure BC for git hooks 2. Install git hook implementation 3. Configure git hook implementation (external git URL, credentials, ...) Step 1 • Specify git hooks location by setting system property “org.uberfire.nio.git.hooks“ ◦ For example “${jboss.home.dir}/git-hooks” Step 2 • Copy into “${jboss.home.dir}/git-hooks” directory git hook implementation • Must be a bash script named “post-commit” • For Java-based implementation “post-commit” script invokes Java class Step 3, depends on implementation
  7. Demo Creation of a project BC differs based on external

    git repo: • GitLab • Gitea Will allow creation of repository/project directly from BC • GitHub • Bitbucket • Azure DevOps Create an empty repository first (no readme, no .gitignore or anything else) • Installation ◦ https://github.com/redhat-cop/businessautomation-cop/tree/mas ter/pam-eap-setup ◦ https://github.com/redhat-cop/businessautomation-cop/tree/mas ter/bcgithook • Import project from external git repo - review branches • Demonstrate syncing with external git repo ◦ Creating, modifying and deleting an asset in Business Central ◦ Creating a branch in Business Central ◦ Deleting a branch in Business Central • Create and deleting a project in Business Central