I've had a similar problem. Tag values being used as inputs into calculation and the result captured in another tagged value. The only way I managed to get it to work was via a script.
So what I did was create the various tagged values including the result as a tagged value in my MDG. Then I created a jscript that navigated through the elements and filled in the calculated value for each element.
Store the script in a project script folder so it can be accessed via the UI via the context menu>Script>CalculateBusinessTechnicalRisk
for instance the following attributes have values of 0 to 5
-Business criticality,
-Customer experience - business,
-Customer experience - technical,
-Efficiency and contribution,
-Future effectiveness,
-Utilisation
The result is which totals the values for the above then finds the average and stores the value in Business Value tagged value. Similar calculations for technical condition and risk values in the script below.
Here is the JScript - hope it helps
!INC Local Scripts.EAConstants-JScript
/*
* Script Name:CalculateBusinessTechnicalRiskValues
* Purpose: Used to scan through the work packages and calculate the totals business value,
* technical condition and risk values to help prioritise work packages
* Date: 17-09-2015
*/
/*
* Project Browser Script main function
*/
function OnProjectBrowserScript()
{
// Get the type of element selected in the Project Browser
var treeSelectedType = Repository.GetTreeSelectedItemType();
// Handling Code: Uncomment any types you wish this script to support
// NOTE: You can toggle comments on multiple lines that are currently
// selected with [CTRL]+[SHIFT]+[C].
switch ( treeSelectedType )
{
case otElement :
{
// Code for when an element is selected
var theElement as EA.Element;
theElement = Repository.GetTreeSelectedObject();
CalculateElementTotals(" ",theElement);
break;
}
case otPackage :
{
// Code for when a package is selected
var thePackage as EA.Package;
thePackage = Repository.GetTreeSelectedObject();
NavigatePackage(" ",thePackage);
break;
}
default:
{
// Error message
Session.Prompt( "This script does not support items of this type.", promptOK );
}
}
Session.Prompt( "Application Portofolio Management Calculations Complete", promptOK );
}
//
// Navigates through the packages calling Calculate Element Totals in each package
//
// Parameters:
// - indent A string representing the current level of indentation
// - thePackage The package object to be processed
//
function NavigatePackage( indent, thePackage )
{
// Cast thePackage to EA.Package so we get intellisense
var currentPackage as EA.Package;
currentPackage = thePackage;
// Add the current package's name to the list
Session.Output( indent + currentPackage.Name + " (PackageID=" +
currentPackage.PackageID + ")" );
// Convert the elements this package contains
CalculateElementsTotalsInPackage( indent + " ", currentPackage );
// Recursively process any child packages
var childPackageEnumerator = new Enumerator( currentPackage.Packages );
while ( !childPackageEnumerator.atEnd() )
{
var childPackage as EA.Package;
childPackage = childPackageEnumerator.item();
NavigatePackage( indent + " ", childPackage );
childPackageEnumerator.moveNext();
}
}
//
// Calculates element totals in the package
//
// Parameters:
// - indent A string representing the current level of indentation
// - thePackage The package object to be processed
//
function CalculateElementsTotalsInPackage( indent, thePackage )
{
// Cast thePackage to EA.Package so we get intellisense
var currentPackage as EA.Package;
currentPackage = thePackage;
// Iterate through all elements and add them to the list
var elementEnumerator = new Enumerator( currentPackage.Elements );
while ( !elementEnumerator.atEnd() )
{
var currentElement as EA.Element;
currentElement = elementEnumerator.item();
CalculateElementTotals(indent+" ",currentElement );
elementEnumerator.moveNext();
}
}
//
// Calculates element totals for business and technical values along with risk
//
// Parameters:
// - indent A string representing the current level of indentation
// - thePackage The package object to be processed
//
function CalculateElementTotals( indent, theElement )
{
var businessValueTotal = "Business Value";
var businessValuetags = new Array ("Business criticality","Customer experience - business",
"Customer experience - technical","Efficiency and contribution",
"Future effectiveness","Utilisation");
var technicalValueTotal ="Technical Condition";
var technnicalValuetags = new Array ("Architecture","Database / Data Model","Development Language",
"Hardware Platform","Security Design","Operating System","Service Level Performance",
"Vendor Support");
var riskValueTotal ="Risk Value";
var riskValuetags = new Array ("Availability (DR)","Info Mgmt / Confidentiality",
"IT Staffing / Skills","Privacy","Security","Vendor Viability");
// Cast theElement to EA.Element so we get intellisense
var currentElement as EA.Element;
currentElement = theElement;
CalculateTotals(indent+" ",currentElement,businessValueTotal,businessValuetags);
CalculateTotals(indent+" ",currentElement,technicalValueTotal,technnicalValuetags);
CalculateTotals(indent+" ",currentElement,riskValueTotal,riskValuetags);
// Iterate through all embedded elements and add them to the list
var elementEnumerator = new Enumerator( currentElement.Elements );
while ( !elementEnumerator.atEnd() )
{
var currentElement as EA.Element;
currentElement = elementEnumerator.item();
CalculateElementTotals(indent+" ",currentElement );
elementEnumerator.moveNext();
}
}
//
//Calculate the total and store for tag values passed
// Parameters:
// - indent A string representing the current level of indentation
// - theElement The element object to be processed
function CalculateTotals( indent, theElement, theTotal, theValueTags )
{
// Debug Comment out when run for real
Session.Output( indent + "CALLED: CalculateTotals with " + theElement.Name + " (" + theElement.Type + ", " + theElement.Stereotype + " )" );
Session.Output( indent+" " + "theTotal=" + theTotal );
Session.Output( indent+" " + "theValueTags=" + theValueTags );
var total = 0.0;
var tagEnumerator = new Enumerator( theValueTags );
while ( !tagEnumerator.atEnd() )
{
var tagValue as EA.TaggedValue;
tagValue = theElement.TaggedValues.GetByName(tagEnumerator.item());
var totalTag as EA.TaggedValue;
if ( (tagValue !=null) && (tagValue.Value !=""))
{
Session.Output( indent + " " + "Tag:" + tagValue.Name + " = " + tagValue.Value );
total = total+parseFloat(tagValue.Value);
}
totalTag = theElement.TaggedValues.GetByName(theTotal);
if (totalTag != null)
{
totalTag.Value=total/theValueTags.length;
totalTag.Update();
}
Session.Output( indent + " " + "Subtotal =" + total );
tagEnumerator.moveNext();
}
Session.Output( indent + " " + "length=" + theValueTags.length );
Session.Output( indent + " " + theTotal +"= " + total/theValueTags.length );
}
OnProjectBrowserScript();