pcm_op() - cassiobj/PCM-Python_lib GitHub Wiki

Table of Contents

pcm_op Function

The pcm_op function is part of a Python extension for Oracle BRM. It executes opcodes of the Oracle BRM system.

Description

The pcm_op function executes opcodes of the Oracle BRM system.

Parameters

  • opcode: The opcode to be executed.
  • in_flist: The input flist for the opcode.
  • flag: The flag for the opcode.

Return Value

The function returns an XML string containing the result of executing the opcode.

In case of an error, the `error` exception is raised.

Usage

You can use the pcm_op function in your Python scripts to execute opcodes of the Oracle BRM system. Here is an example code:

Using string flist

import PCMPy

# Define parameters
opcode = PCMPy.PCM_OP_READ_OBJ
in_flist = "0 PIN_FLD_POID       POID [0] 0.0.0.1 /invoice 226060 0"
flag = PCMPy.PCM_OPFLG_NO_DESCEND

try:
    result = PCMPy.pcm_op(opcode, in_flist, flag)
    print("Result:", result)
except PCMPy.error as e:
    print("An error occurred:", str(e))
Using array flist
import PCMPy

data = {
    "PIN_FLD_POID": "0.0.0.1 /dd/fields -1 0",       
    "PIN_FLD_FIELD": [
        {
            "PIN_FLD_FIELD_NAME": "PIN_FLD_DUE_T",
            "PIN_FLD_FIELD_NUM": 0
        }
    ]
}


try:
    result = PCMPy.pcm_op(PCMPy.PCM_OP_SDK_GET_FLD_SPECS, data, 0)
    print("Result:", result)
except PCMPy.error as e:
    print("An error occurred:", str(e))

Example of return XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
        <PIN_FLD_POID>0.0.0.1 /invoice 226060 10</PIN_FLD_POID>
        <PIN_FLD_CREATED_T>1752487408</PIN_FLD_CREATED_T>
        <PIN_FLD_MOD_T>1754194071</PIN_FLD_MOD_T>
        <PIN_FLD_READ_ACCESS>L</PIN_FLD_READ_ACCESS>
        <PIN_FLD_WRITE_ACCESS>L</PIN_FLD_WRITE_ACCESS>
        <PIN_FLD_ACCOUNT_OBJ>0.0.0.1 /account 159593 105</PIN_FLD_ACCOUNT_OBJ>
        <PIN_FLD_BILLINFO_OBJ>0.0.0.1 /billinfo 156905 213</PIN_FLD_BILLINFO_OBJ>
        <PIN_FLD_BILL_DATE_T>1748750400</PIN_FLD_BILL_DATE_T>
        <PIN_FLD_BILL_NO>B1-122</PIN_FLD_BILL_NO>
        <PIN_FLD_BILL_OBJ>0.0.0.1 /bill 190885 5</PIN_FLD_BILL_OBJ>
        <PIN_FLD_CHECK_SPLIT_FLAGS>0</PIN_FLD_CHECK_SPLIT_FLAGS>
        <PIN_FLD_HEADER_NUM>0</PIN_FLD_HEADER_NUM>
        <PIN_FLD_HEADER_STR></PIN_FLD_HEADER_STR>
        <PIN_FLD_INV_FLAGS>1</PIN_FLD_INV_FLAGS>
        <PIN_FLD_REPORT_NAME></PIN_FLD_REPORT_NAME>
        <PIN_FLD_STATUS>0</PIN_FLD_STATUS>
        <PIN_FLD_TEMPLATE_NAME></PIN_FLD_TEMPLATE_NAME>
</root>
⚠️ **GitHub.com Fallback** ⚠️