Methods That You Can Use with Order Management Extensions
Get details about the methods that you can use with your order management extension.
Order Header Methods
Use these methods to manage data on the order header.
Method | Description |
---|---|
getOrderCopiedFrom | Get the original order that provided the source for the copied order.
For example:
|
getOrderInProcessing | Get the sales order that's currently in processing status for the
corresponding revision order. For example:
|
getOrderTotalsPrimaryRow | Get details about the primary order total. For example:
|
getOrderTotalsRowByCode | Get details about the order total. For example:
|
public boolean isCopiedOrder() |
Returns a value.
For example:
|
public boolean isFirstDraftOrder() |
Returns a value.
The word First simply means draft. Order Management doesn't have versions of drafts. There is no first draft, second draft, and so on. |
public boolean isRevisionDraftOrder() |
Returns one of:
|
Order Line Methods
Use these methods to manage data on the order line.
Method | Description |
---|---|
getItemRow | Get details about the item on the order line. For example:
|
getLineInProcessing | Get the order line that's currently in processing status for the
corresponding revision order. For example:
|
getOriginalLineForReferencedReturn | Get the original order line that the referenced return line
references. For example:
|
getOriginalOrderForReferencedReturn | Get the original order that the referenced return line references. For example:
|
public List getHolds() | Get a list of the holds that are on the order line. |
public Hold applyHold(String holdCode) |
Apply a hold on the order line. This method also returns the hold that it just added. |
public String getAttribute(String attributeName) |
Get the value of any attribute from the order line. Specify the name of the attribute in the attributeName parameter. You can also use the attributeName parameter to specify any of these entities that are in the line entity:
You can't use this method to get an extensible flexfield's value. |
public setAttribute(String attributeName, Object value) |
Set the value of an attribute on the order line:
|
public List getTransformedLines() |
Get a list of the lines that the extension transformed for the current line. A transformed line is a line that contains a free item. |
public boolean isTransformed() |
Returns one of:
|
public boolean isOpen() |
Returns one of:
|
public boolean isClosed() |
Returns one of:
|
public boolean isCanceled() |
Returns one of:
|
public boolean isNewLineInDraftOrder() |
Returns one of:
Use this method to see whether the revision has a new line that you need to process. |
public boolean isRootLine() |
Returns one of:
|
public boolean isChildLine() |
Returns one of:
|
Order Header and Order Line Methods
Use these methods to manage data on the order header or the order line.
Method | Description |
---|---|
public boolean canApplyHold(String holdCode) | See whether you can apply a hold on the order header or the order line. For example, to see whether you can apply the SHIP_ALL hold, specify SHIP_ALL in the holdCode parameter. canApplyHold returns one of:
For details, see Use Order Management Extensions to Apply Holds. |
public boolean holdExists(String holdCode) |
See whether a specific hold already exists on the order header or the order line. For example, to see whether the line is on the SHIP_ALL hold, specify SHIP_ALL in the holdCode parameter. holdExists will return one of:
|
public String getAttribute(String attributeName) |
Get the value of any attribute that you specify in the method's attributeName parameter. Specify the attribute's name or the entity name in the attributeName parameter. You can also use getAttribute to get the value of these header entities:
It can return a collection of header entities. |
public List getAttachments() | Get a list of attachments that are on the order header or order line. |
public createAttachment(Attachment attachment) | Add an attachment to the order header or order line. |
public deleteAttachment(Attachment attachment) | Delete an attachment from the order header or order line. |
public duplicateAttachments(List attachmentList) | Duplicate the attachments that are on the order header or order line. |
public Line createNewLine(CreateLineParams createLineParams) |
Add a free item. It returns the line object of the line that it just added. If you use createNewLine on the:
|
public boolean isSellingProfitCenterUserUpdated() |
Returns one of:
|
Extensible Flexfield Methods
You can use these methods when your extension references an extensible flexfield on an order header or order line.
Method | Description |
---|---|
public getOrCreateContextRow(String contextCode) |
Use this method to write a value to or to get a value from an extensible flexfield. It returns the value that's in the flexfield context. If the context doesn't already exist, then the method creates and returns a new context. Use the contextCode parameter on this method to get the flexfield context's code. If the context exists, then the method returns the context, else it creates a new one and returns it. |
public Row getContextRow(String contextCode) | Does the same thing as getOrCreateContextRow but only gets the value that the extensible flexfield currently contains. |
Address Methods
You can use these methods with address data.
- public Address(String addressLine1, String addressLine2, String addressLine3, String addressLine4, String city, String state, String postalCode, String county, String province, String country)
- public void setAddress1(String address1)
- public String getAddress1() { return mAddress1; }
- public void setAddress2(String address2)
- public String getAddress2() { return mAddress2; }
- public void setAddress3(String address3)
- public String getAddress3() { return mAddress3; }
- public void setAddress4( () {String address4; }
- public String getAddress4() { return mAddress4; }
- public void setCity(String city)
- public String getCity() { return mCity; }
- public void setPostalCode(String postalCode)
- public String getPostalCode() {return mPostalCode; }
- public void setState(String state)
- public String getState() { return mState; }
- public void setProvince(String province)
- public String getProvince() { return mProvince; }
- public void setCounty(String county)
- public String getCounty() { return mCounty; }
- public void setCountry(String country)
- public String getCountry() { return mCountry; }
Address Methods for Order Lines
The extension uses the address data that you specify in the method's parameter to find the attribute's value.
Method | Description |
---|---|
public void setShipToAddress(Address address) | Set the ship to address attribute on the order line. |
public void setBillToAddress(Address address) | Set the bill to address attribute on the order line. |
public void setSupplierAddress(Address address) | Set the supplier's address attribute on the order line. |
public void setDestinationShippingAddress(Address address) | Set the destination shipping address attribute on the order line. |
public void setFinalDischargeLocationAddress(Address address) | Set the final discharge address attribute on the order line. |
Attachment Methods
You can use these methods to manage attachments.
- public String getDatatypeCode() { return mDatatypeCode; }
- public void setDatatypeCode(String datatypeCode)
- public void setAttachedDocumentId(Long attachedDocumentId)
- public Long getAttachedDocumentId() { return mAttachedDocumentId; }
- public void setCategoryName(String mCategoryName)
- public String getCategoryName() { return mCategoryName; }
- public void setDocumentAttributes(String documentAttributes)
- public String getDocumentAttributes() { return mDocumentAttributes; }
- public void setDescription(String description)
- public String getDescription() { return mDescription; }
- public void setEntityAttributes(String entityAttributes)
- public String getEntityAttributes() { return mEntityAttributes; }
- public void setEntityName(String entityName)
- public String getEntityName() { return mEntityName; }
- public void setFileContentType(String fileContentType)
- public String getFileContentType() { return mFileContentType; }
- public void setFileName(String fileName)
- public String getFileName() { return mFileName; }
- public void setPk1Value(String pk1Value )
- public String getPk1Value() { return mPk1Value; }
- public void setTitle(String title)
- public String getTitle() { return mTitle; }
- public void setUrl(String url)
- public String getUrl() { return mUrl; }
- public BlobDomain getFileContent() { return mFileContent; }
- public void setFileContent(byte[] fileContent)
- public void setFileContent(BlobDomain fileContent) { }
- public String getText() { return mText; }
- public void setText(String text)
- public void setDocumentName(String documentId)
- public String getDocumentName() { return mDocumentId; }
- public void setDocumentIdentifier(String documentVersion)
- public String getDocumentIdentifier() { return mDocumentVersion; }
- public void setContentRepositoryFileShared(boolean contentRepositoryFileShared)
- public boolean isContentRepositoryFileShared() {return mContentRepositoryFileShared;}
Get Attachments Method
Use the getAttachments() method to get these attributes:
Entity |
Value to Use in Code |
Parent |
Read During All Events |
Write During Save or Start of Submit Request |
Write During End of Submit Request |
---|---|---|---|---|---|
Header attachment |
Not applicable |
Header |
Yes |
Yes |
Yes |
Order line attachment |
Not applicable |
Lines |
Yes |
Yes |
No |
Person Methods
- public Person(String firstName, String lastName)
- public Person(String firstName, String middleName, String lastName)
- public Person(String firstName, String lastName, String middleName, String suffix, String title)
- public void setFirstName(String firstName)
- public String getFirstName() {return mFirstName;}
- public void setLastName(String lastName)
- public String getLastName() {return mLastName;}
- public void setMiddleName(String middleName
- public String getMiddleName() {return mMiddleName; }
- public void setSuffix(String suffix)
- public String getSuffix() {return mSuffix;}
- public void setTitle(String title)
- public String getTitle() {return mTitle; }
Party Methods for Order Headers and Order Lines
The extension uses the person data that you specify in the method's parameter to find the attribute's value.
Method | Description |
---|---|
public void setShipToParty(Person person) | Set the ship to party attribute on the order line. |
public void setShipToContact(Person person) | Set the ship to contact attribute on the order line. |
public void setBillToAccount(Person person) | Set the bill to customer attribute on the order line. |
public void setBillToContact(Person person) | Set the bill to contact attribute on the order line. |
Message Method
The Message method uses a message type and message text to create a message for the sales order. It uses the ORA_MANAGE_EXTENSIONS request function to log messages, by default.
Here's the format to use to display a literal message that uses the default message category and no tokens.
Message(MessageType type, String text)
where
-
type. Type of message. You can use ERROR or WARNING.
-
text. Text of the message to display, enclosed with one set of double quotation marks ( " " ).
Here's an example warning message that includes a literal string.
Message(MessageType Message.MessageType.WARNING, String "This is the warning message.")
Here's an error message that includes a literal string.
Message(MessageType Message.MessageType.ERROR, String "This is the error message.")
Specify Message Name and Tokens
Here's the format to use to specify the message name and message token parameters.
Message(MessageType type, String name, Map<String, Object> parameters)
where
-
type. Type of message. You can use ERROR or WARNING.
-
name. Name of a message from the Manage Messages page.
Here are the values that attributes for this message must use on the Manage Messages page.
Attribute
Value
Application
Distributed Order Orchestration
Module
Distributed Order Orchestration
For details, see Set Up Messages in Order Management.
-
parameters. A map that contains message tokens and token values. The Message method uses this map to populate tokens with values. These tokens are part of the message.
Here's some example code that displays the contents of a message named DOO_CUST_RELATIONSHIP_WARNING.
Message(MessageType Message.MessageType.WARNING, String "DOO_CUST_RELATIONSHIP_WARNING", Map<String, Object> messageParams)
Create Messages for Sales Orders and Sales Order Lines
You can use the Request function, message name, and message token parameters to create a message for the sales order or the order line. The Message method will log the message with the request function that you specify.
Here's the format to use for the sales order.
Message(MessageType type, String requestFunction, String name, Map string, object msgParams)
Here's the format to use for the order line.
Message(MessageType type, String requestFunction, Object line, String name, Map string, object msgParams)
where
-
Object line. Identifies the order line to reference when logging the message.
For details about the other parameters, see the Map Tokens for the Message Repository section in this topic.
Here's some example code that uses a request function.
Message(MessageType Message.MessageType.WARNING, String "DEMO_REQFUNC", String "DOO_CUST_RELATIONSHIP_WARNING", Map string, object msgParams)
where
-
DEMO_REQFUNC is a value in lookup DOO_MSG_REQUEST_FUNCTION.
Validation Exception Method
The ValidationException method uses the error text that you specify to create a validation exception. It displays the message text that you specify.
Use this format.
ValidationException(String messageText)
Display Messages from the Message Repository
ValidationException can get the error message text from the Oracle Applications message repository, populate token values, and then display the message in the Order Management work area.
Use this format.
ValidationException(String name, Map string, object parameters)
where
-
name. Name of the message that you specify on the Manage Messages page.
-
parameters. A map that contains message tokens and token values. ValidationException uses this map to populate tokens with values in the message.
Map Tokens for the Message Repository
Here's the format to use with ValidationException to create the map that specifies.
ValidationException(java.lang.String requestFunction, java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> parameters)
where
-
requestFunction. Lookup code of the request function to log the message against. You use the Order Management lookup named Request Function to define a request function. If this parameter passes an empty value, then ValidationException defaults the request function to ORA_MANAGE_EXTENSIONS.
-
name. Name of the message that you specify on the Manage Messages page. You must specify Distributed Order Orchestration as the application for this message when you use the Manage Messages page.
-
parameters. A map that contains message tokens and token values. ValidationException uses this map to populate tokens with values in the message.
Display Message Objects from the Message Repository
ValidationException can use a list of message objects to create a validation exception. It can accommodate a validation error that includes more than one message.
Use this format.
ValidationException(List message messages)
where
-
messages. A list of message objects. For details about how to create a message object, see the Message Method section in this topic.
Use Reference Lookup Codes
Here's the format you use to reference a lookup code.
throw new ValidationException("lookup_code")
The lookup type named DOO_MSG_REQUEST_FUNCTION contains lookup codes.
Lookup Code |
Description |
---|---|
ASSIGN_PROC |
Process assignment. |
MANAGE_TASK |
Fulfillment task. |
MANAGE_HOLD |
Hold. |
MANAGE_PROC |
Fulfillment process. |
PLAN_PROC |
Fulfillment planning. |
PROC_CHANGE |
Change order. |
XFORM_ORDER |
Convert source order. Location that Order Management uses to store an incoming source order before it converts it to a sales order. |
VALD_CONSTRAINT |
Processing constraint. |
VALD_PROC_DEFN |
Process definition. |
VALD_ACTION_ELGB |
Action eligibility. |
ORA_VALD_ORDER_DATA |
Order validation. |
ORA_VALD_CONFIG |
Configuration. |
ORA_VALD_PRICING |
Pricing. |
ORA_NOTIFY_EVENT |
Event notification. |
ORA_VALD_PAYMENT |
Payment. |
ORA_VERIFY_TRADE_COMPLIANCE |
Verify that order lines meet trade compliance policies. |
ORA_CREDIT_CHECK |
Verify credit check failure. |
ORA_ORDER_APPROVALS |
Message function classification for Order Approval messages. |
ORA_MANAGE_EXTENSIONS |
Default type for messages that the extensions framework logs. |
You can specify one of these lookup codes or add new ones to the lookup.
Execution Context Method
The ExecutionContext method calls a SOAP web service.
Use this format.
SoapServiceResponse invokeSoapService(String integrationName, String xmlStr)
where
-
integrationName. Identifies the name of the integration.
-
xmlStr. XML representation of the SOAP body in String format.
ExecutionContext returns details.
Parameter |
Description |
---|---|
|
String. Name of the order management extension that's currently running. |
|
String. Abbreviation that identifies the event that triggered the extension. |
|
Logger. Logger where the extension can write logs. |
|
Returns a service that you can use to call a web service from the code in your order management extension. |
|
Returns the name of the user currently signed in. |
|
Returns one of.
where
|
|
Returns an abbreviation that identifies the language that the user is using in the current session. |
|
Returns the current system date in an instance of java.sql.Date. |
|
Returns the current system time in a java.sql.Timestamp object. |
View Object Methods
View Object Method
The ViewObject method finds and returns a view criterion.
Use this format.
ViewCriteria getViewCriteria(name)
where
-
name. Name of the view criterion.
A view criterion is a list of row criterion for the WHERE clause in a view object. Each row criterion is an array that contains criterion for each attribute.
Create View Criterion
Use this format.
ViewCriteria createViewCriteria()
ViewObject returns the new view criterion object.
Find Rows According to View Criterion
Here's the format to use to find rows according to the view criterion that you provide and return them in an iterator.
RowIterator findByViewCriteria(ViewCriteria viewCriteria, int numberOfRows)
where
-
viewCriteria. Name of the view criteria to use to find rows.
-
numberOfRows. Number of rows to return. Use one of.
-
-1. Get all rows that match the view criteria.
-
Positive integer. Get a subset of rows. For example, use
3
to get the first three rows that match the criteria. If only two rows match the criteria, then the method returns only these two rows.
-
For example, here's some code that gets all rows and stores them in a local
variable named
vc
.
def rowset = itemPVO.findByViewCriteria(vc, -1);
Here's the format to include an array of variable names and values.
RowIterator findByViewCriteriaWithBindVars(ViewCriteria viewCriteria, int maxNumOfRows, String[] variableNames, Object[] variableValues)
where
-
variableNames. Array of variable names to use with the view criteria.
-
variableValues. Array of variable values to use with the view criteria.
Here's the format to use to find rows according to the name of the view criteria.
RowIterator findByViewCriteriaWithBindVars(String viewCriteriaName, int maxNumOfRows, String[] variableNames, Object[] variableValues)
where
-
viewCriteriaName. Name of the view criteria to use to find the rows.
For more, see Public View Objects in Oracle Applications Cloud (Doc ID 2386411.1).
Get Row From PVO Method
public Row getRowFromPVO(String pvo,
Map<String, Object> filters)
Use this method to get the first row that your query finds in a public view object according to filters that you specify.
where
pvo
. Provide the name of the public view object that you want to query.filters
. Specify one or more filters to focus the query result.
getRowFromPVO returns:
- A map that contains data from the row that the query found.
- The first row that matches your query.
- If no rows match your query, or if you don't provide any filters, then it doesn't return anything.
- If more than one row matches your query, then it returns an exception. Use more filters, then redo your query.
def pvo = "oracle.apps.financials.assets.shared.publicView.LookupPVO";
def filters = ["LookupType":"AR_FEATURES", "EnabledFlag":"Y", "LookupCode":"AR_CREDIT_MGMT"];
def row = context.getDbAdapter().getRowFromPVO(pvo, filters);
Get Rows From PVO Method
public
RowIterator getRowsFromPVO(String pvo, Map<String, Object> filters, Integer
maxNumOfRows)
This method works just like getRowFromPVO, except it gets more than only one row.
Use the same parameters that you use with getRowFromPVO, but also use maxNumOfRows to specify the maximum number of rows that you want the query to return.
getRowsFromPVO returns:
- A map that contains data from the row that the query found.
- A RowIterator that contains the rows that the query finds.
- If maxNumOfRows is less than 1, or if you don't provide any filters, then it doesn't return anything.
For example:
def pvo = "oracle.apps.scm.doo.publicView.analytics.OrderTotalPVO";
def filters = ["HeaderHeaderId":headerId];
def rowset = context.getDbAdapter().getRowsFromPVO(pvo, filters, 7);
Get Data From PVO Method
public
Map<String, Object> getDataFromPVO(String pvo, Map<String, Object> filters,
Set<String> attributes)
This method works just like getRowFromPVO, except you can also specify the attribute values that you want to get from the row that your query finds.
where
- attributes. Specify the attributes that you want to get from the first row that matches your query.
getDataFromPVO returns:
- A map that contains the attributes that you requested.
- If no rows match your query, then it returns an empty map.
- If you don't provide any filters or attributes, then it doesn't return anything.
- If more than one row matches your query, then it returns an exception. Use more filters, then redo your query.
For Example:
def pvo = "oracle.apps.scm.productModel.items.publicView.ItemPVO";
def filters = ["InventoryItemId":149L, "OrganizationId":204L];
def attributes = ["ItemNumber", "Description", "BomItemType"];
def dataMap = context.getDbAdapter().getDataFromPVO(pvo, filters, attributes);
More Public View Object MethodsMethod | Description |
---|---|
getOrderById | Use the value that uniquely identifies the sales order to get the
order. For example:
|
getLineById | Use the value that uniquely identifies the order line to get the
line. For example:
|
getLookupRow | Get the lookup detail for a lookup type and lookup code. For example:
|
Row Set Iterator Method
Use the RowSetIterator method to manage rows in the iterator.
Use this format.
Row first()
RowSetIterator returns details.
Parameter |
Description |
---|---|
|
Returns the first row in the iterator. |
|
Returns a Boolean value that indicates whether another row exists after the current row. |
|
Returns the next row in the iterator. If no more rows exist after the current row, then this parameter returns a null value. |
|
Returns the last row in the iterator. |
|
Returns a Boolean value that indicates whether another row exists before the current row. |
|
Returns the previous row in the iterator. If no more rows exist before the current row, then this parameter returns a null value. |
|
Creates a new row. If the entity doesn't support creating a new row, then this parameter returns an error message when your extension calls this method. |
|
Inserts the row into the current iterator, where row specifies the row number to insert. Use this method to add a new row to the iterator after you create the iterator. |
Logger Method
Use the Logger method to manage the message log.
Use this format.
Format |
Description |
---|---|
|
Returns one of.
where
|
|
Saves where
|
|
Saves the message at the fine level. where
|
|
Saves where
|
|
Saves the message at the finer level. where
|
|
Saves where
|
|
Saves where
|
|
Saves the message at the severe level. where
|
|
Saves the message at the severe level. where
|
Other Methods
Debug Method
Use the debug method to get details that can help you troubleshoot any problems that might come up when you use an extension to apply a hold. For details, see the Use the Debug Method subtopic in Test Your Order Management Extension.
CreateLineParams Methods
You can use these methods with the CreateLineParams operation.
- public void setProductIdentifier(Long productIdentifier)
- public void setProductNumber(String productNumber)
- public String getProductNumber()
- public void setOrderedUOMCode(String orderedUOMCode)
- public String getOrderedUOMCode()
- public void setOrderedUOM(String orderedUOM)
- public String getOrderedUOM()
- public void setOrderedQuantity(BigDecimal orderedQuantity)
- public BigDecimal getOrderedQuantity()
Service Invoker Method
Use the ServiceInvoker method to call a service.