Hello, |
Re: Remaping attribute values |
Re: Remaping attribute values OurGuest - Thu Oct 27 12:48:19 EDT 2011 I am trying to remaping existing values to new values within an attribute that is of type enum with a drop down list of: A BC D E and would like to updated the values in the list and the actual value assigned to it currently with out losing the data I would like to reasign it to the remap values. Existing values: A BC D E Update(remaping) A -> A BC -> D D -> F E (deleted) Thank you, Jim |
Re: Remaping attribute values SystemAdmin - Thu Oct 27 13:37:31 EDT 2011 |
Re: Remaping attribute values SystemAdmin - Thu Oct 27 13:37:31 EDT 2011
Searching for "+modify +enumeration" I found this thread although I recall there are more 'robust' ones for changing enumerations. Index Old New[] Map[] Comment 0 A A 0 maps to previous A 1 BC D 1 maps to previous BC 2 D F 2 maps to previous D 3 E
|
Re: Remaping attribute values llandale - Thu Oct 27 15:28:14 EDT 2011
Searching for "+modify +enumeration" I found this thread although I recall there are more 'robust' ones for changing enumerations. Index Old New[] Map[] Comment 0 A A 0 maps to previous A 1 BC D 1 maps to previous BC 2 D F 2 maps to previous D 3 E
Hello,
int NewColor[] = {-1, -1, -1} // or figure out real colors; good luck with that
string NewDescs[] = {"", "", ""} // or add descriptions for "R - Requirement" etc
Module m = current
if (!null m)
{
string ErrMess = ""
m = edit(fullName m, true)
//_Req Eval
AttrDef ad = find(m, "_Req Eval")
if(ad != null)
{
ErrMess = ""
string NewCodes[] = {"R - Requirement", "D - Description", "I - Information Only"}
int NewValus[] = {0, 0, 0} // or perhaps 0,0,0,0
int NewColor[] = {-1, -1, -1} // or figure out real colors; good luck with that
string NewDescs[] = {"", "", ""} // or add descriptions for "R - Requirement" etc
int NewMapping[] = {0, 1, 2} // where '-1' is for "R - Requirement" and maps to nothing old
AttrType at = find(m, ad.typeName)
modify(at, "_Req Eval", NewCodes, NewValus, NewColor, NewDescs, NewMapping, ErrMess)
if (!null ErrMess) { print "Error(_Req Eval): " ErrMess "\n"}
}
}
|
Re: Remaping attribute values SystemAdmin - Wed Nov 02 18:00:28 EDT 2011
Hello,
int NewColor[] = {-1, -1, -1} // or figure out real colors; good luck with that
string NewDescs[] = {"", "", ""} // or add descriptions for "R - Requirement" etc
Module m = current
if (!null m)
{
string ErrMess = ""
m = edit(fullName m, true)
//_Req Eval
AttrDef ad = find(m, "_Req Eval")
if(ad != null)
{
ErrMess = ""
string NewCodes[] = {"R - Requirement", "D - Description", "I - Information Only"}
int NewValus[] = {0, 0, 0} // or perhaps 0,0,0,0
int NewColor[] = {-1, -1, -1} // or figure out real colors; good luck with that
string NewDescs[] = {"", "", ""} // or add descriptions for "R - Requirement" etc
int NewMapping[] = {0, 1, 2} // where '-1' is for "R - Requirement" and maps to nothing old
AttrType at = find(m, ad.typeName)
modify(at, "_Req Eval", NewCodes, NewValus, NewColor, NewDescs, NewMapping, ErrMess)
if (!null ErrMess) { print "Error(_Req Eval): " ErrMess "\n"}
}
}
colorGrey colorRedGrey colorGrey77 colorGrey82 colorBlack colorBrown colorOrange colorWhite colorCyan colorMagenta colorGreen colorYellow colorRed colorMaroon colorBlue colorPink colorDarkTurquoise colorMediumLightBlue colorLightBlue But you could create a sample Enyumerated list with colors, then use DXL to query their values. The Descriptions should show extra text assocated with each enumeration, a new v9 feature. So your text should appear in the enumerated list in the GUI.
|