You are on page 1of 32

EIM Development Handbook Luminor

Sitaraman, Lakshmi
6-11-2019

Document Change History

Revision EInvoice
Developer Revision Description Reviewer Revision Date

0.1 Lakshmi Sitaraman Initial version Arunas V


Development Handbook
0.2 Lakshmi Sitaraman Added more information Arunas V

0.3 Lakshmi Sitaraman Added page 20-35 Arunas V


List of Software required for EIM development:
JDK 11

Intellij - Community Edition

Eclipse

Docker - database and ActiveMQ


[Docker Version 18.06.0-ce-win72 (19098) or any latest version]

Putty

Citrix

Internet Browser

Notepadd++

Plugin for docker (intellij) - Docker integration

mysql-workbench-community-8.0.16-winx64

GIT

WinSCP -> Deployment

ACCESS REQUIRED

App Server1 : t1ee-eimapp1 IP : 10.93.87.8


Web Server t1ee-eimweb1 Ip : 10.93.85.14
QA Database Server : t1ee-eimdb1  Ip : 10.93.96.15
BIT Bucket Access -> https://bitbucket.luminorgroup.com/projects/LEI
JIRA Access -> https://jira.luminorgroup.com/secure/Dashboard.jspa
GIT Access
Citrix Access

PAGE 1
PROJECTS AVAILABLE IN GIT:

1. eim – core

2. eim-web

3. eim-xml

4. eim-common

5. eim-common platform

6. eim-fos-ws

STEPS FOR CLONING GIT REPOSITORY TO LOCAL HOME DIRECTORY:


Before starting the development, cloning of GIT repository need to be copied to the
local home directory and below steps need to be executed

