Environment: On premises only
Context Object Parameters
Parameter Name | Type | Read/Write | Comments |
---|
Transition | String |
Read | The name of the transition that is requested by the maturity change operation (ex: Close). |
CurrentState | String | Read | The name of the maturity state of the object before the transition (ex: IN_WORK). |
Policy | String | Read | Policy name. |
Sample
The following sample The following sample shows you how to:
- Check the current state and the transition
- Check the object children maturity state. The rule fails if at least one child is in "WAIT_APP" maturity state.
/*The following rule is an example of what can be done*/
/* ----------------- */
/* Declare */
/* ----------------- */
let iFromState=""
let iTransition=""
let ListInstance (List)
let ListInstanceSize (Integer)
let FilterList (List)
let SonList(List)
let FilterListSize (Integer)
/* ----------------------------------------------- */
/* By default, we validate the operation */
/* ----------------------------------------------- */
Validation = true
/* ------------------------------------------- */
/* */
/* ------------------------------------------- */
/* -------------------------------- */
/* Retrieve parameters values */
/* -------------------------------- */
iFromState = Parameters.GetAttributeString("CurrentState")
iTransition = Parameters.GetAttributeString("Transition")
/* -------------------------------------------------------------- */
/* From IN_WORK to WAIT_APP, check Children's maturity state */
/* -------------------------------------------------------------- */
if (iFromState == "IN_WORK" and iTransition == "Share")
{
/* -------------------------------- */
/* Retrieve object's Children */
/* -------------------------------- */
ListInstance = ThisObject.Children
ListInstanceSize = ListInstance.Size()
if ( ListInstanceSize > 0 )
{
/* ------------------------------------- */
/* Check Children's maturity state */
/* */
/* We first navigate from the instances */
/* to their references */
/* ------------------------------------- */
FilterList = ListInstance.Extract("VPMInstance", "VPMReference", "y = x.Children.GetItem(1)")
.Filter("VPMReference", "x.V_maturity == \"IN_WORK\" ")
FilterListSize = FilterList.Size()
}
}