Search in sources :

Example 6 with WorkflowApproverEntity

use of org.apache.inlong.manager.dao.entity.WorkflowApproverEntity in project incubator-inlong by apache.

the class WorkflowApproverServiceImpl method update.

@Override
public void update(WorkflowApprover config, String operator) {
    Preconditions.checkNotNull(config, "config cannot be null");
    Preconditions.checkNotNull(config.getId(), "id cannot be null");
    WorkflowApproverEntity entity = workflowApproverMapper.selectByPrimaryKey(config.getId());
    Preconditions.checkNotNull(entity, "not exist with id:" + config.getId());
    WorkflowApproverEntity update = new WorkflowApproverEntity();
    update.setId(config.getId());
    update.setModifyTime(new Date());
    update.setModifier(operator);
    update.setApprovers(config.getApprovers());
    update.setFilterKey(config.getFilterKey().name());
    update.setFilterValue(config.getFilterValue());
    int success = this.workflowApproverMapper.updateByPrimaryKeySelective(update);
    Preconditions.checkTrue(success == 1, "update failed");
}
Also used : WorkflowApproverEntity(org.apache.inlong.manager.dao.entity.WorkflowApproverEntity) Date(java.util.Date)

Aggregations

WorkflowApproverEntity (org.apache.inlong.manager.dao.entity.WorkflowApproverEntity)6 WorkflowProcess (org.apache.inlong.manager.workflow.definition.WorkflowProcess)4 WorkflowTask (org.apache.inlong.manager.workflow.definition.WorkflowTask)4 Date (java.util.Date)3 WorkflowApprover (org.apache.inlong.manager.common.pojo.workflow.WorkflowApprover)2 WorkflowApproverQuery (org.apache.inlong.manager.common.pojo.workflow.WorkflowApproverQuery)2 UserTask (org.apache.inlong.manager.workflow.definition.UserTask)2 Arrays (java.util.Arrays)1 List (java.util.List)1 Map (java.util.Map)1 Objects (java.util.Objects)1 Optional (java.util.Optional)1 Collectors (java.util.stream.Collectors)1 StringUtils (org.apache.commons.lang3.StringUtils)1 EntityStatus (org.apache.inlong.manager.common.enums.EntityStatus)1 WorkflowException (org.apache.inlong.manager.common.exceptions.WorkflowException)1 FilterKey (org.apache.inlong.manager.common.pojo.workflow.FilterKey)1 ProcessDetailResponse (org.apache.inlong.manager.common.pojo.workflow.ProcessDetailResponse)1 TaskResponse (org.apache.inlong.manager.common.pojo.workflow.TaskResponse)1 WorkflowApproverFilterContext (org.apache.inlong.manager.common.pojo.workflow.WorkflowApproverFilterContext)1