Commit a161660c by tiger

entity

1 parent a51bbc0f
*/target/
*/.settings/
*/.factorypath
.classpath
.settings/org.eclipse.core.resources.prefs
.project
**target/
**.settings/
**.factorypath
**.classpath
**.settings/org.eclipse.core.resources.prefs
**.project
*.prefs
*.component
.settings/org.eclipse.wst.common.project.facet.core.xml
......
package cn.com.glsx.process.modules.entity;
public class SopTpl {
}
/*
* @Copyright (c) 2018 缪聪(mcg-helper@qq.com)
*
* 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 cn.com.glsx.process.modules.enums;
public enum NodeTypeEnum {
START("开始控件", "start", (new SopNodeStart()).getClass()), //
// DATA("data控件", "data", (new FlowData()).getClass()), //
// SCRIPT("js脚本控件", "script", (new FlowScript()).getClass()), //
JAVA("java控件", "java", (new FlowJava()).getClass()), //
// PYTHON("python控件", "python", (new FlowPython()).getClass()), //
// LINUX("linux控件", "linux", (new FlowLinux()).getClass()), //
// WONTON("混沌控件", "wonton", (new FlowWonton()).getClass()), //
// SQLQUERY("sql查询控件", "sqlQuery", (new FlowSqlQuery()).getClass()), //
// SQLEXECUTE("sql执行控件", "sqlExecute", (new FlowSqlExecute()).getClass()), //
// LOOP("循环", "loop", (new FlowLoop()).getClass()), //
// PROCESS("子流程", "process", (new FlowProcess()).getClass()), //
END("结束控件", "end", (new FlowEnd()).getClass()),//
// DEMO("示例控件", "demo", (new FlowDemo()).getClass()), //
;
private String name;
private String value;
private Class<?> classes;
private NodeTypeEnum(String name, String value, Class<?> classes) {
this.name = name;
this.value = value;
this.classes = classes;
}
public static String getValueByName(String name) {
for (NodeTypeEnum c : NodeTypeEnum.values()) {
if (c.getName().equals(name)) {
return c.value;
}
}
return null;
}
public static String getNameByValue(String value) {
for (NodeTypeEnum c : NodeTypeEnum.values()) {
if (c.getValue().equals(value)) {
return c.name;
}
}
return null;
}
public static Class<?> getClassByValue(String value) {
for (NodeTypeEnum c : NodeTypeEnum.values()) {
if (c.getValue().equals(value)) {
return c.classes;
}
}
return null;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public Class<?> getClasses() {
return classes;
}
public void setClasses(Class<?> classes) {
this.classes = classes;
}
}
\ No newline at end of file
package cn.com.glsx.process.modules.model.sop;
import lombok.Data;
@Data
public class Sop {
/** SOP模板 */
private Object sopTpl;
/** SOP授权 */
private Object sopGrant;
/** SOP实例 */
private Object sopInst;
/** SOP批次 */
private Object sopBatch;
}
package cn.com.glsx.process.modules.model.sop;
import java.util.ArrayList;
import com.mcg.entity.generate.ExecuteStruct;
import com.mcg.entity.generate.RunResult;
public abstract class SopNodeBase {
private static final long serialVersionUID = 8626194290037166978L;
// 各个基本方法执行的顺序
private ArrayList<String> sequence = new ArrayList<String>();
// 准备工作
public abstract void prepare(ArrayList<String> sequence, ExecuteStruct executeStruct) throws Exception;
// 执行组件算法
public abstract RunResult execute(ExecuteStruct executeStruct) throws Exception;
}
/*
* @Copyright (c) 2018 缪聪(mcg-helper@qq.com)
*
* 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 cn.com.glsx.process.modules.model.sop.start;
import java.util.ArrayList;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import org.hibernate.validator.constraints.NotEmpty;
import com.mcg.common.sysenum.EletypeEnum;
import com.mcg.entity.generate.ExecuteStruct;
import com.mcg.entity.generate.RunResult;
import com.mcg.plugin.execute.ProcessContext;
import com.mcg.plugin.execute.strategy.FlowStartStrategy;
import cn.com.glsx.process.modules.model.sop.SopNodeBase;
@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement
public class SopNodeStart extends SopNodeBase {
private static final long serialVersionUID = -5856043204850132040L;
@NotNull(message = "{flowStart.startId.null}")
@NotEmpty(message = "{flowStart.startId.empty}")
@XmlAttribute
private String startId;
@Valid
@NotNull(message = "{flowStart.startProperty.null}")
@XmlElement
private StartProperty startProperty;
@Override
public void prepare(ArrayList<String> sequence, ExecuteStruct executeStruct) throws Exception {
this.setFlowId(executeStruct.getFlowId());
this.setMcgWebScoketCode(executeStruct.getMcgWebScoketCode());
this.setOrderNum(executeStruct.getOrderNum());
this.setEletypeEnum(EletypeEnum.START);
ProcessContext processContext = new ProcessContext();
processContext.setProcessStrategy(new FlowStartStrategy());
processContext.prepare(sequence, this, executeStruct);
}
@Override
public RunResult execute(ExecuteStruct executeStruct) throws Exception {
ProcessContext processContext = new ProcessContext();
processContext.setProcessStrategy(new FlowStartStrategy());
RunResult runResult = processContext.run(this, executeStruct);
return runResult;
}
public String getStartId() {
return startId;
}
public void setStartId(String startId) {
this.startId = startId;
}
public StartProperty getStartProperty() {
return startProperty;
}
public void setStartProperty(StartProperty startProperty) {
this.startProperty = startProperty;
}
}
\ No newline at end of file
/*
* @Copyright (c) 2018 缪聪(mcg-helper@qq.com)
*
* 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 cn.com.glsx.process.modules.model.sop.start;
import java.io.Serializable;
import java.util.List;
import javax.validation.Valid;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement
public class StartProperty implements Serializable {
private static final long serialVersionUID = -6831068936775340739L;
@Valid
@XmlElement
private List<Var> var;
public List<Var> getVar() {
return var;
}
public void setVar(List<Var> var) {
this.var = var;
}
}
/*
* @Copyright (c) 2018 缪聪(mcg-helper@qq.com)
*
* 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 cn.com.glsx.process.modules.model.sop.start;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement
public class Var implements Serializable {
private static final long serialVersionUID = -3905729931199785787L;
// @NotBlank(message = "{flowStart.startProperty.var.key.notBlank}")
@XmlAttribute
private String key;
// @NotBlank(message = "{flowStart.startProperty.var.value.notBlank}")
@XmlAttribute
private String value;
@XmlAttribute
private String desc;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}
package cn.com.glsx.process.modules.model.tpl;
import lombok.Data;
@Data
public class SopTplVO {
private Object sopTpl;
}
......@@ -48,7 +48,8 @@
</plugin>
</plugins>
</build>
<modules>
<modules>
<module>platform-process</module>
<module>platform-process-api</module>
</modules>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!