How
to do project setup in Workbench/JBDS/Git?
Contents
1. Introduction
2. Add new
repository to workbench
3. Adding
Asset to Repository
Adding Project :
Create Business Process:
4. Importing
Project from a Git Repository into JBDS
5. Synchronizing
with Business central Git Repository
6. Committing
Changes to Business Central Git Repository
7. Retrieving
the Changes from the Business Central Git Repository
1. Introduction
Purpose
of this document is to explain step by step with screen shots, how developer
should create a project in Workbench, import in Git and then connect to JBDS to
be able to do day to day development and synchronize with Git repository.
Following
tools (with version) have been used in this setup:
·
Workbench v6.2
·
JBDS v8.1.0 GA
·
Git v2.6.3
·
JDK v1.7.0
2.
Add
new repository to workbench
1. Create a new repository to
hold your project by selecting the Administration Perspective.
Figure 1.0
2. Select
the "New repository" option from the menu.
Figure 1.1
3. Enter the required information checking managed Repository check box.
Figure 1.2
Entering repository information
click next
4. Click Finish
New
managed repository will be created for single project
Similarly
it can be created for multiple project choosing multi project repository check
box
5. Adding the repo to manage
organizational unit
Figure
1.5
Figure
1.6
Select
the repository to move in “Associated repositories”.
3. Adding Asset to Repository
Adding Project :
1. Select
the Authoring Perspective to create a new project.
Figure 2.0
2. Select
"Project" from the "New Item" menu.
Figure 2.1
3.Enter a
project name.
Figure 2.2
4.Enter
the project details next.
a. Group ID
follows Maven conventions.
b. Artifact
ID is pre-populated from the project name.
c. Version
follows Maven conventions.
d. Click Finish.
Figure 2.3
Create Business Process:
1. Select
"Business Process" from the "New Item" menu.
Figure 2.4
2. Enter
the “Business Process” name and provide the Package from Drop down, click Ok.
Figure 2.5
3. Process
created will be an empty process with start node ,need to draw further as per
requirement.
Figure 2.6
Note :
Similarly other Assets can be added from New Item tab.
4.
Importing
Project from a Git Repository into JBDS
JBoss Developer Studio can be configured to connect
to a central Git managed repository. The repository is the space where versions
of rules, models, functions and processes are stored. This Git repository must
already be defined by the KIE Workbench.
1. In JBoss
Developer Studio, select File → Import... and navigate to the Git folder. Open
the Git folder to select Projects from Git and click Next.
Figure
3.0
2. Select
the repository source as Clone URI and click Next.
Figure 3.1
3. Enter
the details of the Git repository in the next window and click Next.
Figure
3.2
Note : Refer Figure 1.4 to
get URI details.
4. Select
which branch you want to import in the following window and click Next.
Figure 3.3
5. You will
be presented with the option to define the local storage for this project.
Enter (or select) a non-empty directory, make any configuration changes and
click Next.
Figure 3.4
6. Import
the project as a general project in the following window and click Next. Name the project and click Finish.
Figure 3.5
Figure
3.6
7. Convert
the project to maven project.
8. Right
Click the project and choose configure convert
to Maven Project
Figure 3.7
5.
Synchronizing
with Business central Git Repository
To synchronize
the local repository with Business central for any changes:
1. Open
your repository project in JBoss Developer Studio.
2. Right-click
on your repository project and select Team → Synchronize Workspace.
Figure 4.0
3. New
dialog box open showings prompting to open synchronize perspective, Click Yes.
Figure 4.1
4. The synchronize
view will show the file state and double-clicking on the file will open a compare
window view.
Figure 4.2
5. User can
choose to take different actions, right clicking the file.
Figure 4.3
6.
Committing
Changes to Business Central Git Repository
To
commit and push your local changes back to the Business Central Git repositories:
1. Open your repository project in JBoss
Developer Studio.
2. Right-click
on your repository project and select Team → Commit.
Figure
5.0
3. A new dialog
box open showing all the changes you have on your local file system.
Figure 5.1
4. Select
the files you want to commit, provide an appropriate commit message, and click Commit.
5. You can
double-click each file to get an overview of the changes you did for that file.
Figure 5.2
6. Right-click
your project again, and select Team → Push to Upstream.
Figure
5.3
7.
Retrieving
the Changes from the Business Central Git Repository
To
retrieve the latest changes from the Business Central repository follow below
steps:
1. Open your repository project in JBoss
Developer Studio.
2. Right-click
your repository project and select Team → Fetch from Upstream.
Figure 6.0
3. This
action fetches all the changes from the Business Central repository.
4. Right-click
your project again and select Team → Merge.
Figure 6.1
5. A Merge
'master' dialog appears.
6. In the
Merge 'master' dialog box, select origin/master branch under Remote Tracking.
7. Click Merge.
Figure 6.2
8. This
merges all the changes from the original repository in Business Central.
NOTE : It is possible that you have committed and/or conflicting
changes in your local version, you might have to resolve these conflicts and
commit the merge results before you will be able to complete the merge
successfully. It is recommended to update regularly, before you start updating
a file locally, to merge conflicts being detected when trying to commit
changes.