-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
33 changed files
with
720 additions
and
208 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
.../main/java/cn/sliew/carp/module/workflow/api/controller/WorkflowDefinitionController.java
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,55 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you 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.sliew.carp.module.workflow.api.controller; | ||
|
||
import cn.sliew.carp.framework.web.response.ApiResponseWrapper; | ||
import cn.sliew.carp.module.workflow.api.engine.domain.definition.WorkflowDefinition; | ||
import cn.sliew.carp.module.workflow.api.service.WorkflowDefinitionService; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
@RestController | ||
@ApiResponseWrapper | ||
@RequestMapping("/api/carp/workflow/definition") | ||
@Tag(name = "Workflow模块-Definition管理") | ||
public class WorkflowDefinitionController { | ||
|
||
@Autowired | ||
private WorkflowDefinitionService workflowDefinitionService; | ||
|
||
@GetMapping("{id}") | ||
@Operation(summary = "查询详情", description = "查询详情") | ||
public WorkflowDefinition get(@PathVariable("id") Long id) { | ||
return workflowDefinitionService.get(id); | ||
} | ||
|
||
@GetMapping("{id}/graph") | ||
@Operation(summary = "查询详情-图", description = "查询详情-图") | ||
public WorkflowDefinition getGraph(@PathVariable("id") Long id) { | ||
return workflowDefinitionService.getGraph(id); | ||
} | ||
|
||
@PutMapping | ||
@Operation(summary = "新增", description = "新增") | ||
public Long add() { | ||
return null; | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
...rc/main/java/cn/sliew/carp/module/workflow/api/controller/WorkflowInstanceController.java
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,56 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you 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.sliew.carp.module.workflow.api.controller; | ||
|
||
import cn.sliew.carp.framework.common.security.annotations.AnonymousAccess; | ||
import cn.sliew.carp.framework.web.response.ApiResponseWrapper; | ||
import cn.sliew.carp.module.workflow.api.service.WorkflowInstanceService; | ||
import cn.sliew.carp.module.workflow.api.service.param.WorkflowRunParam; | ||
import cn.sliew.carp.module.workflow.api.service.param.WorkflowStopParam; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import jakarta.validation.Valid; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@AnonymousAccess | ||
@RestController | ||
@ApiResponseWrapper | ||
@RequestMapping("/api/carp/workflow/instance") | ||
@Tag(name = "Workflow模块-Instance管理") | ||
public class WorkflowInstanceController { | ||
|
||
@Autowired | ||
private WorkflowInstanceService workflowInstanceService; | ||
|
||
@PostMapping("run") | ||
@Operation(summary = "启动", description = "启动") | ||
public Long run(@Valid @RequestBody WorkflowRunParam param) { | ||
return workflowInstanceService.run(param); | ||
} | ||
|
||
@PostMapping("stop") | ||
@Operation(summary = "停止", description = "停止") | ||
public void stop(@Valid @RequestBody WorkflowStopParam param) { | ||
workflowInstanceService.stop(param); | ||
} | ||
} |
37 changes: 0 additions & 37 deletions
37
...-workflow-api/src/main/java/cn/sliew/carp/module/workflow/api/domain/WorkflowDagNode.java
This file was deleted.
Oops, something went wrong.
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
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
29 changes: 29 additions & 0 deletions
29
...ew/carp/module/workflow/api/engine/dispatch/handler/WorkflowTaskInstanceEventHandler.java
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,29 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you 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.sliew.carp.module.workflow.api.engine.dispatch.handler; | ||
|
||
import cn.sliew.carp.framework.common.dict.workflow.WorkflowTaskInstanceEvent; | ||
import cn.sliew.carp.module.workflow.api.engine.dispatch.event.WorkflowTaskInstanceStatusEvent; | ||
|
||
public interface WorkflowTaskInstanceEventHandler { | ||
|
||
WorkflowTaskInstanceEvent getType(); | ||
|
||
void handle(WorkflowTaskInstanceStatusEvent event); | ||
} |
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
26 changes: 26 additions & 0 deletions
26
...arp/module/workflow/api/engine/dispatch/publisher/WorkflowTaskInstanceEventPublisher.java
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,26 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you 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.sliew.carp.module.workflow.api.engine.dispatch.publisher; | ||
|
||
import cn.sliew.carp.module.workflow.api.engine.dispatch.event.WorkflowTaskInstanceStatusEvent; | ||
|
||
public interface WorkflowTaskInstanceEventPublisher { | ||
|
||
void publish(WorkflowTaskInstanceStatusEvent event); | ||
} |
46 changes: 46 additions & 0 deletions
46
...n/java/cn/sliew/carp/module/workflow/api/engine/domain/definition/WorkflowDefinition.java
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,46 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you 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.sliew.carp.module.workflow.api.engine.domain.definition; | ||
|
||
import cn.sliew.carp.framework.common.model.BaseDTO; | ||
import lombok.Data; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
public class WorkflowDefinition extends BaseDTO { | ||
|
||
private String type; | ||
|
||
private String name; | ||
|
||
private String uuid; | ||
|
||
private WorkflowDefinitionGraph graph; | ||
|
||
private WorkflowDefinitionMeta meta; | ||
|
||
private WorkflowDefinitionAttrs attrs; | ||
|
||
private List<WorkflowParamOption> inputOptions; | ||
|
||
private List<WorkflowParamOption> outputOptions; | ||
|
||
private String remark; | ||
} |
Oops, something went wrong.