Problem with generate process diagram

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2011 04:54 AM
Hi all,
I want to generate a process diagram.
So I use the activiti-modeler to generate a simple process defination xml file.
It only include a start component, a end component and a sendTask
Then I deploy it,but it runs error.
I want to generate a process diagram.
So I use the activiti-modeler to generate a simple process defination xml file.
It only include a start component, a end component and a sendTask
Then I deploy it,but it runs error.
Attribute 'operation' is not allowed to appear in element 'sendTask'. | com/workflow/process/EmailTest.bpmn20.xml | line 21 | column 90One of the attributes 'type' or 'operation' is mandatory on sendTask.
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2011 05:36 AM
I've created a Jira for it, because I suspect a bug: http://jira.codehaus.org/browse/ACT-503

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2011 01:50 AM
I've created a Jira for it, because I suspect a bug: http://jira.codehaus.org/browse/ACT-503
Thanks jbarrez!
I checked the source code,and found the issue code which in
org.activiti.engine.impl.bpmn.parser.BpmnParse.parseSendTask
public void parseSendTask(Element sendTaskElement, ScopeImpl scope) {
ActivityImpl activity = parseAndCreateActivityOnScopeElement(sendTaskElement, scope);
System.out.println(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS);
// for e-mail
String type = sendTaskElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "type");
// String type = "mail";
// for web service
String implementation = sendTaskElement.attribute("implementation");
String operationRef = this.resolveName(sendTaskElement.attribute("operationRef"));
// for e-mail
if (type != null) {
if (type.equalsIgnoreCase("mail")) {
parseEmailServiceTask(activity, sendTaskElement, parseFieldDeclarations(sendTaskElement));
} else {
addError("Invalid usage of type attribute: '" + type + "'", sendTaskElement);
}
// for web service
} else if (implementation != null && operationRef != null && implementation.equalsIgnoreCase("##WebService")) {
if (!this.operations.containsKey(operationRef)) {
addError(operationRef + " does not exist" , sendTaskElement);
} else {
Operation operation = this.operations.get(operationRef);
WebServiceActivityBehavior webServiceActivityBehavior = new WebServiceActivityBehavior(operation);
Element ioSpecificationElement = sendTaskElement.element("ioSpecification");
if (ioSpecificationElement != null) {
IOSpecification ioSpecification = this.parseIOSpecification(ioSpecificationElement);
webServiceActivityBehavior.setIoSpecification(ioSpecification);
}
for (Element dataAssociationElement : sendTaskElement.elements("dataInputAssociation")) {
AbstractDataInputAssociation dataAssociation = this.parseDataInputAssociation(dataAssociationElement);
webServiceActivityBehavior.addDataInputAssociation(dataAssociation);
}
for (Element dataAssociationElement : sendTaskElement.elements("dataOutputAssociation")) {
AbstractDataOutputAssociation dataAssociation = this.parseDataOutputAssociation(dataAssociationElement);
webServiceActivityBehavior.addDataOutputAssociation(dataAssociation);
}
activity.setActivityBehavior(webServiceActivityBehavior);
}
} else {
addError("One of the attributes 'type' or 'operation' is mandatory on sendTask.", sendTaskElement);
}
parseExecutionListenersOnScope(sendTaskElement, activity);
for (BpmnParseListener parseListener: parseListeners) {
parseListener.parseSendTask(sendTaskElement, scope, activity);
}
}
It seems something wrong for the "type" variable.The result is null,
When I edit it to String type = "mail" ;
It will run successful.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2011 12:28 PM
Okay, now I understand. Then the error message is correct: currently Activiti supports using the sendTask for sending an email or calling a webservice. When you don't provide a type, it will default to webservice, where an operation definition is required.
