Precedence Constraint Color (DELMA_PrecedenceConstraintDisplayColor)

An opening ID is an entry point used to customize business logic. Precedence Constraint Color specifies the opening ID run to retrieve the color of the precedence constraints.

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

The table below provides you with information related to the definition of the opening ID.

PLM Opening ID: DELMA_PrecedenceConstraintDisplayColor
Customization intent: Execution
Execution context:Client

Input Objects

Input objects must be of the following types:

  • ThisObject: Precedence constraint on which the test is done.
  • Parameters corresponds to the context object.

Context Object Parameters

Parameter NameTypeRead/WriteComments
ColorAttributeNameString Write Gives the RGB color (cache usage, see sample).
DisplayColor StringWrite Gives the RGB color.
UseCacheBooleanWrite TRUE if usage of cache is required and FALSE if not.

Sample

The following sample retrieves the color of a precedence constraint, with usage of the cache.

/* Setting the attribute UseCache to false will cause the execution of the rule always	*/
/* You should always UseCache to true, to improve performance. Unless you have to do	*/
/* a complex calcul to determine the color of the constraints.	*/

/* Warning:																			*/
/*	1. The cache will be effective only if you set a valid ColorAttributeName	*/
/*		attribute value																	*/
/*  2. if you set the UseCache attribute to false then the rule will be executed	*/
/*		always even if you dont set the attribute ColorAttributeName		*/
Parameters.SetAttributeBoolean ("UseCache" , true)
 
/* To use the cache you must also set a valid ColorAttributeName attribute value	*/
/* Ex: V_description																	*/
/* This attribute will be searched and evaluated on the cache to minimize	*/
/* the rule executions.																	*/					
/* Please remark that this value will be read only once	*/
/* To deactivate the rule after the first execution you should use	*/
/* the cache and set the ColorAttributeName attribute to empty string	*/
Parameters.SetAttributeString ("ColorAttributeName" , "") 

if(ThisObject->GetAttributeString("V_description") <> "")
{
	/* use the DisplayColor return attribute to return the desired RGB color	*/
	/* Please remark that if you dont set the attribute or you set this attribute to an empy string */
	/* then the default constraint color will be used (set on properties using the user interface).	*/
	/* This is only an Example, the display color for the constraint will be green on this case	*/
	Parameters->SetAttributeString ("DisplayColor" , "0|255|0") 
}