Methods That You Can Use with Order Management Extensions
Get details about the methods that you can use with your order management extension.
canApplyHold Method
canApplyHold makes sure that the line isn't a child line of a model or kit, and that you haven't already applied a hold on the line.
boolean canApplyHold(def line, def holdCode) {
if (isChildLine(line)) {
debug("is child line");
return false;
}
if (holdExists(line, holdCode)) {
debug("hold already exists");
return false;
}
return true;
}
canApplyHold returns a value.
- true. The line isn't a child line of a model or kit, and you haven't already applied a hold on the line.
- false. The line is a child line of a model or kit, or you already applied a hold on the line.
For details, see Use Order Management Extensions to Apply Holds.
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.
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. |
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 Submission Request |
Write During End of Submission Request |
---|---|---|---|---|---|
Header attachment |
Not applicable |
Header |
Yes |
Yes |
Yes |
Fulfillment line attachment |
Not applicable |
Lines |
Yes |
Yes |
No |
holdExists Method
See whether you already applied a hold on the line.
boolean holdExists(def line, def holdCode) {
ArrayList holds = line.getHolds();
for (hold in holds) {
if (holdCode.equals(hold.getAttribute("HoldCode"))) {
debug("Found hold code on line");
return true;
}
}
return false;
}
holdExists returns a value.
- true. You already applied a hold on the line.
- false. You haven't applied a hold on the line.
isChildLine Method
See whether the line is a child of a model or kit.
boolean isChildLine(def line) {
def rootParentLineId = line.getAttribute("RootParentLineReference");
def fulfillLineId = line.getAttribute("FulfillmentLineIdentifier");
return (rootParentLineId != null && rootParentLineId != fulfillLineId);
}
isChildLine returns a value.
- true. The line is a child line of a model or kit.
- false. The line isn't a child line of a model or kit.
isFirstDraftOrder Method
Make sure the sales order is in draft status.
boolean isFirstDraftOrder() {
String statusCode = header.getAttribute("StatusCode");
if ("DOO_DRAFT".equals(statusCode)) {
def cvn = header.getAttribute("ChangeVersionNumber");
if (cvn == 1) {
return true;
}
}
return false;
}
isFirstDraftOrder returns a value.
- true. The sales order is in draft status.
- false. The sales order isn't in draft status.
Logger Method
The Logger method returns 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
|
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.
Row Set Iterator Method
The RowSetIterator method manages 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. |
Service Invoker Method
The ServiceInvoker method calls a service.
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 |
Order transformation. Location that Order Management uses to store an incoming source order before it transforms 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 fulfillment 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.
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.
Finding 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).
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; }
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; }
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()
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. |
Order Header and Order Line Methods
You can use these methods on the order header or the order line.
Method | Description |
---|---|
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() | Contains true or false. True: the user updated the SellingProfitCenter attribute. False: the user didn't update the SellingProfitCenter attribute. |
Address Methods
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. |
Party Methods
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. |
Order Line Methods
Method | Description |
---|---|
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() | Contains true or false. True: the order line is a transformed line. False: the order line isn't a transformed line. |
public boolean isOpen() | Contains true or false. True: the order line is open. False: the order line isn't open. |
public boolean isClosed() | Contains true or false. True: the order line is closed. False: the order line isn't closed. |
public boolean isCanceled() | Contains true or false. True: the order line is cancelled. False: the order line isn't cancelled. |
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 object that it just added. |
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; }