0% found this document useful (0 votes)
4 views4 pages

Module Source Code Commit For Review Steps

This document outlines the steps to extract delta CPF and implement Groovy code for testing within a Passport environment. It includes detailed instructions for extracting files, configuring local paths, executing commands, and managing Git branches for code changes. The final step involves creating a pull request for code review after committing changes to a feature branch.

Uploaded by

ramescool22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views4 pages

Module Source Code Commit For Review Steps

This document outlines the steps to extract delta CPF and implement Groovy code for testing within a Passport environment. It includes detailed instructions for extracting files, configuring local paths, executing commands, and managing Git branches for code changes. The final step involves creating a pull request for code review after committing changes to a feature branch.

Uploaded by

ramescool22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

PULL REQUEST DOCUMENT

Step 1:

Extract delta cpf

Step 2:

Add extract.groovy code as test command to Passport (code below)

import java.io.*;

import org.codehaus.groovy.runtime.*;

def writeFileString = { message, file ->

def out = new OutputStreamWriter(new FileOutputStream(file.path), 'UTF-8');

try {

out.write(message);

finally {

out.close();

return file;

extractFile = { path, target, type, ext, fileName, name, attributes ->

def file = new File(path + "\\" + fileName);

def records = new XmlSlurper().parse(file);

def aName = records.getProperty(name).toString().replaceAll("/","_").replaceAll("\\\\",


"_").replaceAll("\\?","_").replaceAll(":","_").replaceAll("\\
*","_").replaceAll("\"","_").replaceAll("<","_").replaceAll(">","_").replaceAll("\\|","_");

def fName = fileName.replace(".xml","");

attributes.each() { attribute ->


def targetFile = new File(target + "${fName}_${attribute}$ext");

targetFile.parentFile.mkdirs();

writeFileString(records.getProperty(attribute), targetFile);

extractFiles = { path, ext, type, name, attributes ->

def dir = new File(path + "/${type}")

dir.list().each() { if (it.endsWith('.xml')) extractFile(dir.path, dir.path + '/source/', type,


ext,it,name,attributes); } ;

def unzipFolder= new File("C:\\work\\projects\\git\\sourcecode\\legalcollaborator\\snapshot-


Default\\");

extractFiles(unzipFolder.path, ".groovy", "GroovyClassDefinition", 'name',['classDefinition']);

extractFiles(unzipFolder.path, ".groovy", "GroovyCommandDefinition", 'name',


['scriptDefinition']);

extractFiles(unzipFolder.path, ".groovy", "GroovyFilter", 'name',


['conditionalFilterScript','dataFilterScript']);

extractFiles(unzipFolder.path, ".drl", "RuleDefinition", 'ruleName',


['whenClause','thenClause','importStatements']);

Step 3:

Line no: 36 : configure the path as in your local


def unzipFolder= new File("C:\\work\\projects\\git\\sourcecode\\passport-msm-modules\\third-party-
direct-pay\\source-code\\default\\Step 37 - TPP_InvoiceHistory\\package");

Note: Place the path till inside the package folder path

Example: C:\Users\S.Bhuvanasundaram\Documents\Cards\Third party Pay\ELM 117\code\Step 37 -


TPP_InvoiceHistory\package

Step 4:

Execute the groovy command and check source folder are created with *.groovy files

Step 5:

Clone master branch for your respective module by using this below command

git clone -c core.longpaths=true <repository-url>

Repo : https://bitbucket.wolterskluwer.io/projects/PMM/repos/
Step 6: Create a feature branch

Step 7: Commit your delta changes to the feature branch

Step 8: Create Pull Request for code review and package changes

You might also like