Wednesday, 31 May 2017

Dell Boomi: Update Flat File/CSV data using groovy script

Update data of CSV file using Groovy

In this blog i am trying to share my experience of updating csv data using groovy scripts. I had an explicit requirement that i have to remove leading zeros from a integrer data field before passing it to my map.

As you all work on Dell Boomi so you know that in Boomi there are so many built in Strings function which can do this task very easily or you can use a simple javascript code to achieve this functionality.

Javascript code:

Output = Input.replace(/^0+/, '') ;


I have to do this by groovy because in the data process you can only use groovy script and i have to remove leading zeros before passing it to map function.

Sample file:

test-trstevens113@msn.com,Test User,0000100098,8797784047620,trstevenstest@msn.com,,,0,2016-01-18 11:36:32.847,0000123652
test-tstevens@lves.washk12.org,Test2 User,0000100098,87976289823652,tstevens222@lves.washk12.org,,,0,2016-01-18 11:35:45.327,000012352


Note:
I have to remove leading zeros from column 3 that is "0000100098" but in code below i use 2 as this is indexed with zero.

Code of Groovy:

import java.util.Properties;
import java.io.InputStream;
import java.io.BufferedReader;


String DELIMITER = ",";

for( int i = 0; i < dataContext.getDataCount(); i++ ) {

   InputStream is = dataContext.getStream(i);
   Properties props = dataContext.getProperties(i);

   BufferedReader reader = new BufferedReader(new InputStreamReader(is));
   StringBuffer outData = new StringBuffer();
   int lineNum = 0;
      
   while ((line = reader.readLine()) != null) {
// Parse the line into separate columns splitting on the delimiter defined above
String[] columns = line.split(DELIMITER);

         // Obtain a column's value by its known position on the line (zero-indexed)
String someColumnValue = columns[2];

columns[2] = someColumnValue.replaceFirst("^0+(?!\$)", "");
for(int k = 0; k < columns.length; k++){
outData = outData.append(columns[k]+DELIMITER);

//outData.append('\n');
}
    
      lineNum++;
   }
   
   // Convert the output StringBuffer to an InputStream and store in the dataContext
   is = new ByteArrayInputStream(outData.toString().getBytes("UTF-8"));
   dataContext.storeStream(is, props);
   
}

Hope this helps you. Happy Coding !!!

Friday, 26 May 2017

Apex: Dynamic Scheduling of batch job for quarters from VF page

Schedule Batch job for Quarters from Visualforce Page:

Few days back i get chance to work for a client requirement to give ability to schedule a batch job quarterly from a visualforce page. As you all know that you can not even schedule a batch job quarterly from salesforce UI.


In order to schedule a job on quarterly manner I have to first calculate the dates and time input by your user. I am illustrating my requirements here with screen shots.
  • A picklist to select frequency
  • A picklist to select date option
  • A picklist to select date operator
  • A text box to enter  number of days
  • A picklist for start time




Controller Class Code:


  • First of all calculate first/end of quarter

/************************************GetFirstOfQuarterMonth****************************/
    public Integer GetFirstOfQuarterMonth(){
       
        if(date.today().month() ==1 || date.today().month() ==2 || date.today().month() ==3)
            return 1;
        else if(date.today().month() ==4 ||date.today().month() ==5 || date.today().month() ==6)
            return 4;
        else if(date.today().month() ==7 || date.today().month() ==8 || date.today().month() ==9)
            return 7;
        else
            return 10;
    }
/************************************GetEndOfQuarterMonth****************************/
    public Integer GetEndOfQuarterMonth(){
       
        if(date.today().month() ==1 || date.today().month() ==2 || date.today().month() ==3)
            return 3;
        else if(date.today().month() ==4 ||date.today().month() ==5 || date.today().month() ==6)
            return 6;
        else if(date.today().month() ==7 || date.today().month() ==8 || date.today().month() ==9)
            return 9;
        else
            return 12;
    }


  • Validate Frequency Number


/****************IsValidFrequencyNo***************************/
    public Boolean IsValidFrequencyNo(String Value){
        Boolean flag = false;
        if(Value != null) {
            String CalRegex = '^(?:[1-9]{1}|4[0-6]|2[0-9]|3[0-9]|1[0-9])$';
            Pattern CalPattern    = Pattern.compile(CalRegex);
            Matcher CalMatcher    = CalPattern.matcher(Value.trim());
            flag                    =  CalMatcher.matches();
        }
        return flag;
    }

  • Calculate Cron string

