-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6909330
commit 71e11f4
Showing
31 changed files
with
243 additions
and
257 deletions.
There are no files selected for viewing
68 changes: 0 additions & 68 deletions
68
thain-common/src/main/java/com/xiaomi/thain/common/model/FlowExecutionModel.java
This file was deleted.
Oops, something went wrong.
67 changes: 67 additions & 0 deletions
67
thain-common/src/main/kotlin/com/xiaomi/thain/common/model/rp/FlowExecutionRp.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package com.xiaomi.thain.common.model.rp | ||
|
||
import com.alibaba.fastjson.JSON | ||
import com.xiaomi.thain.common.model.dr.FlowExecutionDr | ||
import java.sql.Timestamp | ||
|
||
/** | ||
* flowExecution dr | ||
* | ||
* @author [email protected] | ||
*/ | ||
data class FlowExecutionRp( | ||
/** | ||
* 自增id | ||
*/ | ||
val id: Long, | ||
/** | ||
* 所属的流程id | ||
*/ | ||
val flowId: Long, | ||
/** | ||
* 流程执行状态, 0 等待运行 1 执行中、2 执行结束、3 执行异常 | ||
*/ | ||
val status: Int, | ||
/** | ||
* 执行机器 | ||
*/ | ||
val hostInfo: String?, | ||
/** | ||
* 触发类型,1手动,2自动调度 | ||
*/ | ||
val triggerType: Int, | ||
/** | ||
* 执行变量 | ||
*/ | ||
val variables: Map<String, Any>, | ||
/** | ||
* 流程执行日志 | ||
*/ | ||
val logs: String?, | ||
/** | ||
* 创建时间 | ||
*/ | ||
val createTime: Timestamp?, | ||
/** | ||
* 更新时间 | ||
*/ | ||
val updateTime: Timestamp?, | ||
/** | ||
* 最近一次心跳时间 | ||
*/ | ||
val heartbeat: Timestamp? | ||
) { | ||
constructor(o: FlowExecutionDr) : this( | ||
id = o.id, | ||
flowId = o.flowId, | ||
status = o.status, | ||
hostInfo = o.hostInfo, | ||
triggerType = o.triggerType, | ||
variables = JSON.parseObject(o.variables), | ||
logs = o.logs, | ||
createTime = o.createTime, | ||
updateTime = o.updateTime, | ||
heartbeat = o.heartbeat | ||
) | ||
|
||
} |
28 changes: 0 additions & 28 deletions
28
thain-component/src/main/java/com/xiaomi/thain/component/annotation/ThainComponent.java
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
thain-component/src/main/kotlin/com/xiaomi/thain/component/annotation/ThainComponent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.xiaomi.thain.component.annotation | ||
|
||
import java.lang.annotation.Inherited | ||
|
||
/** | ||
* Thain组件 | ||
* | ||
* @author [email protected] | ||
*/ | ||
@kotlin.annotation.Retention(AnnotationRetention.RUNTIME) | ||
@Target(AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.CLASS) | ||
@Inherited | ||
annotation class ThainComponent(val value: String) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,9 @@ import java.text.ParseException | |
* @author [email protected] | ||
* @date 19-5-16 下午8:38 | ||
*/ | ||
|
||
private const val NON_EXIST_FLOW = "flow does not exist:{0}" | ||
|
||
class ThainFacade(processEngineConfiguration: ProcessEngineConfiguration, | ||
schedulerEngineConfiguration: SchedulerEngineConfiguration) { | ||
|
||
|
@@ -124,7 +127,7 @@ class ThainFacade(processEngineConfiguration: ProcessEngineConfiguration, | |
* | ||
* 返回 flow execution id | ||
*/ | ||
fun startFlow(flowId: Long, variables: Map<String, String>, appId: String, username: String): Long { | ||
fun startFlow(flowId: Long, variables: Map<String, Any>, appId: String, username: String): Long { | ||
val id = processEngine.startProcess(flowId, variables) | ||
FlowOperationLogHandler( | ||
flowId = flowId, | ||
|
@@ -229,8 +232,4 @@ class ThainFacade(processEngineConfiguration: ProcessEngineConfiguration, | |
} | ||
} | ||
|
||
companion object { | ||
private const val NON_EXIST_FLOW = "flow does not exist:{0}" | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,11 +19,10 @@ import java.util.* | |
* @author [email protected] | ||
*/ | ||
|
||
private const val SYSTEM_GROUP = "system" | ||
|
||
class SchedulerEngine(schedulerEngineConfiguration: SchedulerEngineConfiguration, | ||
processEngine: ProcessEngine) { | ||
companion object { | ||
private const val SYSTEM_GROUP = "system" | ||
} | ||
|
||
private val log = LoggerFactory.getLogger(this.javaClass)!! | ||
private val scheduler: Scheduler | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.