Skip to content

Commit

Permalink
Explorer fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tijsrademakers committed Dec 5, 2012
1 parent 6bb6a24 commit 462ae7d
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public interface BpmnXMLConstants {
// fake element for mail task
public static final String ELEMENT_TASK_MAIL = "mailTask";

public static final String ELEMENT_TASK = "task";
public static final String ELEMENT_TASK_BUSINESSRULE = "businessRuleTask";
public static final String ELEMENT_TASK_MANUAL = "manualTask";
public static final String ELEMENT_TASK_RECEIVE = "receiveTask";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public class BpmnXMLConverter implements BpmnXMLConstants {
addConverter(ScriptTaskXMLConverter.getXMLType(), ScriptTaskXMLConverter.getBpmnElementType(), ScriptTaskXMLConverter.class);
addConverter(ServiceTaskXMLConverter.getXMLType(), ServiceTaskXMLConverter.getBpmnElementType(), ServiceTaskXMLConverter.class);
addConverter(UserTaskXMLConverter.getXMLType(), UserTaskXMLConverter.getBpmnElementType(), UserTaskXMLConverter.class);
addConverter(TaskXMLConverter.getXMLType(), TaskXMLConverter.getBpmnElementType(), TaskXMLConverter.class);
addConverter(CallActivityXMLConverter.getXMLType(), CallActivityXMLConverter.getBpmnElementType(), CallActivityXMLConverter.class);

// gateways
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.bpmn.converter;

import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;

import org.activiti.bpmn.model.BaseElement;
import org.activiti.bpmn.model.ManualTask;

/**
* @author Tijs Rademakers
*/
public class TaskXMLConverter extends BaseBpmnXMLConverter {

public static String getXMLType() {
return ELEMENT_TASK;
}

public static Class<? extends BaseElement> getBpmnElementType() {
return ManualTask.class;
}

@Override
protected String getXMLElementName() {
return ELEMENT_TASK;
}

@Override
protected BaseElement convertXMLToElement(XMLStreamReader xtr) throws Exception {
ManualTask manualTask = new ManualTask();
parseChildElements(getXMLElementName(), manualTask, xtr);
return manualTask;
}

@Override
protected void writeAdditionalAttributes(BaseElement element, XMLStreamWriter xtw) throws Exception {

}

@Override
protected void writeAdditionalChildElements(BaseElement element, XMLStreamWriter xtw) throws Exception {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public AbstractProcessDefinitionDetailPanel(String processDefinitionId, Abstract
this.i18nManager = ExplorerApp.get().getI18nManager();

this.parentPage = parentPage;
this.processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(processDefinitionId).singleResult();
this.processDefinition = repositoryService.getProcessDefinition(processDefinitionId);

if(processDefinition != null) {
deployment = repositoryService.createDeploymentQuery().deploymentId(processDefinition.getDeploymentId()).singleResult();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
package org.activiti.explorer.ui.process;

import org.activiti.engine.form.StartFormData;
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity;
import org.activiti.explorer.ExplorerApp;
import org.activiti.explorer.Messages;
import org.activiti.explorer.ui.AbstractPage;
Expand Down Expand Up @@ -52,7 +53,7 @@ protected void initActions(AbstractPage parentPage) {
editProcessDefinitionButton = new Button(i18nManager.getMessage(Messages.PROCESS_CONVERT));
editProcessDefinitionButton.addListener(new ConvertProcessDefinitionToModelClickListener(processDefinition));

if(processDefinition.getDiagramResourceName() == null) {
if(((ProcessDefinitionEntity) processDefinition).isGraphicalNotationDefined() == false) {
editProcessDefinitionButton.setEnabled(false);
}

Expand Down

0 comments on commit 462ae7d

Please sign in to comment.