if(SelectedRenewalFrequency == Constants.QUARTERLY){
            String QuarterDate = '';
            
            if(SelectedRenewalFreqDatePeriod == Constants.FIRSTOFQUARTER_VALUE){
                
                if(!String.IsBlank(SelectedRenewalFreqValue) && !String.IsBlank(SelectedRenewalFreqDateOperator)){
                    Integer FOQMonth = GetFirstOfQuarterMonth();//Getting quarter month
                    date startOfQuarter=Date.valueof(Date.today().year()+'-' + FOQMonth +'-1');//Getting start of quarter
                    String AllMonth = '';
                    if(SelectedRenewalFreqDateOperator == Constants.PLUS){
                        if(startOfQuarter.adddays(integer.valueOf(SelectedRenewalFreqValue)) < date.today())
                    startOfQuarter = date.valueOf(startOfQuarter.addMonths(3));
                        QuarterDate = string.valueOf(startOfQuarter.adddays(integer.valueOf(SelectedRenewalFreqValue)).day());
                        Integer MonthNo = Integer.valueOf(startOfQuarter.adddays(integer.valueOf(SelectedRenewalFreqValue)).month()) - FOQMonth;
                        Integer TwelvethMonth = 10+MonthNo; 
                        if(TwelvethMonth >12)
                            TwelvethMonth = MonthNo;
                        AllMonth = String.valueOf(1+MonthNo)+','+String.valueOf(4+MonthNo)+','+String.valueOf(7+MonthNo)+','+String.valueOf(TwelvethMonth);
                    }
                    else{
                    if(startOfQuarter.adddays(integer.valueOf('-'+SelectedRenewalFreqValue)) < date.today())
                    startOfQuarter = date.valueOf(startOfQuarter.addMonths(3));
                        QuarterDate = string.valueOf(startOfQuarter.adddays(integer.valueOf('-'+SelectedRenewalFreqValue)).day());
                        Integer MonthNo = Integer.valueOf(startOfQuarter.adddays(integer.valueOf('-'+SelectedRenewalFreqValue)).month()) - FOQMonth;
                        Integer FirstMonth = 1+MonthNo;
                        if(FirstMonth == 0)
                        FirstMonth = 12;
                        if(String.valueOf(FirstMonth).contains('-')){
                            if(FirstMonth == -1)
                                FirstMonth = 12;
                            else
                                FirstMonth = 11;
                        }
                        Integer TwelvethMonth = 10+MonthNo; 
                        if(TwelvethMonth >12)
                            TwelvethMonth = MonthNo;
                        AllMonth = String.valueOf(FirstMonth)+','+String.valueOf(4+MonthNo)+','+String.valueOf(7+MonthNo)+','+String.valueOf(TwelvethMonth);
                        if(FirstMonth == 12)
                        AllMonth = String.valueOf(4+MonthNo)+','+String.valueOf(7+MonthNo)+','+String.valueOf(TwelvethMonth)+ ','+String.valueOf(FirstMonth);
                    }
                    sch = '0 0 '+ Schdtime+ ' ' + QuarterDate + ' '+ AllMonth + ' ? *';
                }
                else
                    sch = '0 0 ' + Schdtime + ' 1 1,4,7,10 ? *';
            }
            else{
                if(!String.IsBlank(SelectedRenewalFreqValue)&& !String.IsBlank(SelectedRenewalFreqDateOperator)){
                    Integer EOQMonth = GetEndOfQuarterMonth();//Getting quarter month
                    //Getting start of quarter
                    date endOfQuarter=Date.valueof(Date.today().year()+'-' + EOQMonth +'-' + Date.daysInMonth(Date.today().year(), EOQMonth) );
                    if(SelectedRenewalFreqDateOperator == Constants.PLUS){
                    if(endOfQuarter.adddays(integer.valueOf(SelectedRenewalFreqValue)) < date.today())
                    endOfQuarter = date.valueOf(endOfQuarter.addMonths(3));
                        QuarterDate = string.valueOf(endOfQuarter.adddays(integer.valueOf(SelectedRenewalFreqValue)).day());
                        Integer MonthNo = Integer.valueOf(endOfQuarter.adddays(integer.valueOf(SelectedRenewalFreqValue)).month()) - EOQMonth;
                        Integer TwelvethMonth = 12+MonthNo; 
                        if(TwelvethMonth >12)
                            TwelvethMonth = MonthNo;
                        String AllMonth = String.valueOf(3+MonthNo)+','+String.valueOf(6+MonthNo)+','+String.valueOf(9+MonthNo)+','+String.valueOf(TwelvethMonth);
                        sch = '0 0 '+ Schdtime+ ' ' + QuarterDate + ' '+ AllMonth + ' ? *';
                    }
                    else{
                    if(endOfQuarter.adddays(integer.valueOf('-'+SelectedRenewalFreqValue)) < date.today())
                    endOfQuarter = date.valueOf(endOfQuarter.addMonths(3));
                        Integer MonthNo = Integer.valueOf(endOfQuarter.adddays(integer.valueOf('-'+SelectedRenewalFreqValue)).month()) - EOQMonth;
                        Integer TwelvethMonth = 12+MonthNo; 
                        if(TwelvethMonth >12)
                            TwelvethMonth = MonthNo;
                        String AllMonth = String.valueOf(3+MonthNo)+','+String.valueOf(6+MonthNo)+','+String.valueOf(9+MonthNo)+','+String.valueOf(TwelvethMonth);
                        QuarterDate = string.valueOf(endOfQuarter.adddays(integer.valueOf('-'+SelectedRenewalFreqValue)).day());
                        sch = '0 0 '+ Schdtime+ ' ' + QuarterDate + ' '+ AllMonth + ' ? *';
                    }
                }
                else{
                    sch = '0 0 '+ Schdtime +' 30 6,9 ? *';
                    
                }
            }
        }

  • Schedule job
