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


Java DelegateTask.getExecution方法代码示例

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


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

示例1: isVote

import org.activiti.engine.delegate.DelegateTask; //导入方法依赖的package包/类
/**
 * 是否会签任务.
 */
public boolean isVote(DelegateTask delegateTask) {
    ExecutionEntity executionEntity = (ExecutionEntity) delegateTask
            .getExecution();
    ActivityImpl activityImpl = executionEntity.getActivity();

    return activityImpl.getProperty("multiInstance") != null;
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:11,代码来源:HumanTaskEventListener.java

示例2: setDelegateTask

import org.activiti.engine.delegate.DelegateTask; //导入方法依赖的package包/类
public HumanTaskBuilder setDelegateTask(DelegateTask delegateTask) {
    humanTaskDto.setBusinessKey(delegateTask.getExecution()
            .getProcessBusinessKey());
    humanTaskDto.setName(delegateTask.getName());
    humanTaskDto.setDescription(delegateTask.getDescription());

    humanTaskDto.setCode(delegateTask.getTaskDefinitionKey());
    humanTaskDto.setAssignee(delegateTask.getAssignee());
    humanTaskDto.setOwner(delegateTask.getOwner());
    humanTaskDto.setDelegateStatus("none");
    humanTaskDto.setPriority(delegateTask.getPriority());
    humanTaskDto.setCreateTime(new Date());
    humanTaskDto.setDuration(delegateTask.getDueDate() + "");
    humanTaskDto.setSuspendStatus("none");
    humanTaskDto.setCategory(delegateTask.getCategory());
    humanTaskDto.setForm(delegateTask.getFormKey());
    humanTaskDto.setTaskId(delegateTask.getId());
    humanTaskDto.setExecutionId(delegateTask.getExecutionId());
    humanTaskDto.setProcessInstanceId(delegateTask.getProcessInstanceId());
    humanTaskDto.setProcessDefinitionId(delegateTask
            .getProcessDefinitionId());
    humanTaskDto.setTenantId(delegateTask.getTenantId());
    humanTaskDto.setStatus("active");
    humanTaskDto.setCatalog(HumanTaskConstants.CATALOG_NORMAL);

    ExecutionEntity executionEntity = (ExecutionEntity) delegateTask
            .getExecution();
    ExecutionEntity processInstance = executionEntity.getProcessInstance();
    humanTaskDto.setPresentationSubject(processInstance.getName());

    String userId = Authentication.getAuthenticatedUserId();
    humanTaskDto.setProcessStarter(userId);

    return this;
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:36,代码来源:HumanTaskBuilder.java

示例3: notify

import org.activiti.engine.delegate.DelegateTask; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void notify(DelegateTask delegateTask) {
  // get mapping table from variable
  DelegateExecution execution = delegateTask.getExecution();
  Map<String, String> assigneeMappingTable = (Map<String, String>) execution.getVariable("assigneeMappingTable");
  
  // get assignee from process
  String assigneeFromProcessDefinition = delegateTask.getAssignee();
  
  // overwrite assignee if there is an entry in the mapping table
  if (assigneeMappingTable.containsKey(assigneeFromProcessDefinition)) {
    String assigneeFromMappingTable = assigneeMappingTable.get(assigneeFromProcessDefinition);
    delegateTask.setAssignee(assigneeFromMappingTable);
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:16,代码来源:AssigneeOverwriteFromVariable.java

示例4: notify

import org.activiti.engine.delegate.DelegateTask; //导入方法依赖的package包/类
@Override
	public void notify(DelegateTask delegateTask) {

		DelegateExecution execution = delegateTask.getExecution();
		PrismContext prismContext = getPrismContext();
		OperationResult opResult = new OperationResult(TaskCompleteListener.class.getName() + ".notify");
		Task wfTask = ActivitiUtil.getTask(execution, opResult);
		ApprovalStageDefinitionType stageDef = ActivitiUtil.getAndVerifyCurrentStage(execution, wfTask, true, prismContext);

		delegateTask.setVariableLocal(CommonProcessVariableNames.VARIABLE_WORK_ITEM_WAS_COMPLETED, Boolean.TRUE);

		//		System.out.println("%%% Task " + delegateTask + " has been completed.");
//		LOGGER.info("%%% Task {} has been completed", delegateTask);

		MidPointPrincipal user;
		try {
			user = SecurityUtil.getPrincipal();
		} catch (SecurityViolationException e) {
			throw new SystemException("Couldn't record a decision: " + e.getMessage(), e);
		}

		if (user != null && user.getOid() != null) {
			delegateTask.setVariableLocal(CommonProcessVariableNames.VARIABLE_WORK_ITEM_COMPLETED_BY, user.getOid());
		}

		LOGGER.trace("======================================== Recording individual decision of {}", user);

		@NotNull WorkItemResultType result1 = getItemApprovalProcessInterface().extractWorkItemResult(delegateTask.getVariables());
		boolean isApproved = ApprovalUtils.isApproved(result1);

        LevelEvaluationStrategyType levelEvaluationStrategyType = stageDef.getEvaluationStrategy();
        Boolean setLoopApprovesInStageStop = null;
        if (levelEvaluationStrategyType == LevelEvaluationStrategyType.FIRST_DECIDES) {
			LOGGER.trace("Setting " + LOOP_APPROVERS_IN_STAGE_STOP + " to true, because the stage evaluation strategy is 'firstDecides'.");
            setLoopApprovesInStageStop = true;
        } else if ((levelEvaluationStrategyType == null || levelEvaluationStrategyType == LevelEvaluationStrategyType.ALL_MUST_AGREE) && !isApproved) {
			LOGGER.trace("Setting " + LOOP_APPROVERS_IN_STAGE_STOP + " to true, because the stage eval strategy is 'allMustApprove' and the decision was 'reject'.");
            setLoopApprovesInStageStop = true;
        }

        if (setLoopApprovesInStageStop != null) {
			//noinspection ConstantConditions
			execution.setVariable(LOOP_APPROVERS_IN_STAGE_STOP, setLoopApprovesInStageStop);
        }

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Approval process instance {} (id {}), stage {}: recording decision {}; stage stops now: {}",
					execution.getVariable(CommonProcessVariableNames.VARIABLE_PROCESS_INSTANCE_NAME),
                    execution.getProcessInstanceId(),
					WfContextUtil.getStageDiagName(stageDef), result1.getOutcome(), setLoopApprovesInStageStop);
        }

		getActivitiInterface().notifyMidpointAboutTaskEvent(delegateTask);
		getActivitiInterface().notifyMidpointAboutProcessEvent(execution);
    }
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:56,代码来源:TaskCompleteListener.java


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