Command Input Validation (PLMCommandInputValidation)

An opening ID is an entry point used to customize business logic. PLMCommandInputValidation checks the validation of user input when launching the command.

Note: For more information about customization by business rules, see Installation and Setup: Customize: Behavior: Data Setup: Customization by Business Rules.

This page discusses:

General Information

This opening ID is invoked with the following commands:

  • Insert Existing Product
  • Cut
  • Paste
  • Delete
  • Replace by Existing
  • Replace by Major Version
  • Replace by Latest Revision
  • Drag and Drop

This opening ID is used to customize:

  • Acceptance of the input object
  • Request to ask end-user to validate the input object for the operation
  • Refusal of the input object

DefinitionDescription
Opening IDPLMCommandInputValidation
Customization intent Validation
Execution contextClient

Input Objects

Input objects must be of the following types:

  • ThisObject

    Depending on the OperationId, ThisObject is the following reference:

    • InsertExisting: the reference node under which a new instance is being created (parent)
    • Cut: the reference being cut (child)
    • DragDrop (drag and drop performing a move or a copy): the reference being dragged (child)
    • Paste: the reference node under which a new instance is being created (parent)

  • Parameters corresponds to the context object.

Context Object Parameters

Parameter NameTypeRead or WriteComments
OperationIdStringReadIdentifies the context execution that is, the interactive command launched. Following values are available, but other values may be given, as the business logic may be deployed for other commands:
  • InsertExisting for Insert by Existing command
  • Cut for Cut command
  • DragDrop for Drag and Drop performing a move or a copy operation
  • Paste for Paste operation
InstancePLMCoreInstance ReadSelected instance object, when it has a meaning for the command. For example, this parameter is given in case of Cut or drag and drop, but not in the context of Insert or Paste. When the instance information is available, the business logic implementation can access the parent reference object and its public attributes.
TotalNbIntegerReadNumber of the selected objects for the current command launching. In case of monoselection, this value is 1.
IndexNbIntegerReadIndex of the selected object among all selected by the end-user.
  • In case of monoselection, this value is 1.
  • In case of multiselection, it varies from 1 to TotalNb as the business logic is invoked TotalNb times.
ValidationBooleanWriteResult of business logic execution to say if object should be kept or discarded in case of refusal. The next object of the selection is processed through business logic in all cases.
MessageStringWriteMessage to be displayed to end-user.
AskUserBooleanWriteResult of business logic execution to say if user should be asked to confirm the operation for this input object. An OK/Cancel dialog box is displayed, with the Message parameter content, for the user confirmation. The next object of the selection is processed through business logic after confirmation or refusal.
Note: The validation can be delayed with the InteractionDelayed parameter value.
InteractionDelayedBooleanWriteIn case of an interaction with the end-user is expected, if this parameter is set to True, the interaction is delayed after the end of the business logic execution and a grouping of possible interactions is managed. This minimizes the interactions in case of multiselection.

Sample

The following sample determines whether the selected instance with a test description can be cut or not:

Let Operation (STRING)
Let selectedInstance  (PLMEntity)
Operation = Parameters->GetAttributeString("OperationId")
Validation = true
AskUser = false
if (Operation=="Cut")
{
    if (Parameters->HasAttribute("Instance"))
  {
   	set selectedInstance  = Parameters->GetAttributeObject("Instance")
        if (selectedInstance  <> NULL)
        {
     if (selectedInstance.V_description == "Test")
     {
     	      Validation = false
     	      Parameters.Message = "Cut of Instance forbidden in this context"
 	        }
     if (selectedInstance.V_description == "Ask")
     {
     	      AskUser = true
     	      Parameters.Message = "Please confirm you really want to Cut this instance and not simply Delete it"
 	        }
	     }
  }
}