本文整理汇总了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));
}
}
示例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));
}
}
示例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));
}
}
示例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));
}
}
示例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);
}
示例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;
}