Wednesday, 23 November 2011

BRM Interview Questions

1. Is it possible to process cash payment if the paytype in payment information of customer is set as credit card payment?
Ans - Yes it is possible to do that.

2. How is data synchronized from BRM Infranet to Pipeline for rating?
Ans - Data is synchronized by publishing events through eai_js. The payload is generated and data is sent to dm_ifw_sync process which inturn sends the data to ifw_queue. The pipeline listener module picks the data from the queue for rating purpose.

3. How to add custom attributes to invoice to display additional event data on the invoice?
Ans - The prep_invoice policy opcode can be leveraged to add the custom attribute on the invoice. However for better performance the event attribute can be set in pipeline rating process through an iscript. This attribute can be set in the invoice automatically by enabling the usage/pipeline event in the invoice.

4. What are the different modes of invoice generation and where is the information stored?
Ans - The different modes of invoice generation is summary/detail invoice. This information is stored in the field INV_TYPE of the payinfo object. Value 0 (Detail) and 1 (Summary)

5. What are the different opcodes called during customer creation in BRM?
Ans - The PCM_OP_CUST_COMMIT_CUSTOMER calls certain opcodes in sequence to create the same. PCM_OP_CUST_PREP_CUSTOMER which validated the customer data. After this PCM_OP_CUST_CREATE_CUSTOMER is called to create acctinfo, payinfo, billinfo data to create an account.

6. What are the different status of bill items in BRM and what is the significance of status field?
Ans -There are 3 values of "status" field of bill items - 1 (Pending), 2 (Open), 4 (Closed). Item status Pending is for unbilled items, Open is for billed items but not yet paid and Closed status is for items for which due amount is paid.

Saturday, 16 April 2011

Frequently Used Macros in FM Opcodes

BRM provides certain functions to perform object manipulation operations. These functions are defined as macros which are widely used in opcodes to access BRM database and modify objects in BRM.
1. POID Management Macros (POID is a special datatype of BRM which identifies a unique object in database. Each object is defined as a storable class and has a unique POID. For example /account )

PIN_POID_GET_TYPE – This macro returns the poid object type for the poid object
PIN_POID_FROM_STR – Function to convert string value to poid value
PIN_POID_GET_ID – It gives the unique id from a poid value

2. FLIST Management Macros (All the opcodes performing business logic understand the flist data type as input. The flist is a the list of field value pairs of attributes for input/output to an opcode)-

PIN_FLIST_ELEM_GET – It fetches an ARRAY element from the flist
PIN_FLIST_ELEM_SET – This macro adds an array element into an input flist
PIN_FLIST_FLD_GET, PIN_FLIST_FLD_SET As name suggests, these two macros gets and sets a field from/to an flist
 
PIN_FLIST_COPY - This macro can be used to copy field from one flist to other. Instead of doing PIN_FLIST_FLD_GET and then PIN_FLIST_FLD_SET, directly PIN_FLIST_COPY can be used.

3. Error Management and Logging Macros (All the logging of information is done in the file cm.pinlog which the main log to track and troubleshoot any issue while executing an opcode)

PIN_ERR_LOG_MSG – This macro sets a string message to troubleshoot issue in the opcode. This really helps to identify the location of the file where the error is occurring.
PIN_ERR_LOG_FLIST – This macro is to print flist in the log file (cm.pinlog). This is to debug the data which is being set in the flist.
PIN_ERR_IS_ERR – This is to check if the program has encountered an error.
PIN_ERR_SET_ERR – If error is encountered this opcode sets the error with proper error message logging.

4. POID/FLIST Creation Macros (POID/Flist needs to be created in order to generate the input data for the opcode)
PIN_POID_CREATE, PIN_FLIST_CREATE – As name suggests these macros helps in creation of poid and flist objects.
Note – After the execution of the opcode, the newly created flist objects must be destroyed in order to free unused memory space. If they are not killed it may lead to memory leak issues. PIN_FLIST_DESTROY_EX is the macro to delete the data of an flist and set the reference of the flist object to null.
 
5. There are different set of macros for decimal data type manipulations. For example for decimal addition operation there is a macro "pbo_decimal_add_assign" , other decimal macros are starting with pbo_decimal*.