1. Create access token (for the first time or if will be needed new one):
2. Login to https://bitbucket.luminorgroup.com with your credentials
3. Click on Avatar and select “Manage account” -> “Personal Access Tokens”
(https://bitbucket.luminorgroup.com/plugins/servlet/access-tokens/manage)
4. Select “Create token”, add name, choose permissions (if you will use write in
any of the projects – Please select it. Tokens are like another password, so their
permissions will default to the level of access you have).
5. Copy Access token (you will not be able to view it again) and save. Now you can
use it while cloning/pulling/pushing to repository.
6. Create a folder in your local directory, Open the GIT in that folder and clone all
the projects in your folder..

In order to get the repo to be clone: Click on the project -> Click on Clone ->
Copy the URL and use the below command in GIT -> Repeat the same for all 5
projects.

PAGE 2
Command(s):

Clone the git repository to your local working directory

git clone https://Lakshmi.Sitaraman


%40consult.luminorgroup.com@bitbucket.luminorgroup.com/scm/lei/
eim.git

git clone https://Lakshmi.Sitaraman


%40consult.luminorgroup.com@bitbucket.luminorgroup.com/scm/lei/eim-
common-platform.git

git clone https://Lakshmi.Sitaraman


%40consult.luminorgroup.com@bitbucket.luminorgroup.com/scm/lei/eim-
commons.git

git clone https://Lakshmi.Sitaraman


%40consult.luminorgroup.com@bitbucket.luminorgroup.com/scm/lei/eim-
fop-ws.git

git clone https://Lakshmi.Sitaraman


%40consult.luminorgroup.com@bitbucket.luminorgroup.com/scm/lei/eim-
web.git

PAGE 3
git clone https://Lakshmi.Sitaraman
%40consult.luminorgroup.com@bitbucket.luminorgroup.com/scm/lei/eim-
xml.git

STEPS FOR INTEGRATING ITELLIJ WITH EIM CODE REPO CLONED


ABOVE:
1. Open Intellij IDE. Click on File -> New -> Project from Existing Resource -> Select the
local Directory in which you have downloaded GIT Code -> OK

2. Select Gradle and Click on Next

PAGE 4
3. Select Gradle JVM as JDK 11 from you local and click on Finish. Repository will be
downloaded.
4. Repeat the same process for all other repository except eim-web (We will be installing
EIM web in eclipse)
5. Installation of docker: Need to run the docker file named docker-compose-db.yml
inorder to activate the docker and connect it to MYSQL (Docker is just used to connect
local to MYSQL Database)
a. Docker file is available in eim-common-platform. It consist of DB connection
details.
b. Open GIT bash from the local directory and execute the below command

Local Directory : C:\Users\c03194\EIMGITCode\eim-common-platform

Command : docker-compose -f docker-compose-db.yml up -d

Docker will be running and you can connect to local MYSQL successfully with the below
details.

6. Local MY SQL Connection


Login -> MYSQL WorkBench -> Click on database -> connect to Database.

PAGE 5
There will not be able data. So for that now we need to start eim module to load the
data.

Open Intellj -> Click on EIM repository -> Click on Gradle Icon -> Write the command
line as Clean Install -> Click on OK

Go to EIMApplication.java in eim repository -> Right Click -> Run


EIMApplication.main() ->Application will get started.

PAGE 6
7. Next step is to run eim-xml with gradle clean install like eim module since it has
dependency with other projects.
8. Next Step is to run eim-commons wit Gradle Clean Install , Once its done .m2 folder
will be created in your local repository with all the models, dao classes

PAGE 7
9. Go to MySQL Work Bench -> Connect to Local Host and -> Click on Schema -> Click on
localDb -> List of tables will be displayed. You can check using Select * from tablename.

EIM WEB Setup


1. Open Eclipse -> File -> Import -> Existing Gradle Projects

2. Next -> Next -> Select Project Root Directory (Folder in which you have
downloaded eim-web from GIT) -> Click on Finish

PAGE 8
3. Download lombok-1.18.4.jar and run the jar directly using GIT (This jar will
automatically creates getters and setters for the variables defined.)
Command : java -jar lombok-1.18.4.jar

4. Set up Annotation in Eclipse -> Right click on eim-web project in eclipse -> Build
Path -> Configure Build Path -> Type Annotation in the search box – Click on
Annotation Process -> Enable check Box of “Enable Project Spefic Setting ” -> Apply
& close

PAGE 9
5. Open EimWebApplication.java ->Right Click -> Run as Java Application

PAGE 10
6. Login to URL -> localhost:8080/eim

Userid : test

Password : Coordinate with your leads.

CONNECT TO QA DATABASE FROM PUTTY:

1. Connect to citrix url using Luminor credentials


2. Open putty and connect to DB server using server details as in screenshot.

3. Login to DB server using the userid/password created for the associate (my user id was
my last name)
4. In putty give this command, to connect to SQL database (User Name: luminor)

Command: mysql -u USERNAME -h 127.0.0.1 -p

Credentials: Use the QA database username/password. Note replace the username


with the QA username.
PAGE 11
5. Command to display the available database

Command: show databases; 

6. Select the EIM QA database luminordb

Command: use luminordb;

7. Run the below query to verify the DB connection.


select * from EINVOICE_STATUS;

COMMAND TO CHECK LOGS FROM PUTTY:

Login to Citrix -> Connect to the App Server (App Server1: t1ee-eimapp1 IP: 10.93.81.8)

Command to check logs -> sudo journalctl -b -e -f -u eim-core


Command to Check logs for specific date -> sudo journalctl --since='2019-05-17
10:20:00' -u eim-core

Logs are stored in event_log table and we are using annotations for capturing the details.

ACTIVE-MQ Connect from Local:

We will be using Active MQ to test in local since it is not feasible to make sonic call from local

Steps to Connect to Active -MQ

1. Start the docker as mentioned above with the below command.


docker-compose -f docker-compose-db.yml up -d
2. Go to the URL of Active MQ : -> localhost:8161/

3. Click on Manage Active MQ broker -> For credentials, contact your Leads

PAGE 12
4. Click on Queue

PAGE 13
5. Please create a Queue named “SONICEE.APP.EIM.REQUEST” if Queue is not actually
created.

6. Load the data in DB Steps:


a. Delete the data from seller contract in mysql local
b. Copy the below zip file in you local machine.

c. Extract the files in your local machine and create a folder named
“template” and sub folder named ”EMK ” and sub folder “received” in local
system.

d. Copy the files from test data to received folder. Initially copy all the files
from SCNew Folder which contains seller contract.

PAGE 14
e. Once files are copied . Delete the data from seller_contract table.
f. Go to EIM Web Application -> go to Preferences -> Change the Processor
path to your local directory in which you have placed the files -> Change
DNB file prefix to EMK.(Files will be picked automatically )

g. Create Sender from EIM Web -> Go to localhost:8080/eim -> enter


credentials -> E-invoice senders -> Add new sender.

PAGE 15
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj

h. Start eim-core Application by setting profiles active for jobs, mock , Active-
mq the files will be processed for Seller Contract.
Command : Dspring.profiles.active=jobs,active-mq
(Job runs every 10 seconds)

i. Once the files are processed then two folders will be created inside EMK
send -> File which are in processed state (is_processed =0)
tosend -> Archival file which are processed. (is_processed =1)

PAGE 16
You can also check in process_queue table how many files are yet to
process. Once all the files are processed , check in seller_contract table if
records are inserted successfully.

PAGE 17
j. Once all the seller contract files are processed , copy the files from test data
of folder named EARVE test data and place it in the received folder. After 10
seconds jobs will pick the files are starts processing.

k. Similarly check in process_queue table and once all the files are processed ,
data should be available in einvoice table with status as arrived. All the files
will be moved to send and tosend for Archival.

PAGE 18
l. Once all the data are fully loaded, Select the service you want to run via
Active MQ.
m. Go to EIM core -> EimServiceSelector.java -> mention the below command
serviceName =”Name of the service you want to test from ActiveMQ”

PAGE 19
n. Once the service name is selected , go the XML template in the project.
Modify the XML data or fields required and copy the xml and go to Active
MQ

o. Go to Active MQ -> Click on Send to

p. Copy the XML in the message Body and Click on Send -> Check for the logs
in console / Debug and check for the response.

PAGE 20
q. Now check for console for the Eim request XML to be sent will be displayed
and below exception states that since we haven’t set the output parameter
in ActiveMQ for the given request.

r. To set the out parameter -> Go to Active MQ -> Create a new queue
SONICEE.APP.EIM.OUT -> Go to Active MQ -> Click on
SONICEE.APP.EIM.REQUEST -> Set the Reply (Output Parameter as )
SONICEE.APP.EIM.OUT -> Click on Send

PAGE 21
s. Check for logs -> Exception will be eliminated -> XML to be send will be
displayed in logs.

t. Go to Active MQ -> ActiveMQ.DLQ will be created for Output parameter.

PAGE 22
u. Click on the ActiveMQ.DLQ

v. Click on ID:LUM-PC0SDVHL-52633-1560757792873-1:1:1:1:1 -> In the


message Details you can see the XML that is sent from EIM. Request.

PAGE 23
DB STRUCTURES:

List of Table Names for EIM

PAGE 24
PAGE 25
FUNCTIONAL UNDERSTANDING OF EIM:
PAGE 26
OSIRIS (Creates EInvoice
request)

SONIC (CX Messenger)

Jobs
EIM
 E-invoice Request data in DB. FITEK (Third Party Provider)
 Service call to OSIRIS, PLATON
via SONIC and vice versa

XML File process of Jobs

Update E-invoice DB.

CODE WALKTHROUGH -> SERVICE CALL TO SONIC & VICE VERSA.

PAGE 27
Service Call to EIM
Check for Valid Request Throw an Exception

EimMessageListener.java

Call the EIM services

EimServiceSelector.java

Get the response from the


service

Senderreciever.java

Sent back the response to


Sender

JOBS:

PAGE 28
1. ApplicationSenderJob: This job is used to create xml file starting with prefix EAA which
will be having list of einvoice which are unsent and all these details will be sent to fitek.
(Name of the O/P : tosent)
BANK -> FITEK

2. FileProcessorJob: This job will process all the files from received folder and then insert
all the file processed in process_queue table with is_processed status as 0.

3. EinvoiceProcessorJob: This job will process all the files which are in to be processed
state i.e. is_processed =0 and keep all the processed files in to_sent and sentfolder.

This job will process 3 types of file


a. Seller Contract -> SCNEW
b. Einvoice File -> EARVE
c. Feedback -> EAAV

So all the corresponding files will be picked one by one and update the data in DB
based on seller contract (soa table) , einvoice (einvoice table). After processing all the
files is_processed will be set as 1 in process_queue table.

4. EinvoicePaymentJob : This job will do the payment processing for all the invoices based
on business logic. This job will be triggered twice a day and basically checks invoices
which are available and when to pay.

5. PersonViolationJob : This job is newly created for phase 2 , it basically sends customer
details in XML starting with prefix PIEAS to FITEK.

Bank -> Fitek

NOTE:
1. EimMessageLister.java -> This class is used for listening the request from Sonic and
validates whether the requests come correctly or not.
2. EimServiceSelector.java -> Once there is no error from EimMessageListener.java , this
class will call the appropriate services requested and accordingly DB operations are
performed.

Local Link :
Active MQ : http://localhost:8161/admin/queues.jsp;jsessionid=1ac8tl0w8h0cd52vzsv3z539p
Username/Password : contact your supervisor

PAGE 29
EIM Web project : http://localhost:8080/eim
Username/Password : test/

Logs command ->sudo journalctl -b -e -f -u eim-core

Deploy command-> /deploy-emi-core.sh

Setup Docker plugin in Intellij:


Docker Command :
docker ps -a : List all the service along with the status, used to check the status of MySQL and
ActiveMQ.

GIT AND BIT BUCKET WORKFLOW:

https://confluence.luminorgroup.com/pages/viewpage.action?
spaceKey=NBDDS&title=Git+workflow

High Level Flow

1. GIRA Ticket gets Assigned


2. Checkout the code from GIT repository and create a branch with naming convention
“bugfix/JIRA ticket Number”
3. Push the code in Bit Bucket so that BIT BUCKET will be having the branch created in the
remote system.
4. Start working on the code which was checked out, once unit testing is done in local
Add the files which are modified and commit the changes in your branch with proper
comments.
5. Once Changes are committed, create a pull request via Bit Bucket and send it for
approval.
6. Approver will review the changes in the branch and give appropriate comments. Once
Approval is done
7. Go to Bit Bucket and Merge the code to the source folder and give it for deployment.

KT LINKS:

PAGE 30
High Level Overview EIM
https://web.microsoftstream.com/video/c13f1f90-21ff-4ea2-8f9a-27fab8f1abff

EIM Agenda & KT


https://web.microsoftstream.com/video/d2fb03d3-431e-4af6-982d-34f00af14e40

Existing Issues and Deployment


https://web.microsoftstream.com/video/3ba18fb9-33c1-40e6-bf1f-85dba9d10f32

Code Walkthrough High Level

https://web.microsoftstream.com/video/d50a984f-e583-4433-8d54-faa1a1ba36de

Basic Deployment

https://web.microsoftstream.com/video/67c92397-03cb-4161-9016-f25b7ae54f49

Active MQ link Set up

https://web.microsoftstream.com/video/ab6e4b50-7e56-4a23-89e1-2970ea689b0b

https://web.microsoftstream.com/video/04a08c94-0a58-473c-bc68-418e0222ffcc

EIM Overview

https://web.microsoftstream.com/video/e91d4ffe-c31a-4036-a8a8-e854dc65e086

Jobs:

https://web.microsoftstream.com/video/f3a1b57a-f11f-46c4-90d9-c74c28090adb

PAGE 31

You might also like