Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
platform
/
platform-process-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a161660c
authored
Sep 08, 2023
by
tiger
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
entity
1 parent
a51bbc0f
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
349 additions
and
7 deletions
.gitignore
platform-process-api/src/main/java/cn/com/glsx/process/modules/entity/SopTpl.java
platform-process-api/src/main/java/cn/com/glsx/process/modules/enums/NodeTypeEnum.java
platform-process-api/src/main/java/cn/com/glsx/process/modules/model/sop/Sop.java
platform-process-api/src/main/java/cn/com/glsx/process/modules/model/sop/SopNodeBase.java
platform-process-api/src/main/java/cn/com/glsx/process/modules/model/sop/start/SopNodeStart.java
platform-process-api/src/main/java/cn/com/glsx/process/modules/model/sop/start/StartProperty.java
platform-process-api/src/main/java/cn/com/glsx/process/modules/model/sop/start/Var.java
platform-process-api/src/main/java/cn/com/glsx/process/modules/model/tpl/SopTplVO.java
pom.xml
.gitignore
View file @
a161660
*
/
target/
*
*
target/
*
/
.settings/
*
*
.settings/
*
/
.factorypath
*
*
.factorypath
.classpath
**
.classpath
.settings/org.eclipse.core.resources.prefs
**
.settings/org.eclipse.core.resources.prefs
.project
**
.project
*.prefs
*.prefs
*.component
*.component
.settings/org.eclipse.wst.common.project.facet.core.xml
.settings/org.eclipse.wst.common.project.facet.core.xml
...
...
platform-process-api/src/main/java/cn/com/glsx/process/modules/entity/SopTpl.java
0 → 100644
View file @
a161660
package
cn
.
com
.
glsx
.
process
.
modules
.
entity
;
public
class
SopTpl
{
}
platform-process-api/src/main/java/cn/com/glsx/process/modules/enums/NodeTypeEnum.java
0 → 100644
View file @
a161660
/*
* @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
\ No newline at end of file
platform-process-api/src/main/java/cn/com/glsx/process/modules/model/sop/Sop.java
0 → 100644
View file @
a161660
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
;
}
platform-process-api/src/main/java/cn/com/glsx/process/modules/model/sop/SopNodeBase.java
0 → 100644
View file @
a161660
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
;
}
platform-process-api/src/main/java/cn/com/glsx/process/modules/model/sop/start/SopNodeStart.java
0 → 100644
View file @
a161660
/*
* @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
\ No newline at end of file
platform-process-api/src/main/java/cn/com/glsx/process/modules/model/sop/start/StartProperty.java
0 → 100644
View file @
a161660
/*
* @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
;
}
}
platform-process-api/src/main/java/cn/com/glsx/process/modules/model/sop/start/Var.java
0 → 100644
View file @
a161660
/*
* @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
;
}
}
platform-process-api/src/main/java/cn/com/glsx/process/modules/model/tpl/SopTplVO.java
0 → 100644
View file @
a161660
package
cn
.
com
.
glsx
.
process
.
modules
.
model
.
tpl
;
import
lombok.Data
;
@Data
public
class
SopTplVO
{
private
Object
sopTpl
;
}
pom.xml
View file @
a161660
...
@@ -48,7 +48,8 @@
...
@@ -48,7 +48,8 @@
</plugin>
</plugin>
</plugins>
</plugins>
</build>
</build>
<modules>
<modules>
<module>
platform-process
</module>
<module>
platform-process
</module>
<module>
platform-process-api
</module>
<module>
platform-process-api
</module>
</modules>
</modules>
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment