-
1. Re: How to get the type of a task value in jBPM 6?
pschaefer Apr 28, 2015 7:46 AM (in response to pschaefer)I found the code, where the task inputs and outputs are set. It can be found in the class HumanTaskGetInformationHandler. In my opinion the mapping of the inputParams and outputParams maps at the end are unnecessary or is there the mapping between porcess values and task values missing? What do you think?
@Override
protected void readIoSpecification(org.w3c.dom.Node xmlNode,
Map<String, String> dataInputs, Map<String, String> dataOutputs) {
dataInputs.clear();
dataOutputs.clear();
org.w3c.dom.Node subNode = xmlNode.getFirstChild();
while (subNode instanceof Element) {
String subNodeName = subNode.getNodeName();
if ("dataInput".equals(subNodeName)) {
String id = ((Element) subNode).getAttribute("id");
String inputName = ((Element) subNode).getAttribute("name");
dataInputs.put(id, inputName);
}
if ("dataOutput".equals(subNodeName)) {
String id = ((Element) subNode).getAttribute("id");
String outputName = ((Element) subNode).getAttribute("name");
dataOutputs.put(id, outputName);
}
subNode = subNode.getNextSibling();
}
NamedNodeMap map = xmlNode.getParentNode().getAttributes();
Node nodeName = map.getNamedItem("name");
String name = nodeName.getNodeValue();
String mainProcessId = module.getRepoHelper().getProcess().getId();
UserTaskDefinitionImpl task = (UserTaskDefinitionImpl)repository.getProcessDesc(mainProcessId).getTasks().get(name);
if (task == null) {
task = new UserTaskDefinitionImpl();
task.setName(name);
repository.getProcessDesc(mainProcessId).getTasks().put(task.getName(), task);
}
Map<String, String> inputParams = new HashMap<String, String>();
for (Map.Entry<String, String> in : dataInputs.entrySet()) {
inputParams.put(in.getKey(), in.getValue());
}
Map<String, String> outputParams = new HashMap<String, String>();
for (Map.Entry<String, String> out : dataOutputs.entrySet()) {
outputParams.put(out.getKey(), out.getValue());
}
task.setTaskInputMappings(inputParams);
task.setTaskOutputMappings(outputParams);
task.setComment(inputParams.get("Comment"));
task.setCreatedBy(inputParams.get("CreatedBy"));
task.setPriority(getInteger(inputParams.get("Priority")));
task.setSkippable("true".equalsIgnoreCase(inputParams.get("Skippable")));
repository.getProcessDesc(mainProcessId).getTaskInputMappings().put(task.getName(), inputParams);
repository.getProcessDesc(mainProcessId).getTaskOutputMappings().put(task.getName(), outputParams);
}
-
2. Re: How to get the type of a task value in jBPM 6?
swiderski.maciej May 4, 2015 4:47 AM (in response to pschaefer)this has been added as part of jira JBPM-4608 and will go out with 6.3. Commit for this can be found here. If you would like to take advantage of it earlier then you would need to use latest snapshot version.
HTH
-
3. Re: How to get the type of a task value in jBPM 6?
pschaefer May 4, 2015 5:50 AM (in response to swiderski.maciej)Thank you Maciej! That's exactly what I have been looking for!
-
4. Re: How to get the type of a task value in jBPM 6?
jimmy001 May 5, 2015 6:43 AM (in response to pschaefer)Hi!
That is all good and great you have solved your problem, but is there a way to get the task variable => process variable mapping? Currently the result returns a mapping from variable name to variable type.
What I would expect is a result which includes the information from "bpmn2:dataInputAssociation" which decribes the mapping from task variable => process variable.
Is there anything like this?
Thx