Skip to content

Commit

Permalink
Custom Taskmetadata : Solved the case sensitive issue and the multino…
Browse files Browse the repository at this point in the history
…de issue
  • Loading branch information
Sandeep committed Oct 31, 2011
1 parent 01e4cc3 commit d3908e8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import com.intalio.bpms.workflow.taskManagementServices20051109.Attachments;
Expand Down Expand Up @@ -558,14 +559,22 @@ private Task unmarshalFullTask(XmlObject rootElement) throws InvalidInputFormatE
int elements = list.getLength();
for (int j = 0 ; j < elements ; j++) {
// System.out.println("NodeName : " + list.item(j).getNodeName() + " NodeValue : " + list.item(j).getFirstChild().getNodeValue());
customMetadata.put(list.item(j).getNodeName(), list.item(j).getFirstChild().getNodeValue());
if(list.item(j).getFirstChild() != null)
customMetadata.put(list.item(j).getNodeName().toLowerCase(), getTextNodeValue(list.item(j)));
}
((ITaskWithCustomMetadata) resultTask).setCustomMetadata(customMetadata);
}

return resultTask;
}

private String getTextNodeValue(Node node) {
if (node.getChildNodes().getLength() > 0) {
return getTextNodeValue(node.getFirstChild());
}
return node.getNodeValue();
}

/**
* Xmlbeans is wrapping the content with some <code>xml-fragment</code> tag
* Position the cursor on the data we really want.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,13 @@ private List<String> getCustomColumns(String token){
try {
customColumns = taskManager.getCustomColumns();
} catch (AuthException e) {
_log.debug( "Not avalid token" + e);
_log.debug( "Not a valid token" + e);
}
return customColumns;
List<String> customColumnsLowerCase = new ArrayList<String>();
for(String customColumn : customColumns){
customColumnsLowerCase.add(customColumn.toLowerCase());
}

return customColumnsLowerCase;
}
}

0 comments on commit d3908e8

Please sign in to comment.