当前位置: 首页>>代码示例>>Java>>正文


Java CommandContext.getDbSqlSession方法代码示例

本文整理汇总了Java中org.activiti.engine.impl.interceptor.CommandContext.getDbSqlSession方法的典型用法代码示例。如果您正苦于以下问题:Java CommandContext.getDbSqlSession方法的具体用法?Java CommandContext.getDbSqlSession怎么用?Java CommandContext.getDbSqlSession使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.activiti.engine.impl.interceptor.CommandContext的用法示例。


在下文中一共展示了CommandContext.getDbSqlSession方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: insert

import org.activiti.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
public void insert(ExecutionEntity execution, boolean fireEvents) {
    CommandContext commandContext = Context.getCommandContext();
    DbSqlSession dbSqlSession = commandContext.getDbSqlSession();
    dbSqlSession.insert(this);

    // Inherit tenant id (if applicable)
    if (execution != null && execution.getTenantId() != null) {
        setTenantId(execution.getTenantId());
    }

    if (execution != null) {
        execution.addTask(this);
    }

    commandContext.getHistoryManager().recordTaskCreated(this, execution);

    if (commandContext.getProcessEngineConfiguration().getEventDispatcher().isEnabled() && fireEvents) {
        commandContext.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
                ActivitiEventBuilder.createEntityEvent(FlowableEngineEventType.ENTITY_CREATED, this));
        commandContext.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
                ActivitiEventBuilder.createEntityEvent(FlowableEngineEventType.ENTITY_INITIALIZED, this));
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:24,代码来源:TaskEntity.java

示例2: update

import org.activiti.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
public void update() {
    // Needed to make history work: the setter will also update the historic task
    setOwner(this.getOwner());
    setAssignee(this.getAssignee(), true, false);
    setDelegationState(this.getDelegationState());
    setName(this.getName());
    setDescription(this.getDescription());
    setPriority(this.getPriority());
    setCategory(this.getCategory());
    setCreateTime(this.getCreateTime());
    setDueDate(this.getDueDate());
    setParentTaskId(this.getParentTaskId());
    setFormKey(formKey);

    CommandContext commandContext = Context.getCommandContext();
    DbSqlSession dbSqlSession = commandContext.getDbSqlSession();
    dbSqlSession.update(this);

    if (commandContext.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
        commandContext.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
                ActivitiEventBuilder.createEntityEvent(FlowableEngineEventType.ENTITY_UPDATED, this));
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:24,代码来源:TaskEntity.java

示例3: updateModel

import org.activiti.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
public void updateModel(ModelEntity updatedModel) {
    CommandContext commandContext = Context.getCommandContext();
    updatedModel.setLastUpdateTime(Context.getProcessEngineConfiguration().getClock().getCurrentTime());
    DbSqlSession dbSqlSession = commandContext.getDbSqlSession();
    dbSqlSession.update(updatedModel);

    if (Context.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
        Context.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
                ActivitiEventBuilder.createEntityEvent(FlowableEngineEventType.ENTITY_UPDATED, updatedModel));
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:12,代码来源:ModelEntityManager.java

示例4: updateProcessDefinitionInfo

import org.activiti.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
public void updateProcessDefinitionInfo(ProcessDefinitionInfoEntity updatedProcessDefinitionInfo) {
    CommandContext commandContext = Context.getCommandContext();
    DbSqlSession dbSqlSession = commandContext.getDbSqlSession();
    dbSqlSession.update(updatedProcessDefinitionInfo);

    if (Context.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
        Context.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
                ActivitiEventBuilder.createEntityEvent(FlowableEngineEventType.ENTITY_UPDATED, updatedProcessDefinitionInfo));
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:11,代码来源:ProcessDefinitionInfoEntityManager.java

示例5: execute

import org.activiti.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
@Override
public InputStream execute(CommandContext commandContext) {
    DbSqlSession dbSqlSession = commandContext.getDbSqlSession();
    AttachmentEntity attachment = dbSqlSession.selectById(AttachmentEntity.class, attachmentId);

    String contentId = attachment.getContentId();
    if (contentId == null) {
        return null;
    }

    ByteArrayEntity byteArray = dbSqlSession.selectById(ByteArrayEntity.class, contentId);
    byte[] bytes = byteArray.getBytes();

    return new ByteArrayInputStream(bytes);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:16,代码来源:GetAttachmentContentCmd.java

示例6: execute

import org.activiti.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
@Override
public Attachment execute(CommandContext commandContext) {

    verifyParameters(commandContext);

    AttachmentEntity attachment = new AttachmentEntity();
    attachment.setName(attachmentName);
    attachment.setDescription(attachmentDescription);
    attachment.setType(attachmentType);
    attachment.setTaskId(taskId);
    attachment.setProcessInstanceId(processInstanceId);
    attachment.setUrl(url);
    attachment.setUserId(Authentication.getAuthenticatedUserId());
    attachment.setTime(commandContext.getProcessEngineConfiguration().getClock().getCurrentTime());

    DbSqlSession dbSqlSession = commandContext.getDbSqlSession();
    dbSqlSession.insert(attachment);

    if (content != null) {
        byte[] bytes = IoUtil.readInputStream(content, attachmentName);
        ByteArrayEntity byteArray = ByteArrayEntity.createAndInsert(bytes);
        attachment.setContentId(byteArray.getId());
        attachment.setContent(byteArray);
    }

    commandContext.getHistoryManager()
            .createAttachmentComment(taskId, processInstanceId, attachmentName, true);

    if (commandContext.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
        // Forced to fetch the process-instance to associate the right process definition
        String processDefinitionId = null;
        if (attachment.getProcessInstanceId() != null) {
            ExecutionEntity process = commandContext.getExecutionEntityManager().findExecutionById(processInstanceId);
            if (process != null) {
                processDefinitionId = process.getProcessDefinitionId();
            }
        }

        commandContext.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
                ActivitiEventBuilder.createEntityEvent(FlowableEngineEventType.ENTITY_CREATED, attachment, processInstanceId, processInstanceId, processDefinitionId));
        commandContext.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
                ActivitiEventBuilder.createEntityEvent(FlowableEngineEventType.ENTITY_INITIALIZED, attachment, processInstanceId, processInstanceId, processDefinitionId));
    }

    return attachment;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:47,代码来源:CreateAttachmentCmd.java


注:本文中的org.activiti.engine.impl.interceptor.CommandContext.getDbSqlSession方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。