Java Reference
In-Depth Information
return process;
}
}
In addition, class WfActivityDefinition must read the access restriction tags
in the constructor and generate them in the toXML() method.
package ProcessDefinition;
public class WfActivityDefinition {
. . .
Vector restrictions # new Vector();
WfActivityDefinition(Element activity, Map participants,
Map data){
. . .
// data access restrictions
restrs # activity.getElementsByTagName("RESTRICT_TO");
int i;
for (i # 0; i<restrs.getLength(); !! i){
Element restr # (Element)restrs.item(i);
WfDataDefinition d # (WfDataDefinition)
data.get( restr.getAttribute("REF"));
WfAccessRestriction restriction #
new WfAccessRestriction
(d,restr.hasAttribute("READ_ONLY"));
restrictions.add(restriction);
}
}
public Element toXML(Document doc){
. . .
Iterator it # restrictions.iterator();
while (it.hasNext()){
WfAccessRestriction restriction #
(WfAccessRestriction)it.next();
activity.appendChild(restriction.toXML(doc));
}
return activity;
}
}
To use the data during the enactment the class WfProcessImpl must create
the context on the basis of the workflow data declared in the process defi-
nition. Since we do not know in advance the types of the workflow data, we
instantiate the values of the context using reflection: we look for a class
having the same name as the data type, if no such a class exists then a String
is instantiated.
package WfEngine;
...
public class WfProcessImpl
Search WWH ::




Custom Search