public string JobSchedular(){
string sch = GetCronStringForSchedule();
      string  jobID = system.schedule(BATCH_JOB_NAME, sch, batchjob);
return jobID;
}

Note: Constants is a separate class i have created to keep all my constants at one place and can be used in all classes.

VF page Code:

<apex:selectList label="Date Option" multiselect="false" size="1" id="RenewalFrequencyQuartely" value="{!SelectedRenewalFreqDatePeriod}"
                    rendered="{!IF(SelectedRenewalFrequency == 'Quarterly',true,false)}" disabled="{!IsDisabled}">
                    <apex:selectOptions value="{!FrequencyDatePeriod}"/>
                       <apex:actionSupport event="onchange"  action="{!RenewalFrequencyDatePeriodOnChange}" reRender="pbs10" status="theStatus"/>
                </apex:selectList>
                
                <apex:selectList label="Date Operator" multiselect="false" size="1" id="RenewalFrequencyDateOperator"  value="{!SelectedRenewalFreqDateOperator}"
                    rendered="{!IF(SelectedRenewalFrequency == 'Quarterly',true,false)}" disabled="{!IsDisabled}">
                    <apex:selectOptions value="{!DateOperator}"/>
                </apex:selectList>
                
                <apex:selectList label="Day Of Month" multiselect="false" size="1" id="RenewalFrequencyDayOfMonth"  value="{!SelectedRenewalFreqValue}"
                    rendered="{!IF(SelectedRenewalFrequency == 'Monthly',true,false)}" disabled="{!IsDisabled}">
                    <apex:selectOptions value="{!ListNoOfDayInMonth}"/>
                </apex:selectList>
                
                <apex:inputText label="No. of Days" value="{!SelectedRenewalFreqValue}" id="RenewalFreqMonthly" title="Date can be any value"
                    rendered="{!IF(SelectedRenewalFrequency == 'Quarterly',true,false)}" disabled="{!IsDisabled}"/>
                
                
                <apex:selectList label="Time" multiselect="false" size="1" id="RenewalTime" 
                    value="{!SelectedRenewalTime}" disabled="{!IsDisabled}">
                    <apex:selectOptions value="{!FrequencyTime}"/>
                </apex:selectList>

Hope this helps you. Happy Coding !!!

Thursday, 31 March 2016

Apex: Creating CRON Expression dynamically from VF page

CRON Expression:

A command to an operating system or server for a job that is to be executed at a specified time.

CRONTrigger:

An object that contains schedule information for a schedule job.This object contain all the information related to any schedule job in your organization. Read More Here!

Visualforce Page for Dynamic CRON Creation:

The use case this page covers is when users want to schedule  a class from VF page.User have choice to set schedule date and time according to his convenience from any day of week.

We will be using Multiselect picklist to show days of weeks as user might want to schedule it for more than 1 day.



