提交 5009281c 编写于 作者: R Ray

将customData移动到activity下

上级 3ccddf5d
......@@ -235,7 +235,6 @@ class V2GetWorkOrWorkCompleted extends BaseAction {
Activity activity = business.getActivity(work);
if (null != activity) {
activity.copyTo(woActivity);
woActivity.setCustomData(activity.getCustomData());
wo.setActivity(woActivity);
if (Objects.equals(ActivityType.manual, activity.getActivityType())) {
wo.setRouteList(WoRoute.copier.copy(business.route().pick(((Manual) activity).getRouteList())));
......
......@@ -122,6 +122,8 @@ public abstract class Activity extends SliceJpaObject {
public abstract JsonElement getCustomData();
public abstract void setCustomData(JsonElement customData);
public ActivityType getActivityType() throws Exception {
if (this instanceof Agent) {
return ActivityType.agent;
......
......@@ -13,6 +13,7 @@ import javax.persistence.InheritanceType;
import javax.persistence.Lob;
import javax.persistence.OrderColumn;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
import org.apache.commons.lang3.StringUtils;
......@@ -90,11 +91,21 @@ public class Agent extends Activity {
this.properties = new AgentProperties();
}
public static final String CUSTOMDATA_FIELDNAME = "customData";
@Transient
private JsonElement customData;
@Override
public JsonElement getCustomData() {
return this.getProperties().getCustomData();
}
@Override
public void setCustomData(JsonElement customData) {
this.customData = customData;
this.properties.setCustomData(customData);
}
@FieldDescribe("分组")
@CheckPersist(allowEmpty = true)
@Column(length = JpaObject.length_255B, name = ColumnNamePrefix + group_FIELDNAME)
......
......@@ -13,7 +13,9 @@ import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Lob;
import javax.persistence.OrderColumn;
import javax.persistence.PostLoad;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
import org.apache.commons.lang3.StringUtils;
......@@ -73,6 +75,13 @@ public class Application extends SliceJpaObject {
this.applicationCategory = StringUtils.trimToEmpty(this.applicationCategory);
}
@PostLoad
public void postLoad() {
if (null != this.properties) {
this.defaultForm = this.getProperties().getDefaultForm();
}
}
public ApplicationProperties getProperties() {
if (null == this.properties) {
this.properties = new ApplicationProperties();
......@@ -90,6 +99,20 @@ public class Application extends SliceJpaObject {
/* Entity 默认字段结束 */
public static final String DEFAULTFORM_FIELDNAME = "defaultForm";
@FieldDescribe("应用默认表单.")
@Transient
private String defaultForm;
public String getDefaultForm() {
return this.getProperties().getDefaultForm();
}
public void setDefaultForm(String defaultForm) {
this.defaultForm = defaultForm;
this.getProperties().setDefaultForm(defaultForm);
}
public static final String name_FIELDNAME = "name";
@Flag
@FieldDescribe("名称.")
......
......@@ -13,6 +13,7 @@ import javax.persistence.InheritanceType;
import javax.persistence.Lob;
import javax.persistence.OrderColumn;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
import org.apache.commons.lang3.StringUtils;
......@@ -90,11 +91,21 @@ public class Begin extends Activity {
this.properties = new BeginProperties();
}
public static final String CUSTOMDATA_FIELDNAME = "customData";
@Transient
private JsonElement customData;
@Override
public JsonElement getCustomData() {
return this.getProperties().getCustomData();
}
@Override
public void setCustomData(JsonElement customData) {
this.customData = customData;
this.properties.setCustomData(customData);
}
@FieldDescribe("分组")
@CheckPersist(allowEmpty = true)
@Column(length = JpaObject.length_255B, name = ColumnNamePrefix + group_FIELDNAME)
......
......@@ -13,6 +13,7 @@ import javax.persistence.InheritanceType;
import javax.persistence.Lob;
import javax.persistence.OrderColumn;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
import org.apache.openjpa.persistence.Persistent;
......@@ -83,11 +84,21 @@ public class Cancel extends Activity {
this.properties = new CancelProperties();
}
public static final String CUSTOMDATA_FIELDNAME = "customData";
@Transient
private JsonElement customData;
@Override
public JsonElement getCustomData() {
return this.getProperties().getCustomData();
}
@Override
public void setCustomData(JsonElement customData) {
this.customData = customData;
this.properties.setCustomData(customData);
}
@FieldDescribe("分组")
@CheckPersist(allowEmpty = true)
@Column(length = JpaObject.length_255B, name = ColumnNamePrefix + group_FIELDNAME)
......
......@@ -13,6 +13,7 @@ import javax.persistence.InheritanceType;
import javax.persistence.Lob;
import javax.persistence.OrderColumn;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
import org.apache.openjpa.persistence.Persistent;
......@@ -80,11 +81,21 @@ public class Choice extends Activity {
this.properties = new ChoiceProperties();
}
public static final String CUSTOMDATA_FIELDNAME = "customData";
@Transient
private JsonElement customData;
@Override
public JsonElement getCustomData() {
return this.getProperties().getCustomData();
}
@Override
public void setCustomData(JsonElement customData) {
this.customData = customData;
this.properties.setCustomData(customData);
}
@FieldDescribe("分组")
@CheckPersist(allowEmpty = true)
@Column(length = JpaObject.length_255B, name = ColumnNamePrefix + group_FIELDNAME)
......
......@@ -16,6 +16,7 @@ import javax.persistence.InheritanceType;
import javax.persistence.Lob;
import javax.persistence.OrderColumn;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
import org.apache.commons.lang3.StringUtils;
......@@ -92,11 +93,21 @@ public class Delay extends Activity {
this.properties = new DelayProperties();
}
public static final String CUSTOMDATA_FIELDNAME = "customData";
@Transient
private JsonElement customData;
@Override
public JsonElement getCustomData() {
return this.getProperties().getCustomData();
}
@Override
public void setCustomData(JsonElement customData) {
this.customData = customData;
this.properties.setCustomData(customData);
}
@FieldDescribe("分组")
@CheckPersist(allowEmpty = true)
@Column(length = JpaObject.length_255B, name = ColumnNamePrefix + group_FIELDNAME)
......
......@@ -15,8 +15,18 @@ import javax.persistence.InheritanceType;
import javax.persistence.Lob;
import javax.persistence.OrderColumn;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
import org.apache.commons.lang3.StringUtils;
import org.apache.openjpa.persistence.Persistent;
import org.apache.openjpa.persistence.PersistentCollection;
import org.apache.openjpa.persistence.jdbc.ContainerTable;
import org.apache.openjpa.persistence.jdbc.ElementColumn;
import org.apache.openjpa.persistence.jdbc.ElementIndex;
import org.apache.openjpa.persistence.jdbc.Index;
import org.apache.openjpa.persistence.jdbc.Strategy;
import com.google.gson.JsonElement;
import com.x.base.core.entity.AbstractPersistenceProperties;
import com.x.base.core.entity.JpaObject;
......@@ -28,15 +38,6 @@ import com.x.base.core.project.annotation.FieldDescribe;
import com.x.base.core.project.tools.ListTools;
import com.x.processplatform.core.entity.PersistenceProperties;
import org.apache.commons.lang3.StringUtils;
import org.apache.openjpa.persistence.Persistent;
import org.apache.openjpa.persistence.PersistentCollection;
import org.apache.openjpa.persistence.jdbc.ContainerTable;
import org.apache.openjpa.persistence.jdbc.ElementColumn;
import org.apache.openjpa.persistence.jdbc.ElementIndex;
import org.apache.openjpa.persistence.jdbc.Index;
import org.apache.openjpa.persistence.jdbc.Strategy;
@Entity
@ContainerEntity(dumpSize = 5, type = ContainerEntity.Type.element, reference = ContainerEntity.Reference.strong)
@Table(name = PersistenceProperties.Element.Embed.table, uniqueConstraints = {
......@@ -94,11 +95,21 @@ public class Embed extends Activity {
this.properties = new EmbedProperties();
}
public static final String CUSTOMDATA_FIELDNAME = "customData";
@Transient
private JsonElement customData;
@Override
public JsonElement getCustomData() {
return this.getProperties().getCustomData();
}
@Override
public void setCustomData(JsonElement customData) {
this.customData = customData;
this.properties.setCustomData(customData);
}
@FieldDescribe("分组")
@CheckPersist(allowEmpty = true)
@Column(length = JpaObject.length_255B, name = ColumnNamePrefix + group_FIELDNAME)
......
......@@ -13,6 +13,7 @@ import javax.persistence.InheritanceType;
import javax.persistence.Lob;
import javax.persistence.OrderColumn;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
import org.apache.openjpa.persistence.Persistent;
......@@ -83,11 +84,21 @@ public class End extends Activity {
this.properties = new EndProperties();
}
public static final String CUSTOMDATA_FIELDNAME = "customData";
@Transient
private JsonElement customData;
@Override
public JsonElement getCustomData() {
return this.getProperties().getCustomData();
}
@Override
public void setCustomData(JsonElement customData) {
this.customData = customData;
this.properties.setCustomData(customData);
}
@FieldDescribe("分组")
@CheckPersist(allowEmpty = true)
@Column(length = JpaObject.length_255B, name = ColumnNamePrefix + group_FIELDNAME)
......
......@@ -15,6 +15,7 @@ import javax.persistence.InheritanceType;
import javax.persistence.Lob;
import javax.persistence.OrderColumn;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
import org.apache.commons.lang3.StringUtils;
......@@ -92,11 +93,21 @@ public class Invoke extends Activity {
this.properties = new InvokeProperties();
}
public static final String CUSTOMDATA_FIELDNAME = "customData";
@Transient
private JsonElement customData;
@Override
public JsonElement getCustomData() {
return this.getProperties().getCustomData();
}
@Override
public void setCustomData(JsonElement customData) {
this.customData = customData;
this.properties.setCustomData(customData);
}
@FieldDescribe("分组")
@CheckPersist(allowEmpty = true)
@Column(length = JpaObject.length_255B, name = ColumnNamePrefix + group_FIELDNAME)
......
......@@ -87,11 +87,21 @@ public class Manual extends Activity {
this.properties = properties;
}
public static final String CUSTOMDATA_FIELDNAME = "customData";
@Transient
private JsonElement customData;
@Override
public JsonElement getCustomData() {
return this.getProperties().getCustomData();
}
@Override
public void setCustomData(JsonElement customData) {
this.customData = customData;
this.properties.setCustomData(customData);
}
@FieldDescribe("分组.")
@CheckPersist(allowEmpty = true)
@Column(length = JpaObject.length_255B, name = ColumnNamePrefix + group_FIELDNAME)
......
......@@ -13,6 +13,7 @@ import javax.persistence.InheritanceType;
import javax.persistence.Lob;
import javax.persistence.OrderColumn;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
import org.apache.commons.lang3.StringUtils;
......@@ -89,11 +90,21 @@ public class Merge extends Activity {
this.properties = new MergeProperties();
}
public static final String CUSTOMDATA_FIELDNAME = "customData";
@Transient
private JsonElement customData;
@Override
public JsonElement getCustomData() {
return this.getProperties().getCustomData();
}
@Override
public void setCustomData(JsonElement customData) {
this.customData = customData;
this.properties.setCustomData(customData);
}
@FieldDescribe("分组")
@CheckPersist(allowEmpty = true)
@Column(length = JpaObject.length_255B, name = ColumnNamePrefix + group_FIELDNAME)
......
......@@ -13,6 +13,7 @@ import javax.persistence.InheritanceType;
import javax.persistence.Lob;
import javax.persistence.OrderColumn;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
import org.apache.openjpa.persistence.Persistent;
......@@ -66,11 +67,21 @@ public class Parallel extends Activity {
// nothing
}
public static final String CUSTOMDATA_FIELDNAME = "customData";
@Transient
private JsonElement customData;
@Override
public JsonElement getCustomData() {
return this.getProperties().getCustomData();
}
@Override
public void setCustomData(JsonElement customData) {
this.customData = customData;
this.properties.setCustomData(customData);
}
public ParallelProperties getProperties() {
if (null == this.properties) {
this.properties = new ParallelProperties();
......
......@@ -13,6 +13,7 @@ import javax.persistence.InheritanceType;
import javax.persistence.Lob;
import javax.persistence.OrderColumn;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
import org.apache.commons.lang3.StringUtils;
......@@ -89,11 +90,21 @@ public class Service extends Activity {
this.properties = new ServiceProperties();
}
public static final String CUSTOMDATA_FIELDNAME = "customData";
@Transient
private JsonElement customData;
@Override
public JsonElement getCustomData() {
return this.getProperties().getCustomData();
}
@Override
public void setCustomData(JsonElement customData) {
this.customData = customData;
this.properties.setCustomData(customData);
}
@FieldDescribe("分组")
@CheckPersist(allowEmpty = true)
@Column(length = JpaObject.length_255B, name = ColumnNamePrefix + group_FIELDNAME)
......
......@@ -13,6 +13,7 @@ import javax.persistence.InheritanceType;
import javax.persistence.Lob;
import javax.persistence.OrderColumn;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
import org.apache.commons.lang3.StringUtils;
......@@ -93,11 +94,21 @@ public class Split extends Activity {
this.properties = new SplitProperties();
}
public static final String CUSTOMDATA_FIELDNAME = "customData";
@Transient
private JsonElement customData;
@Override
public JsonElement getCustomData() {
return this.getProperties().getCustomData();
}
@Override
public void setCustomData(JsonElement customData) {
this.customData = customData;
this.properties.setCustomData(customData);
}
@FieldDescribe("分组")
@CheckPersist(allowEmpty = true)
@Column(length = JpaObject.length_255B, name = ColumnNamePrefix + group_FIELDNAME)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册