• 首页
  • 产品中心
    • 数式Oinone四大产品

      低代码开发平台无代码开发平台集成开发平台AI大模型开发
    • 数式Oinone体系能力

      用户与组织权限管理文件管理消息中心国际化业务审计
    • 数式Oinone核心产品特性

      低无一体面向软件公司场景无限制应用级扩容可分可合
  • 服务中心
    • 客户服务

      预约演示方案咨询私有部署找人定制
    • 开发者

      问答下载
    • Oinone学院

      社区学习

    《精讲面向软件公司的低代码平台——以Oinone为例》

  • 合作伙伴
    渠道申请伙伴名录专家库
  • 关于数式
0571-88757863

Process Extension:Workflow Audit Withdrawal, Rollback, and Rejection Hook Usage


I. Workflow [Undo] Callback Hook

Usage: Place this method under the Action of the XXX model or use @Fun(XXX.MODEL_MODEL) Trigger Condition: When the process instance is undone Invocation Entry Point: pro.shushi.pamirs.workflow.app.core.service.impl.WorkflowInstanceServiceImpl#undoInstance

/**
 * XXX corresponds to the trigger model when the current workflow trigger method is model-triggered.
 * The return value does not affect the process context.
 * @param data The input parameter is the business data at the time of triggering, in JSON string format.
 * @return
 */
@Function
public XXX recall(String data) {
    // TODO: Convert the data into an object based on actual business logic
    WorkRecord workRecord = JsonUtils.parseObject(data, new TypeReference<WorkRecord>(){});
    // TODO: Add custom business logic
    return new XXX();
}

II. Undo [Rollback] Callback Hook

Usage: Place this method under the Action of the XXX model or use @Fun(XXX.MODEL_MODEL) Trigger Condition: When a workflow task is rolled back Invocation Entry Point: pro.shushi.pamirs.workflow.app.core.service.operator.ApprovalFallbackOperatorService

/**
 * XXX corresponds to the trigger model when the current workflow trigger method is model-triggered.
 * The return value does not affect the process context.
 * @param data The input parameter is the business data at the time of triggering, in JSON string format.
 * @return
 */
@Function
public XXX fallBack(String data) {
    // TODO: Convert the data into an object based on actual business logic
    WorkRecord workRecord = JsonUtils.parseObject(data, new TypeReference<WorkRecord>(){});
    // TODO: Add custom business logic
    return new XXX();
}

III. Workflow [Reject] Callback Hook

Usage: Place this method under the Action of the XXX model or use @Fun(XXX.MODEL_MODEL) Trigger Condition: When a workflow task is rejected Invocation Entry Point: pro.shushi.pamirs.workflow.app.core.service.operator.ApprovalFallbackOperatorService

/**
 * XXX corresponds to the trigger model when the current workflow trigger method is model-triggered.
 * The return value does not affect the process context.
 * @param data The input parameter is the business data at the time of triggering, in JSON string format.
 * @return
 */
@Function
public XXX reject(String data) {
    // TODO: Convert the data into an object based on actual business logic
    WorkRecord workRecord = JsonUtils.parseObject(data, new TypeReference<WorkRecord>(){});
    // TODO: Add custom business logic
    return new XXX();
}

IV. Example of Callback Hook Invocation in Business System

@Function(summary = "This method is automatically called when the initiated workflow is undone.")
@Function.Advanced(displayName = "Undo Workflow")
public PurchaseProjectProxy recall(String data) {
    Object tempObj = BeanDefinitionUtils.findFirst(ClientDataConverter.class).out(PurchaseProjectProxy.MODEL_MODEL, JsonUtils.parseMap(data));
    PurchaseProjectProxy proxy = BeanDefinitionUtils.getBean(ClientDataConverter.class)
    .<PurchaseProjectProxy>in(new ModelComputeContext(), PurchaseProjectProxy.MODEL_MODEL, tempObj);

    PurchaseProject purchaseProject = service.recall(ArgUtils.convert(PurchaseProjectProxy.MODEL_MODEL, PurchaseProject.MODEL_MODEL, proxy));
    return ArgUtils.convert(PurchaseProject.MODEL_MODEL, PurchaseProjectProxy.MODEL_MODEL, purchaseProject);
}

V. Custom Approval Methods and Custom Approval Node Names

Custom workflow functions must specify: category = FunctionCategoryEnum.CUSTOM_DESIGNER

@Model.model(ApprovalModel.MODEL_MODEL)
@Component
public class ApprovalModelAction {

    /**
     * Custom approval method
     * @param json The business data in JSON format, which can be converted using JsonUtils
     * @return Return parameters:
     * COUNTERSIGN_ONEAGREE_ONEREJUST Parallel approval (one approver's approval or rejection takes effect)
     * COUNTERSIGN_ALLAGREE_ONEREJUST Concurrent approval (all approvers must approve; one rejection leads to rejection)
     * COUNTERSIGN_ONEAGREE_ALLREJUST Concurrent approval (one approval leads to approval; all rejections lead to rejection)
     * SINGLE Single approver
     */
    @Function
    @Function.Advanced(category = FunctionCategoryEnum.CUSTOM_DESIGNER, displayName = "Test Custom Approval Type")
    public WorkflowSignTypeEnum signType(String json) {
        // TODO: Add custom business logic
        return WorkflowSignTypeEnum.COUNTERSIGN_ONEAGREE_ONEREJUST;
    }

    /**
     * Custom approval node name
     * @return
     */
    @Function
    @Function.Advanced(category = FunctionCategoryEnum.CUSTOM_DESIGNER, displayName = "Test Custom Approval Name")
    public String customApprovalName() {
        return UUID.randomUUID().toString();
    }
}
Edit this page
Last Updated:1/15/26, 4:02 AM
Prev
Process Extension:How to Add Workflow Runtime Dependencies
Next
Process expansion:Operate the workflow through business data (such as urging, canceling, etc.)
默认页脚
Copyright © 2026 Mr.Hope