Customize the Business Rule as explained in Customization by Business Rules
Rules are mostly based on P&O information and selected data:
All the P&O information along with the type of import/export, plus the list of filepaths and/or objects list are used as input parameter of the Business Logic. With these input parameters, you evaluate whether access should be granted or not. If the access is not granted: an error is reported to the end-user. Below is an example of Business Logic that ensures that for a specific username and a specific format exchange, the maturity of the selected root objects from the export command is not defined as FROZEN . Let ctx_user_name(String)
Let odt_user_name(String)
Let odt_exchange_format(String)
Let ctx_exchange_format(String)
odt_user_name = "uxodtitp"
odt_exchange_format = "STEP"
ctx_exchange_format = Parameters->GetAttributeString("ImportExportFormat")
ctx_user_name = Parameters->GetAttributeString("UserName")
Let has_access(Boolean)
has_access = TRUE
if ("STEP" == ctx_exchange_format) {
if (odt_user_name == ctx_user_name) {
Let ctx_listof_objects(List)
Let ctx_listof_attributes(List)
Let str_object_name(String)
Let str_object_type(String)
Let str_object_revision(String)
Let str_object_maturity(String)
ctx_listof_objects = Parameters->GetAttributeObject("ObjectList")
Let loop_idx(Integer)
loop_idx = 1
for loop_idx while loop_idx <= ctx_listof_objects.Size() {
ctx_listof_attributes = ctx_listof_objects[loop_idx]
if (ctx_listof_attributes.Size() == 4) {
str_object_name = ctx_listof_attributes[1]
str_object_type = ctx_listof_attributes[2]
str_object_revision = ctx_listof_attributes[3]
str_object_maturity = ctx_listof_attributes[4]
}
if ("FROZEN" == str_object_maturity) {
has_access = FALSE
break
}
}
}
}
Parameters->SetAttributeBoolean("AccessAllowed", has_access)
| |||||||