Commit 894548fd authored by Francesco Corti's avatar Francesco Corti

Changes for MALFD-61.

parent 95180e5a
......@@ -12,6 +12,7 @@ import com.activiti.testutils.resources.AlfrescoResourceProperties;
import com.activiti.testutils.resources.MyAlfrescoComDecommissionResourceProperties;
import com.activiti.testutils.resources.ProcessUtil;
import com.activiti.testutils.resources.RestUtil;
import com.activiti.testutils.resources.SpreadsheetUtil;
public class BulkExportJavaDelegate implements JavaDelegate {
......@@ -23,22 +24,32 @@ public class BulkExportJavaDelegate implements JavaDelegate {
@Override
public void execute(DelegateExecution execution) throws Exception {
logger.info("Getting the 'alfrescoTenant' variable.");
String alfrescoTenant = (String) execution.getVariable(ProcessUtil.MY_ALFRESCO_COM_TENANT_VARIABLE);
logger.info("'alfrescoTenant'='" + alfrescoTenant + "'.");
logger.info("Getting myAlfrescoComDecommissionResourceProperties.");
myAlfrescoComDecommissionResourceProperties = new MyAlfrescoComDecommissionResourceProperties();
myAlfrescoComDecommissionResourceProperties.load();
logger.info("Getting alfrescoResourceProperties.");
alfrescoResourceProperties = new AlfrescoResourceProperties();
alfrescoResourceProperties.load();
/* This source code will be reviewed in ticket MALFD-56
createFolder(myAlfrescoComDecommissionResourceProperties.getProperty(MyAlfrescoComDecommissionResourceProperties.ARCHIVE_PATH));
String alfrescoExportPath = myAlfrescoComDecommissionResourceProperties.getProperty(MyAlfrescoComDecommissionResourceProperties.ARCHIVE_PATH) + File.separator + alfrescoTenant;
String alfrescoUUID = getAlfrescoUUID(alfrescoTenant);
getArchive(alfrescoUUID, alfrescoExportPath);
*/
String alfrescoExportPath = "TEST";
logger.info("Setting the variable '" + ProcessUtil.MY_ALFRESCO_COM_EXPORT_PATH_VARIABLE + "'='" + alfrescoExportPath + "'.");
execution.setVariable(ProcessUtil.MY_ALFRESCO_COM_EXPORT_PATH_VARIABLE, alfrescoExportPath);
logger.info("'BulkExportJavaDelegate' completed.");
}
private void createFolder(String path) throws Exception {
......
......@@ -30,34 +30,56 @@ public class SalesforceInquiryJavaDelegate implements JavaDelegate {
@Override
public void execute(DelegateExecution execution) throws Exception {
logger.info("Getting the 'salesforceId' variable.");
String salesforceId = (String) execution.getVariable(ProcessUtil.SALESFORCE_CUSTOMER_ID_VARIABLE);
logger.info("'salesforceId'='" + salesforceId + "'.");
logger.info("Getting myAlfrescoComDecommissionResourceProperties.");
myAlfrescoComDecommissionResourceProperties = new MyAlfrescoComDecommissionResourceProperties();
myAlfrescoComDecommissionResourceProperties.load();
logger.info("Getting the SalesForce spreadsheet.");
Sheet sheet = SpreadsheetUtil.getSheet(new File(getClass().getClassLoader().getResource(myAlfrescoComDecommissionResourceProperties.getProperty(MyAlfrescoComDecommissionResourceProperties.SALESFORCE_SPREADSHEET_FILE_NAME)).getFile()), SpreadsheetUtil.SALESFORCE_SHEET_NUMBER);
logger.info("Getting the row with column '" + SpreadsheetUtil.SALESFORCE_CUSTOMER_ID_COLUMN_DESCRIPTION + "'='" + salesforceId + "'.");
Row customerRow = SpreadsheetUtil.getUniqueRow(sheet, SpreadsheetUtil.SALESFORCE_CUSTOMER_ID_COLUMN_DESCRIPTION, salesforceId);
logger.info("Getting the column index with description '" + SpreadsheetUtil.CUSTOMER_TENANT_COLUMN_DESCRIPTION + "'.");
int columnIndex = SpreadsheetUtil.getColumnIndex(sheet, SpreadsheetUtil.CUSTOMER_TENANT_COLUMN_DESCRIPTION);
logger.info("Setting the variable '" + ProcessUtil.MY_ALFRESCO_COM_TENANT_VARIABLE + "'='" + SpreadsheetUtil.getStringValue(customerRow.getCell(columnIndex)) + "'.");
execution.setVariable(ProcessUtil.MY_ALFRESCO_COM_TENANT_VARIABLE, SpreadsheetUtil.getStringValue(customerRow.getCell(columnIndex)));
logger.info("Getting the column index with description '" + SpreadsheetUtil.CUSTOMER_TYPE_COLUMN_DESCRIPTION + "'.");
columnIndex = SpreadsheetUtil.getColumnIndex(sheet, SpreadsheetUtil.CUSTOMER_TYPE_COLUMN_DESCRIPTION);
logger.info("Setting the variable '" + ProcessUtil.CUSTOMER_TYPE_VARIABLE + "'='" + SpreadsheetUtil.getStringValue(customerRow.getCell(columnIndex)) + "'.");
execution.setVariable(ProcessUtil.CUSTOMER_TYPE_VARIABLE, SpreadsheetUtil.getStringValue(customerRow.getCell(columnIndex)));
logger.info("Getting the column index with description '" + SpreadsheetUtil.CUSTOMER_GB_COLUMN_DESCRIPTION + "'.");
columnIndex = SpreadsheetUtil.getColumnIndex(sheet, SpreadsheetUtil.CUSTOMER_GB_COLUMN_DESCRIPTION);
logger.info("Setting the variable '" + ProcessUtil.MY_ALFRESCO_COM_GB_VARIABLE + "'='" + SpreadsheetUtil.getNumericValue(customerRow.getCell(columnIndex)) + "'.");
execution.setVariable(ProcessUtil.MY_ALFRESCO_COM_GB_VARIABLE, SpreadsheetUtil.getNumericValue(customerRow.getCell(columnIndex)));
logger.info("Getting the column index with description '" + SpreadsheetUtil.FREE_COMMENT_COLUMN_DESCRIPTION + "'.");
columnIndex = SpreadsheetUtil.getColumnIndex(sheet, SpreadsheetUtil.FREE_COMMENT_COLUMN_DESCRIPTION);
logger.info("Setting the variable '" + ProcessUtil.OFF_BOARDING_COMMENT_VARIABLE + "'='" + SpreadsheetUtil.getStringValue(customerRow.getCell(columnIndex)) + "'.");
execution.setVariable(ProcessUtil.OFF_BOARDING_COMMENT_VARIABLE, SpreadsheetUtil.getStringValue(customerRow.getCell(columnIndex)));
logger.info("Getting the column index with description '" + SpreadsheetUtil.OFFBOARDING_COLUMN_DESCRIPTION + "'.");
columnIndex = SpreadsheetUtil.getColumnIndex(sheet, SpreadsheetUtil.OFFBOARDING_COLUMN_DESCRIPTION);
logger.info("Setting the variable '" + ProcessUtil.OFF_BOARDING_DESCRIPTION_VARIABLE + "'='" + SpreadsheetUtil.getStringValue(customerRow.getCell(columnIndex)) + "'.");
execution.setVariable(ProcessUtil.OFF_BOARDING_DESCRIPTION_VARIABLE, SpreadsheetUtil.getStringValue(customerRow.getCell(columnIndex)));
logger.info("Getting the column index with description '" + SpreadsheetUtil.OFFBOARDING_PATH_COLUMN_DESCRIPTION + "'.");
columnIndex = SpreadsheetUtil.getColumnIndex(sheet, SpreadsheetUtil.OFFBOARDING_PATH_COLUMN_DESCRIPTION);
logger.info("Setting the variable '" + ProcessUtil.OFF_BOARDING_PATH_VARIABLE + "'='" + SpreadsheetUtil.getStringValue(customerRow.getCell(columnIndex)) + "'.");
execution.setVariable(ProcessUtil.OFF_BOARDING_PATH_VARIABLE, SpreadsheetUtil.getStringValue(customerRow.getCell(columnIndex)).substring("Path ".length()));
logger.info("Getting the column index with description '" + SpreadsheetUtil.SALESFORCE_CSM_COLUMN_DESCRIPTION + "'.");
columnIndex = SpreadsheetUtil.getColumnIndex(sheet, SpreadsheetUtil.SALESFORCE_CSM_COLUMN_DESCRIPTION);
logger.info("Setting the variable '" + ProcessUtil.CSM_ASSIGNEE + "'='" + SpreadsheetUtil.getStringValue(customerRow.getCell(columnIndex)) + "'.");
execution.setVariable(ProcessUtil.CSM_ASSIGNEE, getUserId(SpreadsheetUtil.getStringValue(customerRow.getCell(columnIndex))));
logger.info("'SalesforceInquiryJavaDelegate' completed.");
}
private String getUserId(String email) throws Exception {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment