}
int index = 0;
for (Iterator formParamIter = subFlowFormalParams.iterator();
formParamIter.hasNext(); index ++) {
Element fpElem = (Element)formParamIter.next();
FormalParameter fp = new FormalParameter
(fpElem.getAttributeValue("Id"), Integer.toString(index),
FormalParameter.Mode.fromString
(fpElem.getAttributeValue("Mode")),
XPDLUtil.extractDataType
(fpElem.getChild("DataType", xpdlns)));
String actParam = ((String)actualParams.get(index)).trim();
if (callerFpMap.containsKey(actParam)) {
// check the mode of the formal parameter of the calling
// process
String callerParamMode = (String)callerFpMap.get(actParam);
if (callerParamMode.indexOf(fp.mode().toString()) == -1){
eh.add (new PrioritizedMessage
(PrioritizedMessage.Priority.ERROR, bundleBase
+ "#procdef.activity.subflow.parammode.notmatched",
new Object [] {
subFlowId, actParam, callerParamMode,
fp.mode().toString(), activityId,
processId}));
return false;
}
}
if (procdataMap.containsKey(actParam)) {
boolean compat = true;
if (fp.mode().equals(FormalParameter.Mode.IN)
|| fp.mode().equals(FormalParameter.Mode.INOUT)) {
compat = typeCompatible
(fp.type(), XPDLUtil.extractDataType
(((ProcData)procdataMap.get(actParam)).dataType));
}
if (fp.mode().equals(FormalParameter.Mode.OUT)
|| fp.mode().equals(FormalParameter.Mode.INOUT)) {
compat = compat && typeCompatible
(XPDLUtil.extractDataType
(((ProcData)procdataMap.get(actParam)).dataType),
fp.type());
}
if (!compat) {
String[] errDatas = {subFlowId, activityId, processId};
eh.add (new PrioritizedMessage
(PrioritizedMessage.Priority.ERROR, bundleBase
+ "#procdef.activity.subflow"
+ ".paramdatatype.notmatched", errDatas));
return false;
}
} else {
if (fp.mode() != FormalParameter.Mode.IN) {
eh.add
(new PrioritizedMessage
(PrioritizedMessage.Priority.ERROR, bundleBase
+ "#procdef.activity.subflow.datanotfound",
new Object[] {subFlowId, actParam, activityId,
processId}));
return false;
}
if (XPDLUtil.isXMLType (fp.type())) {
String res = notXMLOrValid (actParam);
if (res != null) {
eh.add
(new PrioritizedMessage
(PrioritizedMessage.Priority.ERROR, bundleBase