We will use single select picklist in order to capture preferred time from user.


VF Page Code:

     <apex:pageBlock id="pb4">
            <apex:pageBlockSection title="Frequency" id="pbs10" collapsible="false" 
             columns="1">
            
                <apex:selectList label="Recurs Every Week On" multiselect="true"  
                 size="5" id="FrequencyWeekly" value="{!SelectedFreqValue}">
                    <apex:selectOptions value="{!OppWeekDays}"  />
                       
                </apex:selectList>
               
                <apex:selectList label="Preferred Start Time" multiselect="false"  
                 size="1" id="Time" value="{!SelectedTime}">

                    <apex:selectOptions value="{!FrequencyTime}"/>
                </apex:selectList>
                    
                <apex:outputLabel styleclass="labelCol vfLabelColTextWrap" 
                 value="Exact time will be dependent on Job queue activity" 
                 style="text-align:left !important; font-size: 10px !important;"/>
            </apex:pageBlockSection>
            
        </apex:pageBlock>

Controller Class Code

//Defining Properties for capturing Frequency
    public String SelectedFreqValue {get;set;} 
    public string SelectedTime {get;set;}

//Defining List of selectoption
public List<selectOption> OppWeekDays{get;set;}
 public List<selectoption> FrequencyTime{get;set;}

/****************************************************getFrequencyTime**********************************/
    //get frequency time
    public List<selectOption> getFrequencyTime(){
        
        FrequencyTime = new List<selectoption>();
        
        FrequencyTime.add(new selectOption('0',Constants.CONST_TWELVE_AM));
        FrequencyTime.add(new selectOption('1',Constants.CONST_ONE_AM));
        FrequencyTime.add(new selectOption('2',Constants.CONST_TWO_AM));
        FrequencyTime.add(new selectOption('3',Constants.CONST_THREE_AM));
        FrequencyTime.add(new selectOption('4',Constants.CONST_FOUR_AM));
        FrequencyTime.add(new selectOption('5',Constants.CONST_FIVE_AM));
        FrequencyTime.add(new selectOption('6',Constants.CONST_SIX_AM));
        FrequencyTime.add(new selectOption('7',Constants.CONST_SEVEN_AM));
        FrequencyTime.add(new selectOption('8',Constants.CONST_EIGHT_AM));
        FrequencyTime.add(new selectOption('9',Constants.CONST_NINE_AM));
        FrequencyTime.add(new selectOption('10',Constants.CONST_TEN_AM));
        FrequencyTime.add(new selectOption('11',Constants.CONST_ELEVEN_AM));
        FrequencyTime.add(new selectOption('12',Constants.CONST_TWELVE_PM));
        FrequencyTime.add(new selectOption('13',Constants.CONST_ONE_PM));
        FrequencyTime.add(new selectOption('14',Constants.CONST_TWO_PM));
        FrequencyTime.add(new selectOption('15',Constants.CONST_THREE_PM));
        FrequencyTime.add(new selectOption('16',Constants.CONST_FOUR_PM));
        FrequencyTime.add(new selectOption('17',Constants.CONST_FIVE_PM));
        FrequencyTime.add(new selectOption('18',Constants.CONST_SIX_PM));
        FrequencyTime.add(new selectOption('19',Constants.CONST_SEVEN_PM));
        FrequencyTime.add(new selectOption('20',Constants.CONST_EIGHT_PM));
        FrequencyTime.add(new selectOption('21',Constants.CONST_NINE_PM));
        FrequencyTime.add(new selectOption('22',Constants.CONST_TEN_PM));
        FrequencyTime.add(new selectOption('23',Constants.CONST_ELVEN_PM));
        
        return FrequencyTime;
    }


/*************************************************getOppWeekDays****************************************/
    //get renewal opp week days list
    public List<SelectOption> getOppWeekDays(){
        
        OppWeekDays = new List<selectoption>();
        
        OppWeekDays.add(new selectOption('SUN',CONST_SUNDAY));
        OppWeekDays.add(new selectOption('MON',CONST_MONDAY));
        OppWeekDays.add(new selectOption('TUES',CONST_TUESDAY));
        OppWeekDays.add(new selectOption('WED',CONST_WEDNESDAY));
        OppWeekDays.add(new selectOption('THUR',CONST_THURSDAY));
        OppWeekDays.add(new selectOption('FRI',CONST_FRIDAY));
        OppWeekDays.add(new selectOption('SAT',CONST_SATURDAY));
        
        return OppWeekDays;
    }

