提交 fb5caea7 编写于 作者: F Frederik Heremans

Deprecating MAX and MIN values for priority on Task, moved to explorer

上级 1f06e3da
......@@ -64,7 +64,7 @@ public class TaskEntity extends VariableScopeImpl implements Task, DelegateTask,
protected String name;
protected String description;
protected int priority = Task.PRIORITY_NORMAL;
protected int priority = DEFAULT_PRIORITY;
protected Date createTime; // The time when the task has been created
protected Date dueDate;
protected int suspensionState = SuspensionState.ACTIVE.getStateCode();
......
......@@ -21,9 +21,24 @@ import java.util.Date;
* @author Joram Barrez
*/
public interface Task {
/**
* Default value used for priority when a new {@link Task} is created.
*/
int DEFAULT_PRIORITY = 50;
/**
* @deprecated Will be removed in 5.13
*/
int PRIORITY_MINIUM = 0;
/**
* @deprecated Will be removed in 5.13
*/
int PRIORITY_NORMAL = 50;
/**
* @deprecated Will be removed in 5.13
*/
int PRIORITY_MAXIMUM = 100;
/** DB id of the task. */
......
......@@ -44,6 +44,11 @@ public class Constants {
// Default diagram image extension, when name cannot be deducted from resource name
public static final String DEFAULT_DIAGRAM_IMAGE_EXTENSION = "png";
// Task priority values
public static final int TASK_PRIORITY_LOW = 0;
public static final int TASK_PRIORITY_MEDIUM = 50;
public static final int TASK_PRIORITY_HIGH = 100;
// MIMETYPES
public static final String MIMETYPE_BPM = "image/bpm";
public static final String MIMETYPE_GIF = "image/gif";
......
......@@ -15,6 +15,7 @@ package org.activiti.explorer.ui.task;
import java.util.Arrays;
import org.activiti.engine.task.Task;
import org.activiti.explorer.Constants;
import org.activiti.explorer.I18nManager;
import org.activiti.explorer.Messages;
......@@ -52,11 +53,11 @@ public class PriorityComboBox extends ComboBox {
public int getPriority() {
String value = getValue().toString();
if (i18nManager.getMessage(Messages.TASK_PRIORITY_LOW).equals(value)) {
return Task.PRIORITY_MINIUM;
return Constants.TASK_PRIORITY_LOW;
} else if (i18nManager.getMessage(Messages.TASK_PRIORITY_MEDIUM).equals(value)) {
return Task.PRIORITY_NORMAL;
return Constants.TASK_PRIORITY_MEDIUM;
} else {
return Task.PRIORITY_MAXIMUM;
return Constants.TASK_PRIORITY_HIGH;
}
}
......
......@@ -13,6 +13,7 @@
package org.activiti.explorer.ui.task;
import org.activiti.engine.task.Task;
import org.activiti.explorer.Constants;
import org.activiti.explorer.I18nManager;
import org.activiti.explorer.Messages;
import org.activiti.explorer.ui.mainlayout.ExplorerLayout;
......@@ -47,13 +48,13 @@ public class PriorityLabel extends Label {
public void setValue(Object newValue) {
if (newValue instanceof Integer) {
priority = (Integer) newValue;
if (priority < Task.PRIORITY_NORMAL) {
if (priority < Constants.TASK_PRIORITY_MEDIUM) {
super.setValue(i18nManager.getMessage(Messages.TASK_PRIORITY_LOW));
addStyleName(ExplorerLayout.STYLE_TASK_HEADER_PRIORITY_LOW);
} else if (priority == Task.PRIORITY_NORMAL) {
} else if (priority == Constants.TASK_PRIORITY_MEDIUM) {
super.setValue(i18nManager.getMessage(Messages.TASK_PRIORITY_MEDIUM));
addStyleName(ExplorerLayout.STYLE_TASK_HEADER_PRIORITY_MEDIUM);
} else if (priority > Task.PRIORITY_NORMAL) {
} else if (priority > Constants.TASK_PRIORITY_MEDIUM) {
super.setValue(i18nManager.getMessage(Messages.TASK_PRIORITY_HIGH));
addStyleName(ExplorerLayout.STYLE_TASK_HEADER_PRIORITY_HIGH);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册