使用Oracle JDE接口构建优化工作流程(oracle jde接口)
使用Oracle JDE接口构建优化工作流程
随着企业业务的不断扩张,工作流程也日益复杂,如何快速高效地处理这些业务,成为各企业管理者需要解决的问题。Oracle JDE作为业界领先的ERP软件,提供了丰富的接口和工具,可以帮助企业快速构建优化的工作流程。本文将介绍如何使用Oracle JDE接口构建优化工作流程,并给出相关代码示例。
一、需求分析
假设一个企业需要开展采购业务,采购流程如下:
1. 采购员提交采购订单
2. 供应商接受订单并提供报价
3. 采购员审核报价,确定供应商
4. 采购员下单并安排付款
为了优化采购流程,我们希望在Oracle JDE系统中实现如下功能:
1. 采购员可在Oracle JDE系统中提交采购订单
2. 供应商可在Oracle JDE系统中接受订单并提供报价
3. 采购员可在Oracle JDE系统中审核报价,并在系统中指定供应商
4. 采购员可在Oracle JDE系统中下单并安排付款
5. 系统应具备自动化审核和提醒功能,提高效率
二、方案设计
根据需求分析,我们可采取以下方案:
1. 使用Oracle JDE的Business Service组件,实现采购员提交采购订单、供应商接受订单并提供报价、采购员审核报价、采购员下单,并安排付款等功能。
2. 针对采购订单的审核和提醒功能,可通过Oracle JDE的Workflow Builder组件来实现。
3. 使用Oracle JDE中的逻辑控制语言Event Rule来实现各功能之间的联动和控制。
三、代码实现
1. 采购员提交采购订单——使用BSFN Component
– 首先定义相关业务服务:
BSFNName:POCreateRequisition
BSFNDescription:Create Requisition Information
BSFNParameters:
IN: cCompany - String - Company (30)
IN: cUsername - String - User Name (30)
IN: cAddressBookNumber - String - Address Book Number (37)
IN: mnDocumentNumber - Numeric - Document Number (6,0)
IN: mnLineType - Numeric - Line Type (3,0)
IN: mcUOM - String - Unit of Measure (2)
IN: mcChgUOM - String - Change UOM (2)
IN: mnQuantity - Numeric - Quantity (19,15)
IN: mnAmount - Numeric - Amount (19,7)
IN: cBusinessUnit - String - Business Unit (12)
IN: cCostCenter - String - Cost Center (12)
IN: cProjNum - String - Project Number (20)
IN: cjrnl - String - Journal (3)
IN: Slitm - String - Stocking Type (3)
IN: cOID - String - Group ID (8)
OUT: sWarningText - String - Warning Text (100)
OUT: mnDocRequest - Numeric - Doc Request (15,0)
OUT: sReturn - String - Return Value (100)
OUT: sErrorID - String - Error ID (50)
OUT: sErrorDescription - String - Error Description (100)
OUT: mnErrorLevel - Numeric - Error Level (3,0)
– 然后编写业务逻辑如下:
if (NULL(cCompany)) throwError(businessServiceError, 0, "Company cannot be Null");
if (NULL(cUsername)) throwError(businessServiceError, 0, "User Name cannot be Null");
if (NULL(cAddressBookNumber)) throwError(businessServiceError, 0, "Address Book Number cannot be Null");
if (mnDocumentNumber ILT 1) throwError(businessServiceError, 0, "Document Number cannot be less than 1");
if (mnLineType ILT 1) throwError(businessServiceError, 0, "Line Type cannot be less than 1");
if (mnQuantity ILT 1) throwError(businessServiceError, 0, "Quantity cannot be less than 1");
if (mnAmount ILT 1) throwError(businessServiceError, 0, "Amount cannot be less than 1");
if (NULL(cBusinessUnit)) throwError(businessServiceError, 0, "Business Unit cannot be Null");
if (NULL(cCostCenter)) throwError(businessServiceError, 0, "Cost Center cannot be Null");
if (NULL(cjrnl)) throwError(businessServiceError, 0, "Journal cannot be Null");
if (NULL(Slitm)) throwError(businessServiceError, 0, "Stocking Type cannot be Null");
//通过Requisition Master Table检查重复性
mnDocRequest = P00095UniqueKeyGeneration(cCompany,"31",strcat("PR", cUsername),1);
while (POGetNextRequisition(mnDocRequest)) {
mnDocRequest = P00095UniqueKeyGeneration(cCompany,"31",strcat("PR", cUsername),1);
}
//向Requisition Master Table中插入数据
mnDocRequest = P00095UniqueKeyGeneration(cCompany,"31",strcat("PR", cUsername),1);
mnErrorLevel = P00094CreateRequisition(cCompany, mnDocRequest, cUsername, cAddressBookNumber, mnDocumentNumber, mnLineType, mcUOM, mcChgUOM, mnQuantity, mnAmount, cBusinessUnit, cCostCenter, cProjNum, cjrnl, Slitm, cOID,sWarningText);
if (mnErrorLevel 0) {
throwError(businessServiceError, mnErrorLevel, sWarningText);
sReturn = "Error: Creation of Requisition Fled.";
}
else {
sReturn = "Requisition Created Successfully! Document Request = " + string(mnDocRequest);
}
2. 供应商接受订单并提供报价——使用BSFN Component
– 首先定义相关业务服务:
BSFNName: ReceivePO
BSFNDescription: Receive PO
BSFNParameters:
IN: cCompany - String - Company (30)
IN: cUsername - String - User Name (30)
IN: cPONumber - String - PO Number (20)
IN: mnLineNumber - Numeric - Line Number (8,0)
IN: cSupplierNumber - String - Supplier Number (10)
IN: cItemNumber - String - Item Number (25)
IN: cUOM - String - UOM (3)
IN: dvQuantity - Numeric - Quantity (19,15)
IN: dvAmount - Numeric - Amount (19,7)
IN: cFulfillment - String - Fulfillment (1)
OUT: sWarningText - String - Warning Text (100)
OUT: sReturn - String - Return Value (100)
OUT: sErrorID - String - Error ID (50)
OUT: sErrorDescription - String - Error Description (100)
OUT: mnErrorLevel - Numeric - Error Level (3,0)
– 然后编写业务逻辑如下:
if (NULL(cCompany)) throwError(businessServiceError, 0, "Company cannot be Null");
if (NULL(cUsername)) throwError(businessServiceError, 0, "User Name cannot be Null");
if (NULL(cPONumber)) throwError(businessServiceError, 0, "PO Number cannot be Null");
if (mnLineNumber ILT 1) throwError(businessServiceError, 0, "Line Number cannot be less than 1");
if (NULL(cSupplierNumber)) throwError(businessServiceError, 0, "Supplier Number cannot be Null");
if (NULL(cItemNumber)) throwError(businessServiceError, 0, "Item Number cannot be Null");
if (NULL(cUOM)) throwError(businessServiceError, 0, "UOM cannot be Null");
if (dvQuantity ILT 1) throwError(businessServiceError, 0, "Quantity cannot be less than 1");
if (dvAmount ILT 1) throwError(businessServiceError, 0, "Amount cannot be less than 1");
//向Purchase Order Receiver Table中插入数据
mnErrorLevel = P43081_ReceivePO(cCompany, cUsername, cPONumber, mnLineNumber, cSupplierNumber, cItemNumber, cUOM, dvQuantity, dvAmount, cFulfillment, sWarningText);
if (mnErrorLevel 0) {
throwError(businessServiceError, mnErrorLevel, sWarningText);
sReturn = "Error: Receive PO Fled.";
}
else {
sReturn = "PO Received Successfully!";
}
3. 采购员审核报价——使用Event Rule
– 配置Request审批Node
Action Required = Approve
Group