Create a constant class where you can add all times you want to show on page.Like i create a 
class name "Constant" and add times from "12 AM" till "11 PM" and names of days from Sunday till Saturday.


CRON Creation Method


public string GetCronStringForSchedule(){
        Integer Schdtime = Integer.valueOf(SelectedTime);
         string sch = '';
            string a = '';
            SelectedFreqValue= SelectedFreqValue.replaceAll( '\\s+', '');
            SelectedFreqValue = SelectedFreqValue.remove(')');
            SelectedFreqValue = SelectedFreqValue.remove('(');
            List<String> ListOfValues = SelectedFreqValue.split('\\,');
            if(ListOfValues.size() >0)
                a = ListOfValues.get(0)+ '-' + ListOfValues.get(ListOfValues.size()- 1);
            else
                a = ListOfValues.get(0);
            sch = '0 0 '+ Schdtime +' ? * '+ a;
    }

public string JobSchedular(){
string sch = GetCronStringForSchedule();
      string  jobID = system.schedule(BATCH_JOB_NAME, sch, batchjob);
return jobID;
}

Save this job ID some where so you can re use it in future if you want to abort this job from page.

Hope this helps you. Happy Coding !!

Tuesday, 29 March 2016

Get relationship of an object using dynamic apex or metadata API

Dynamic List of Relations:

In below post i will share some very interesting business scenarios related to getting relations of an object dynamically in Salesforce.

When we normally talk about relations in salesforce. It will be considered in two ways with respect to an object.

  1. The object you are referencing is parent of how many objects in organization
  2. The object you are referencing is child of how many objects in your organization.
E.g: If you want to get relations of "Account" object in your org.Then what actually your requirement is? Get list of all objects which are child of "Account" object or get list of all objects which are parent(Lookup/reference on account object) of "Account".

Get Child Relationship:


In order to access child relationship of an sobject we can use getChildRelationships() method of salesforce.
This is  a built in method of "DescribeSObjectResult" class of Salesforce. You can also access record types, labels and CRUD rights of any sobject using this class methods.

Link to check more!!

Below method will take your object API name as parameter and will provide you list of selectoption of all child relationship in order to show on your VF page.

Apex Method:

public static List<SelectOption> GetObjectChildRelations(String ParentObject){
List<Selectoption> ListOfChildObjects = new List<Selectoption>();
SObjectType objObjectType = Schema.getGlobalDescribe().get('Account');
    //it gives object properties or describe results
    Schema.DescribeSObjectResult   describeresult = objObjectType.getDescribe();
    List<Schema.ChildRelationship>   lstchildrelationships =describeresult.getChildRelationships();
for(Schema.ChildRelationship relname:lstchildrelationships){
        ListOfRelatedObjects.add(new SelectOption(relname.getChildSObject(),relname.getRelationshipName()));
        System.debug('Relationshipname:'+relname.getChildSObject());                      
}
        return ListOfChildObjects ;
}

getGlobalDescrible:

Returns map of all sobject names(keys) to sobject token(values) for standard and custom object define in your organization.

Get Reference Relationship:

In order to access parent/reference relationship of an sobject we can use Reference() method of salesforce.
This is  a built in method of "DisplayType" class of Salesforce. You can check different field types using this class.

Link to check more!!

Below method will take your object API name as parameter and will provide you list of selectoption of all child relationship in order to show on your VF page.

Apex Method:

public static List<SelectOption> GetObjectRelatedRelations(String ParentObject){
    
List<Selectoption> ListOfRelatedObjects = new List<Selectoption>();
    Map<String, Schema.SObjectField> fieldsMap = new Map<String, Schema.SObjectField>();
          
    SObjectType objObjectType = Schema.getGlobalDescribe().get(ParentObject);
            
    //it gives object properties or describe results
    Schema.DescribeSObjectResult   describeresult = objObjectType.getDescribe();
    
    //Adding fields to the fieldsMap
    fieldsMap =  describeresult.fields.getMap();
// This for loop add the field api name as a key and field label as value into field list
    for(Schema.SObjectField fieldName:fieldsMap.Values()){
        
        //Add this if type is Reference then get object name else field API
        if(fieldName.getDescribe().getType() == Schema.DisplayType.Reference){
            ListOfRelatedObjects.add(new SelectOption(fieldname.getDescribe().getName(),fieldName.getDescribe().getLabel()));
            
        }
    }//end of for
    return  ListOfRelatedObjects;
}

