@Operation(summary = "release", description = "RELEASE_PROCESS_DEFINITION_NOTES")
    @Parameters({
            @Parameter(name = "name", description = "PROCESS_DEFINITION_NAME", required = true, schema = @Schema(implementation = String.class)),
            @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "123456789")),
            @Parameter(name = "releaseState", description = "PROCESS_DEFINITION_RELEASE", required = true, schema = @Schema(implementation = ReleaseState.class)),
    })
    @PostMapping(value = "/{code}/release")
    @ResponseStatus(HttpStatus.OK)
    @ApiException(RELEASE_PROCESS_DEFINITION_ERROR)
    public Result<Boolean> releaseProcessDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
                                                    @Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode,
                                                    @PathVariable(value = "code", required = true) long workflowDefinitionCode,
                                                    @RequestParam(value = "releaseState", required = true) ReleaseState releaseState) {
        switch (releaseState) {
            case ONLINE:
                processDefinitionService.onlineWorkflowDefinition(loginUser, projectCode, workflowDefinitionCode);
                break;
            case OFFLINE:
                processDefinitionService.offlineWorkflowDefinition(loginUser, projectCode, workflowDefinitionCode);
                break;
            default:
                throw new IllegalArgumentException(
                        "The releaseState " + releaseState + " is illegal, please check it.");
        }
        return Result.success(true);
    }
@Test
    public void testReleaseProcessDefinition() {
        long projectCode = 1L;
        long id = 1L;
        Map<String, Object> result = new HashMap<>();
        putMsg(result, Status.SUCCESS);

        Mockito.doNothing().when(processDefinitionService)
                .offlineWorkflowDefinition(user, projectCode, id);
        Result<Boolean> response =
                processDefinitionController.releaseProcessDefinition(user, projectCode, id, ReleaseState.OFFLINE);
        Assertions.assertTrue(response != null && response.isSuccess());
    }