public class GroovyCtxUtil extends Object
Constructor and Description |
---|
GroovyCtxUtil(BaseContext ctx) |
Modifier and Type | Method and Description |
---|---|
void |
deprecateCalculationGraph()
Method call to deprecate CalculationGraph
|
Map<CheckBeforeQuoteSubmitCommand.PreCheckType,Object> |
executeClassifiedProductsFromConfiguration(String quoteURI)
Execute the Pre Submit check having PreCheckType,
CONFIGURABLE_TO_CLASSIFIED_PRODUCTS inside the Groovy Script to obtain
the result of check so that it can be stored in groovy script result
variable
|
Collection<BusinessObject> |
filterSalesItemsToExport(Collection<BusinessObject> salesItems)
Filter sales items to export to ERP Criteria are whether product is
exported to ERP, system created sales items, ERP ID existed and optional
sales items.
|
BusinessObject |
findBO(BusinessType type,
BusinessAttribute attribute,
Object value)
Get object given the business type, attribute and value.
|
BusinessObject |
findBO(BusinessType type,
BusinessAttribute attribute,
Object value,
boolean isLoadDirectlyFromDB)
Get object given the business type, attribute and value.
|
BusinessObject |
findBOFromERPId(BusinessType type,
String erpId)
Get object of the given type by ERP Id.
|
BusinessObject |
findBOFromERPId(BusinessType type,
String erpId,
boolean isLoadDirectlyFromDB)
Get object of the given type by ERP Id
|
BusinessObject |
findCurrencyBO(String currencyCode)
Get currency business object by currency ERPId
|
BusinessObject |
findPlantBO(String plantCode)
Get a plant business object by plant ERPId
|
BusinessObject |
findProduct(String objectERPId,
String eccDestination)
Get product ERPId
|
Map<Integer,Object> |
getAllVersionOfQuoteDataAttrValue(String quoteURI,
String predicate)
Retrieve all version of quote's data attribute value
|
Map<Integer,Object> |
getAllVersionOfQuoteRelAttrValue(String quoteURI,
String predicate)
Retrieve all version of quote's relation attribute value
|
Collection<BusinessType> |
getBusinessType(BusinessObject bo,
boolean isDirect)
To get the business type of a business object
|
boolean |
getConfigItemError(SalesItemNode salesItemNode)
Get the config item error status for the specified SalesItemNode
|
List<GroupData> |
getConfigStructure(String quoteURI,
SalesItemNode salesItemNode)
Get the configuration structure of the SalesItemNode, if it has any.
|
List<GroupData> |
getConfigStructure(String quoteURI,
SalesItemNode salesItemNode,
Locale locale)
Get the configuration structure of the SalesItemNode, if it has any, with
any localized strings in the given locale.
|
BaseContext |
getCtx()
Deprecated.
|
Object |
getDataAttrObj(BusinessObject bo,
BusinessDataAttribute bda)
Generic method to get single data attribute value as object.
|
Collection<Object> |
getDataAttrObjs(BusinessObject bo,
BusinessDataAttribute bda)
Generic method to get multiple data attribute values as object
collection.
|
String |
getDataAttrStr(BusinessObject bo,
BusinessDataAttribute bda)
Generic method to get single data attribute value as String.
|
GraphSSC |
getGraphSSC()
Get SSC graph from context
|
Object |
getMetaAttrObj(SemanticEntity se,
BusinessMetaAttribute bma)
Generic method to get a single meta attribute value as object.
|
String |
getObjectERPId(BusinessObject bo)
Get object ERP ID of business object.
|
OrgUnitHierarchy |
getOrgUnitHierarchy()
Get the Organization Unit hierarchy
|
BusinessObject |
getPriceItemType(String priceItemTypeName,
BusinessDataAttribute bda)
Get priceItemType by business data attribute (Schema.objectName,
Schema.objectERPId)
|
List<String> |
getProductTypesForBOMItem()
Get List of product types which are bom creation relevant.
|
BusinessObject |
getQuoteAccount(BusinessObject quoteBO)
Get account of the quote.
|
BusinessObject |
getQuoteOpportunity(BusinessObject quoteBO)
Get opportunity of the quote.
|
BusinessObject |
getRelAttr(BusinessObject bo,
BusinessRelationAttribute bra)
Generic method to get single relation attribute value.
|
Collection<BusinessObject> |
getRelAttrs(BusinessObject bo,
BusinessRelationAttribute bra)
Generic method to get multiple relation attribute values.
|
String |
getSalesText(String quoteURI,
SalesItemNode salesItemNode)
Get the sales text of the SalesItemNode, if it has any.
|
String |
getSalesText(String quoteURI,
SalesItemNode salesItemNode,
Locale locale)
Get the sales text of the SalesItemNode in the given locale, if it has
any.
|
BusinessObject |
getSettingValueBO(BusinessObject settingBo)
Get BusinessObject SettingValue from context.
|
Boolean |
getSettingValueBoolean(BusinessObject settingBo)
Get boolean SettingValue from context.
|
BigDecimal |
getSettingValueNumeric(BusinessObject settingBo)
Get Numeric SettingValue from context.
|
String |
getSettingValueString(BusinessObject settingBo)
Get String SettingValue from context.
|
String |
getSSCConfigId(BusinessObject salesItemBO)
Return ssc config id of related sales item
|
List<IInstanceData> |
getSSCConfigInstances(BusinessObject salesItemBO)
Get configuration instances of sales item from SSC.
|
boolean |
isCommerce()
Check if the user is from commerce user or mx
|
void |
loadBO(BusinessObject bo)
Load BusinessObject dynamically
|
void |
loadSalesItemProductCategories(SalesItemsTree salesItemTree)
Load product categories's data points of all the sales items within given
sales item tree.
|
boolean |
reconnectSSC(String quoteUri)
Reconnect SSC.
|
void |
removeRelAttrValues(BusinessObject bo,
Collection<BusinessObject> removedBOs,
BusinessRelationAttribute bra)
Remove Relation Attributes Values.
|
void |
setDefaultPartnerFunctions(SalesItemsTree salesItemsTree)
Sets the default Partner Functions from the Account of the Quote.
|
void |
setQuotePricingRequired(BusinessObject quoteBO,
boolean flag)
Update quotePricingRequired
|
public void deprecateCalculationGraph()
public Map<CheckBeforeQuoteSubmitCommand.PreCheckType,Object> executeClassifiedProductsFromConfiguration(String quoteURI) throws IMCException
quoteURI
- URI of the current quote accessible by the Groovy ScriptpreCheckTypes
- IMCException
- the platform exceptionpublic Collection<BusinessObject> filterSalesItemsToExport(Collection<BusinessObject> salesItems) throws IMCException
FilterSalesItemToExportCommand
salesItems
- Unfiltered sales item bo collectionIMCException
- the platform exceptionpublic BusinessObject findBO(BusinessType type, BusinessAttribute attribute, Object value) throws IMCException
type
- type as BusinessType
attribute
- BusinessDataAttribute
or
BusinessRelationAttribute
value
- value of the attributeBusinessObject
,
else nullIMCException
- the platform exceptionpublic BusinessObject findBO(BusinessType type, BusinessAttribute attribute, Object value, boolean isLoadDirectlyFromDB) throws IMCException
type
- type as BusinessType
attribute
- BusinessDataAttribute
or
BusinessRelationAttribute
value
- value of the attributeisLoadDirectlyFromDB
- if true
, a direct database call is
fired to find the BOBusinessObject
,
else nullIMCException
- the platform exceptionpublic BusinessObject findBOFromERPId(BusinessType type, String erpId) throws IMCException
type
- type as BusinessType
erpId
- object ERP ID as StringBusinessObject
,
else null.IMCException
- the platform exceptionpublic BusinessObject findBOFromERPId(BusinessType type, String erpId, boolean isLoadDirectlyFromDB) throws IMCException
type
- type as BusinessType
erpId
- object ERP ID as StringisLoadDirectlyFromDB
- if true
, a direct database call is
fired to find the BOBusinessObject
,
else nullIMCException
- the platform exceptionpublic BusinessObject findCurrencyBO(String currencyCode) throws IMCException
currencyCode
- as String. The objectERPId of the currency to match.IMCException
- the platform exceptionpublic BusinessObject findPlantBO(String plantCode) throws IMCException
plantCode
- as String. The objectERPId of the plant to match.IMCException
- the platform exceptionpublic BusinessObject findProduct(String objectERPId, String eccDestination) throws IMCException
objectERPId
- as String. Product ObjectERPId to match.IMCException
- the platform exceptionpublic Map<Integer,Object> getAllVersionOfQuoteDataAttrValue(String quoteURI, String predicate) throws IMCException
quoteURI
- as String. The URI of the quotepredicate
- as String. The URI of the predicateIMCException
- the platform exceptionpublic Map<Integer,Object> getAllVersionOfQuoteRelAttrValue(String quoteURI, String predicate) throws IMCException
quoteURI
- as String. The URI of the quotepredicate
- as String. The URI of the predicateIMCException
- the platform exceptionpublic Collection<BusinessType> getBusinessType(BusinessObject bo, boolean isDirect) throws IMCException
bo
- Any BusinessObjectisDirect
- true to only get the direct business type.IMCException
- the platform exceptionpublic boolean getConfigItemError(SalesItemNode salesItemNode) throws IMCException
IMCException
public List<GroupData> getConfigStructure(String quoteURI, SalesItemNode salesItemNode) throws IMCException
quoteURI
- salesItemNode
- IMCException
- the platform exceptionpublic List<GroupData> getConfigStructure(String quoteURI, SalesItemNode salesItemNode, Locale locale) throws IMCException
quoteURI
- salesItemNode
- locale
- IMCException
- the platform exception@Deprecated public BaseContext getCtx()
public Object getDataAttrObj(BusinessObject bo, BusinessDataAttribute bda) throws IMCException
bo:
- businessObjectbda:
- businessDataAttributeIMCException
- the platform exceptionpublic Collection<Object> getDataAttrObjs(BusinessObject bo, BusinessDataAttribute bda) throws IMCException
bo
- Any businessObjectbda
- Any businessDataAttributeIMCException
- the platform exceptionpublic String getDataAttrStr(BusinessObject bo, BusinessDataAttribute bda) throws IMCException
bo:
- businessObjectbda:
- businessDataAttributeIMCException
- the platform exceptionpublic GraphSSC getGraphSSC()
public Object getMetaAttrObj(SemanticEntity se, BusinessMetaAttribute bma) throws IMCException
se:
- semantic entitybma:
- business meta attributeIMCException
- the platform exceptionpublic String getObjectERPId(BusinessObject bo) throws IMCException
bo
- Any BusinessObjectIMCException
- the platform exceptionpublic OrgUnitHierarchy getOrgUnitHierarchy() throws IMCException
IMCException
public BusinessObject getPriceItemType(String priceItemTypeName, BusinessDataAttribute bda) throws IMCException
priceItemTypeName
- as String. The name of the priceItemTypebda
- as BusinessDataAttribute. The BusinessDataAttribute to match
the priceItemTypeNameIMCException
public List<String> getProductTypesForBOMItem() throws IMCException
IMCException
- the IMC exceptionpublic BusinessObject getQuoteAccount(BusinessObject quoteBO) throws IMCException
quoteBO
- Quote BusinessObjectIMCException
- the platform exceptionpublic BusinessObject getQuoteOpportunity(BusinessObject quoteBO) throws IMCException
quoteBO
- Quote BusinessObjectIMCException
- the platform exceptionpublic BusinessObject getRelAttr(BusinessObject bo, BusinessRelationAttribute bra) throws IMCException
bo:
- businessObjectbra:
- BusinessRelationAttributeIMCException
- the platform exceptionpublic Collection<BusinessObject> getRelAttrs(BusinessObject bo, BusinessRelationAttribute bra) throws IMCException
bo
- Any BusinessObjectbra
- Any BusinessRelationAttributeIMCException
- the platform exceptionpublic String getSalesText(String quoteURI, SalesItemNode salesItemNode) throws IMCException
quoteURI
- salesItemNode
- IMCException
- the platform exceptionpublic String getSalesText(String quoteURI, SalesItemNode salesItemNode, Locale locale) throws IMCException
quoteURI
- salesItemNode
- locale
- IMCException
- the platform exceptionpublic BusinessObject getSettingValueBO(BusinessObject settingBo) throws IMCException
settingBo
- as BusinessObjectIMCException
- the platform exceptionpublic Boolean getSettingValueBoolean(BusinessObject settingBo) throws IMCException
settingBo
- as BusinessObjectIMCException
- the platform exceptionpublic BigDecimal getSettingValueNumeric(BusinessObject settingBo) throws IMCException
settingBo
- as BusinessObjectIMCException
- the platform exceptionpublic String getSettingValueString(BusinessObject settingBo) throws IMCException
settingBo
- as BusinessObjectIMCException
- the platform exceptionpublic String getSSCConfigId(BusinessObject salesItemBO) throws IMCException
salesItemBO
- SalesItem BusinessObjectIMCException
- the platform exceptionpublic List<IInstanceData> getSSCConfigInstances(BusinessObject salesItemBO) throws IpcCommandException, IMCException
salesItemBO
- SalesItem BusinessObjectIpcCommandException
- IpcCommandExceptionIMCException
- the platform exceptionpublic boolean isCommerce()
public void loadBO(BusinessObject bo) throws IMCException
bo
- BusinessObject to loadIMCException
- the platform exceptionpublic void loadSalesItemProductCategories(SalesItemsTree salesItemTree) throws IMCException
salesItemTree
- as SalesItemsTreeIMCException
public boolean reconnectSSC(String quoteUri) throws IMCException
quoteUri
- as String.IMCException
public void removeRelAttrValues(BusinessObject bo, Collection<BusinessObject> removedBOs, BusinessRelationAttribute bra) throws IMCException
bo
- as BusinessObject. The business object of the subject.removedBOs
- as Collectionbra
- as BusinessRelationAttribute. The BusinessRelationAttribute
linking the subject and the object.IMCException
- the platform exceptionpublic void setDefaultPartnerFunctions(SalesItemsTree salesItemsTree) throws IMCException
salesItemsTree
- The SalesItemsTree
representing the Quote
dataIMCException
- the platform exceptionpublic void setQuotePricingRequired(BusinessObject quoteBO, boolean flag) throws IMCException
quoteBO
- as BusinessObject. The business object of the quote.flag
- as boolean. The boolean value to indicate
quotePricingRequiredIMCException
- the platform exception