VF Page Controller:

//Property to use on VF page
public List<selectoption> ObjectsShown {get;set;}

//Method to populate objects in select option list
public List<SelectOption> getObjectsRelation(){
ObjectsShown = new List<selectoption>();
ObjectsShown = GetObjectRelatedRelations(‘Opportunity’);
    return ObjectsShown;
}

Hope it helps to get relation objects dynamically.

Friday, 25 March 2016

Configure Salesforce for On demand Integration Using Dell Boomi


In this post I will give you example of invoking Boomi process using Apex class.

Invoke Boomi Atom

You require an End point URL to invoke your Boomi atom. Boomi atom could be a cloud atom or an on premises atom (locally deployed atom). Below example will explain how to connect with on premises atom.

Login your Boomi environment and click on "Atom Management".Navigate to "Shared Web Server Setting" and copy "Base URL" of your on premises atom along with port.


Salesforce Remote Site Setting

When ever you access any external site from Salesforce you need to add that in remote site setting. This is a security layer that force.com platform will check.
Enter base URL in remote site setting in your salesforce organization. 

Apex Class

Below example demonstrate that how we can pass some parameter to Dell Boomi interface in the form of an XML.

In my previous post we created "End point URL". 

Now we will use our end point url in apex class and call our Boomi process simply by writing below code.

Note: This is a generic XML structure.XML structure may differ on the bases of response profile you created in Boomi.

 public static HttpResponse getInfoBoomi()
    {
        // Get the Endpoint URL from custom label      
        String EndPointUrl = Endpoint URL;
        Httprequest request = new Httprequest();
        request.setmethod('POST');
        request.setTimeout(120000);

        request.setEndpoint(EndPointUrl);
        //set the request string for Boomi service connector containing Invoice No which will than pass to SAP to get the Invoice Base64 code
        string strInput = '<?xml version="1.0" encoding="UTF-8"?>' +
            '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
            '   <soapenv:Body> <setOutput xmlns="https://secure.logmeinrescue.com/API/API.asmx"> 
            '      <notifications xmlns="http://soap.sforce.com/2005/09/outbound">' +
            '         <Notification> ' +
            '               <InvoceId>' + ApexPages.currentPage().getParameters().get(ID) + '</InvoceId>' +
            '         </Notification>' +
            '      </notifications>' +
            '   </soapenv:Body>' +
            '</soapenv:Envelope>';

        //replace all & with &amp; to avoid xml encoding issue                      

        strInput = strInput.replaceAll('&', '&amp;');
        request.setBody(strInput);
        Http httprequest = new Http();
        string responseMessage;
        HttpResponse res;
        //send http request to boomi process
        res = httprequest.send(request);
        return res;


    }

By calling above mention function "getInfoBoomi" will provide you http response coming from your Boomi process.You can use built in function getbody to extract your data from response file.

HttpResponse res = getInfoBoomi();
 sData = res.getbody();

This way you can invoke your Boomi process from Salesforce. Hope this helps you !




Boomi Integration Best Practice Part 2

Continuing on my previous post Boomi Best Practice. In following post we will talk about SAP Connector of Boomi.

SAP Connector
To implement a connection to your SAP account from Dell Boomi AtomSphere, you need to copy SAP JCo drivers to the folder where atom is installed. Follow this link for the list of drivers to be copied:


  • .       Use Naming Convention
 Always use standard naming convention for integration processes. Naming convention can be like” INT-001 Account Updates from SAP”. While creating  process for Sandbox append “SANDBOX” keyword as prefix with name of process and for production process use “PROD” as prefix.

  •     Main Listner for IDOC Integration     
      Create a common Listner in order to listen all IDOC integrations. Create a single “Listen” action.
1     Use “Route” component and attach all sub processes which are using IDOC to listen data from SAP.

      Note:
     Whenever changes are need to be deployed on atom, always deploy actual process and IDOC main Listner.

  •     Data Filter on the basis of Identifier
      To filter IDOC segment on the basis of identifiers use “identifier instance”.
         1. First you have to add a qualifier in the IDOC XML profile

2. After adding qualifier, add identifier instance. Click on blue triangle sign you will have option to add identifier.

3. After clicking identifier instance you have to choose your previously added qualifier. You can also identify on the basis of occurrence.

Note: You cannot put identifier on both parent and child node.