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


Java ActivitiEventType类代码示例

本文整理汇总了Java中org.activiti.engine.delegate.event.ActivitiEventType的典型用法代码示例。如果您正苦于以下问题:Java ActivitiEventType类的具体用法?Java ActivitiEventType怎么用?Java ActivitiEventType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ActivitiEventType类属于org.activiti.engine.delegate.event包,在下文中一共展示了ActivitiEventType类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: nextActivities

import org.activiti.engine.delegate.event.ActivitiEventType; //导入依赖的package包/类
@Override
public List<ActivityDefinition> nextActivities(String userId, final String taskId, final Map<String, Object> variables) {

    new TransactionTemplate(transactionManager).execute(new TransactionCallback<Object>() {
        @Override
        public Object doInTransaction(TransactionStatus status) {
            FollowActivityEventListener activityEventListener = new FollowActivityEventListener();
            runtimeService.addEventListener(activityEventListener, ActivitiEventType.ACTIVITY_STARTED);
            taskService.complete(taskId,variables);
            runtimeService.removeEventListener(activityEventListener);
            status.setRollbackOnly();
            return null;
        }
    });

    return FollowActivityContext.getActivitys();
}
 
开发者ID:tryndamere,项目名称:bpm-adapter,代码行数:18,代码来源:ActivitiRuntimeImpl.java

示例2: dispatchPackageUpdatedEvent

import org.activiti.engine.delegate.event.ActivitiEventType; //导入依赖的package包/类
public void dispatchPackageUpdatedEvent(Object variableValue, String taskId, String executionId, String processInstanceId, String processDefinitionId)
{
    runtimeService.dispatchEvent(
       ActivitiEventBuilder.createVariableEvent(ActivitiEventType.VARIABLE_UPDATED, WorkflowNotificationUtils.PROP_PACKAGE,
                        variableValue, new ScriptNodeVariableType(), 
                        taskId, executionId, processInstanceId, processDefinitionId));
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:8,代码来源:ActivitiWorkflowEngine.java

示例3: execute

import org.activiti.engine.delegate.event.ActivitiEventType; //导入依赖的package包/类
public Object execute(CommandContext commandContext) {
    TaskEntity taskEntity = commandContext.getTaskEntityManager()
            .findTaskById(taskId);

    if (variables != null) {
        taskEntity.setExecutionVariables(variables);
    }

    boolean localScope = false;

    if ((taskEntity.getDelegationState() != null)
            && taskEntity.getDelegationState().equals(
                    DelegationState.PENDING)) {
        throw new ActivitiException(
                "A delegated task cannot be completed, but should be resolved instead.");
    }

    taskEntity.fireEvent(TaskListener.EVENTNAME_COMPLETE);

    if ((Authentication.getAuthenticatedUserId() != null)
            && (taskEntity.getProcessInstanceId() != null)) {
        taskEntity.getProcessInstance().involveUser(
                Authentication.getAuthenticatedUserId(),
                IdentityLinkType.PARTICIPANT);
    }

    if (Context.getProcessEngineConfiguration().getEventDispatcher()
            .isEnabled()) {
        Context.getProcessEngineConfiguration()
                .getEventDispatcher()
                .dispatchEvent(
                        ActivitiEventBuilder
                                .createEntityWithVariablesEvent(
                                        ActivitiEventType.TASK_COMPLETED,
                                        taskEntity, variables, localScope));
    }

    Context.getCommandContext().getTaskEntityManager()
            .deleteTask(taskEntity, comment, false);

    if (taskEntity.getExecutionId() != null) {
        ExecutionEntity execution = taskEntity.getExecution();
        execution.removeTask(taskEntity);

        try {
            Context.setExecutionContext(execution);
            execution.signal(null, null);
        } finally {
            Context.removeExecutionContext();
        }
    }

    return null;
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:55,代码来源:CompleteTaskWithCommentCmd.java


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