use of teamdash.wbs.WBSNode in project processdash by dtuma.
the class WorkflowMappingAlterer method applyChanges.
private void applyChanges(WorkflowWBSModel model, Workflow workflow, Workflow target, Map<String, String> changes) {
// extract useful information from the various IDs
String[] parts = workflow.getId().split(":", 3);
String workflowProjectId = parts[1];
Integer workflowUniqueId = Integer.valueOf(parts[2]);
parts = target.getId().split(":", 3);
String targetProjectId = parts[1];
String targetUniqueId = parts[2];
boolean sameProject = workflowProjectId.equals(targetProjectId);
String targetRelativeId = (sameProject ? PROJECT_RELATIVE_PREFIX + targetUniqueId : target.getId());
String attrName = PHASE_MAPPING_PREFIX + targetRelativeId;
// collect useful information about the changes to be made
Set<Integer> phaseUniqueIDsToChange = getPhaseUniqueIDs(changes);
Set<String> targetPhaseFullIDs = getPhaseFullIDs(target, sameProject);
// iterate over the workflow nodes, and update them
for (WBSNode node : model.getWbsNodes()) {
// only alter nodes for the set of phases we are changing
if (!phaseUniqueIDsToChange.contains(node.getUniqueID()))
continue;
// remove any attributes from this node that specify obsolete
// mappings to the target workflow
deleteOldMappings(node, attrName, targetPhaseFullIDs);
// store new mappings into this node as specified by the changes
storeNewMappings(node, changes, attrName, sameProject);
}
// set/clear a flag on the workflow node to indicate whether the ETL
// logic should disable mappings between these two workflows
WBSNode workflowNode = model.getWorkflowNodeMap().get(workflowUniqueId);
if (changes.containsKey(WorkflowMappingManager.DELETE_MAPPINGS))
workflowNode.setAttribute(attrName, "*NONE*");
else
workflowNode.removeAttribute(attrName);
}
use of teamdash.wbs.WBSNode in project processdash by dtuma.
the class BlameDataFactory method recordNodeAdded.
private void recordNodeAdded(BlameModelData blameModelData, TreeNodeChange<Integer, WBSNodeContent> tnc, WBSModel wbs) {
Integer nodeID = tnc.getNodeID();
WBSNode node = wbs.getNodeMap().get(nodeID);
String effAuthor = getAuthorOfNodeChange(node, Type.Add, author);
BlamePoint effBlame = (effAuthor.equals(author) ? blamePoint : new BlamePoint(timestamp, effAuthor));
BlameNodeData nodeData = blameModelData.getNodeData(nodeID);
nodeData.setAddedBy(effBlame);
}
use of teamdash.wbs.WBSNode in project processdash by dtuma.
the class BlameDataFactory method recordNodeDeleted.
private void recordNodeDeleted(BlameModelData blameModelData, TreeNodeChange<Integer, WBSNodeContent> tnc, TreeDiff<Integer, WBSNodeContent> diff, WBSModel modelA) {
// since the node has been removed, there won't be a row in the GUI for
// this node where we can display any past blame changes. Remove its
// blame data entry from our collection.
Integer nodeID = tnc.getNodeID();
BlameNodeData removedNodeData = blameModelData.remove(nodeID);
// any details about this transient node to the user.
if (removedNodeData != null && removedNodeData.getAddedBy() != null)
return;
// when an entire branch of the tree was deleted, we only need to report
// the deletion of the branch's top-level parent.
Integer parentID = tnc.getParentID();
if (diff.getChangedNodeIDs(Type.Delete).contains(parentID))
return;
// Record an entry on the parent that this child was deleted.
WBSNode deletedNode = modelA.getNodeMap().get(nodeID);
BlameNodeData parentNodeData = blameModelData.getNodeData(parentID);
parentNodeData.addDeletedChild(deletedNode, blamePoint);
}
use of teamdash.wbs.WBSNode in project processdash by dtuma.
the class ProxyEstBucketColumn method getBuckets.
private WBSNode[] getBuckets(WBSNode node) {
Integer typeId = ProxyEstTypeColumn.getTypeIdAt(node);
if (typeId == null)
return NO_BUCKETS;
WBSNode proxy = proxyModel.getNodeMap().get(typeId);
if (proxy == null)
return NO_BUCKETS;
WBSNode[] buckets = proxyModel.getChildren(proxy);
return buckets;
}
use of teamdash.wbs.WBSNode in project processdash by dtuma.
the class ProxyEstBucketColumn method setValueAt.
public void setValueAt(Object aValue, WBSNode node) {
// if the user asks to clear the current value, oblige.
if (aValue == null || "".equals(aValue)) {
clearValueAt(node);
return;
}
// find the bucket whose name matches the given value
WBSNode selectedBucket = null;
for (WBSNode bucket : getBuckets(node)) {
if (bucket.getName().equals(aValue)) {
selectedBucket = bucket;
break;
}
}
if (selectedBucket != null) {
// store the name of the selected bucket for display purposes
node.setAttribute(ATTR_NAME, selectedBucket.getName());
// look for size and time estimates and apply if present
maybeStoreTimeEstimate(node, selectedBucket);
maybeStoreSizeEstimate(node, selectedBucket);
}
}
Aggregations