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


Java TimerDeclarationImpl类代码示例

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


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

示例1: checkStartEventDefinitions

import org.activiti.engine.impl.jobexecutor.TimerDeclarationImpl; //导入依赖的package包/类
protected int checkStartEventDefinitions(ProcessDefinition def, String embededActivityId) {
    List<TimerDeclarationImpl> startTimerDeclarations = (List<TimerDeclarationImpl>) ((ProcessDefinitionEntity) def).getProperty("timerStart");

    if (startTimerDeclarations != null && startTimerDeclarations.size() > 0) {
        TimerDeclarationImpl timerDeclaration = null;

        for (TimerDeclarationImpl startTimerDeclaration : startTimerDeclarations) {
            String definitionActivityId = TimerEventHandler.getActivityIdFromConfiguration(startTimerDeclaration.getJobHandlerConfiguration());
            if (startTimerDeclaration.getJobHandlerType().equalsIgnoreCase(jobHandlerType)
                    && (definitionActivityId.equalsIgnoreCase(embededActivityId))) {
                timerDeclaration = startTimerDeclaration;
            }
        }

        if (timerDeclaration != null) {
            return calculateMaxIterationsValue(timerDeclaration.getDescription().getExpressionText());
        }
    }
    return 1;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:21,代码来源:TimerJobEntity.java

示例2: addTimerDeclarations

import org.activiti.engine.impl.jobexecutor.TimerDeclarationImpl; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected void addTimerDeclarations(ProcessDefinitionEntity processDefinition, List<TimerJobEntity> timers) {
    List<TimerDeclarationImpl> timerDeclarations = (List<TimerDeclarationImpl>) processDefinition.getProperty(BpmnParse.PROPERTYNAME_START_TIMER);
    if (timerDeclarations != null) {
        for (TimerDeclarationImpl timerDeclaration : timerDeclarations) {
            TimerJobEntity timer = timerDeclaration.prepareTimerEntity(null);
            if (timer != null) {
                timer.setProcessDefinitionId(processDefinition.getId());

                // Inherit timer (if applicable)
                if (processDefinition.getTenantId() != null) {
                    timer.setTenantId(processDefinition.getTenantId());
                }
                timers.add(timer);
            }
        }
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:19,代码来源:BpmnDeployer.java

示例3: initialize

import org.activiti.engine.impl.jobexecutor.TimerDeclarationImpl; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void initialize() {
  log.fine("initializing "+this);

  ScopeImpl scope = getScope();
  ensureParentInitialized();

  List<VariableDeclaration> variableDeclarations = (List<VariableDeclaration>) scope.getProperty(BpmnParse.PROPERTYNAME_VARIABLE_DECLARATIONS);
  if (variableDeclarations!=null) {
    for (VariableDeclaration variableDeclaration : variableDeclarations) {
      variableDeclaration.initialize(this, parent);
    }
  }
  
  List<TimerDeclarationImpl> timerDeclarations = (List<TimerDeclarationImpl>) scope.getProperty(BpmnParse.PROPERTYNAME_TIMER_DECLARATION);
  if (timerDeclarations!=null) {
    for (TimerDeclarationImpl timerDeclaration : timerDeclarations) {
      TimerEntity timer = timerDeclaration.prepareTimerEntity(this);
      Context
        .getCommandContext()
        .getJobManager()
        .schedule(timer);
    }
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:26,代码来源:ExecutionEntity.java

示例4: parseTimer

import org.activiti.engine.impl.jobexecutor.TimerDeclarationImpl; //导入依赖的package包/类
private TimerDeclarationImpl parseTimer(Element timerEventDefinition, ScopeImpl timerActivity, String jobHandlerType) {
  // TimeDate
  TimerDeclarationType type = TimerDeclarationType.DATE;
  Expression expression = parseExpression(timerEventDefinition, "timeDate");

  // TimeCycle
  if (expression == null) {
    type = TimerDeclarationType.CYCLE;
    expression = parseExpression(timerEventDefinition, "timeCycle");
  }

  // TimeDuration
  if (expression == null) {
    type = TimerDeclarationType.DURATION;
    expression = parseExpression(timerEventDefinition, "timeDuration");
  }

  // Parse the timer declaration
  // TODO move the timer declaration into the bpmn activity or next to the
  // TimerSession
  TimerDeclarationImpl timerDeclaration = new TimerDeclarationImpl(expression, type, jobHandlerType);
  timerDeclaration.setJobHandlerConfiguration(timerActivity.getId());
  return timerDeclaration;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:25,代码来源:BpmnParse.java

示例5: TimerJobEntity

import org.activiti.engine.impl.jobexecutor.TimerDeclarationImpl; //导入依赖的package包/类
public TimerJobEntity(TimerDeclarationImpl timerDeclaration) {
    this.jobHandlerType = timerDeclaration.getJobHandlerType();
    this.jobHandlerConfiguration = timerDeclaration.getJobHandlerConfiguration();
    this.isExclusive = timerDeclaration.isExclusive();
    this.repeat = timerDeclaration.getRepeat();
    this.retries = timerDeclaration.getRetries();
    this.jobType = "timer";
    this.revision = 1;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:10,代码来源:TimerJobEntity.java

示例6: initialize

import org.activiti.engine.impl.jobexecutor.TimerDeclarationImpl; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void initialize() {
    LOGGER.debug("initializing {}", this);

    ScopeImpl scope = getScopeObject();
    ensureParentInitialized();

    // initialize the lists of referenced objects (prevents db queries)
    variableInstances = new HashMap<>();
    eventSubscriptions = new ArrayList<>();

    // Cached entity-state initialized to null, all bits are zero, indicating NO entities present
    cachedEntityState = 0;

    List<TimerDeclarationImpl> timerDeclarations = (List<TimerDeclarationImpl>) scope.getProperty(BpmnParse.PROPERTYNAME_TIMER_DECLARATION);
    if (timerDeclarations != null) {
        for (TimerDeclarationImpl timerDeclaration : timerDeclarations) {
            TimerJobEntity timer = timerDeclaration.prepareTimerEntity(this);
            if (timer != null) {
                callJobProcessors(JobProcessorContext.Phase.BEFORE_CREATE, timer, Context.getProcessEngineConfiguration());
                Context.getCommandContext().getJobEntityManager().schedule(timer);
            }
        }
    }

    // create event subscriptions for the current scope
    List<EventSubscriptionDeclaration> eventSubscriptionDeclarations = (List<EventSubscriptionDeclaration>) scope.getProperty(BpmnParse.PROPERTYNAME_EVENT_SUBSCRIPTION_DECLARATION);
    if (eventSubscriptionDeclarations != null) {
        for (EventSubscriptionDeclaration eventSubscriptionDeclaration : eventSubscriptionDeclarations) {
            if (!eventSubscriptionDeclaration.isStartEvent()) {
                EventSubscriptionEntity eventSubscriptionEntity = eventSubscriptionDeclaration.prepareEventSubscriptionEntity(this);
                if (getTenantId() != null) {
                    eventSubscriptionEntity.setTenantId(getTenantId());
                }
                eventSubscriptionEntity.insert();
            }
        }
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:41,代码来源:ExecutionEntity.java

示例7: addTimerDeclaration

import org.activiti.engine.impl.jobexecutor.TimerDeclarationImpl; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected void addTimerDeclaration(ScopeImpl scope, TimerDeclarationImpl timerDeclaration) {
    List<TimerDeclarationImpl> timerDeclarations = (List<TimerDeclarationImpl>) scope.getProperty(PROPERTYNAME_TIMER_DECLARATION);
    if (timerDeclarations == null) {
        timerDeclarations = new ArrayList<>();
        scope.setProperty(PROPERTYNAME_TIMER_DECLARATION, timerDeclarations);
    }
    timerDeclarations.add(timerDeclaration);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:10,代码来源:TimerEventDefinitionParseHandler.java

示例8: TimerEntity

import org.activiti.engine.impl.jobexecutor.TimerDeclarationImpl; //导入依赖的package包/类
public TimerEntity(TimerDeclarationImpl timerDeclaration) {
  jobHandlerType = timerDeclaration.getJobHandlerType();
  jobHandlerConfiguration = timerDeclaration.getJobHandlerConfiguration();
  isExclusive = timerDeclaration.isExclusive();
  repeat = timerDeclaration.getRepeat();
  retries = timerDeclaration.getRetries();
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:8,代码来源:TimerEntity.java

示例9: parseTimerStartEventDefinition

import org.activiti.engine.impl.jobexecutor.TimerDeclarationImpl; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void parseTimerStartEventDefinition(Element timerEventDefinition, ActivityImpl timerActivity, ProcessDefinitionEntity processDefinition) {
  timerActivity.setProperty("type", "startTimerEvent");
  TimerDeclarationImpl timerDeclaration = parseTimer(timerEventDefinition, timerActivity, TimerStartEventJobHandler.TYPE);
  timerDeclaration.setJobHandlerConfiguration(processDefinition.getKey());

  List<TimerDeclarationImpl> timerDeclarations = (List<TimerDeclarationImpl>) processDefinition.getProperty(PROPERTYNAME_START_TIMER);
  if (timerDeclarations == null) {
    timerDeclarations = new ArrayList<TimerDeclarationImpl>();
    processDefinition.setProperty(PROPERTYNAME_START_TIMER, timerDeclarations);
  }
  timerDeclarations.add(timerDeclaration);

}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:15,代码来源:BpmnParse.java

示例10: parseIntemediateTimerEventDefinition

import org.activiti.engine.impl.jobexecutor.TimerDeclarationImpl; //导入依赖的package包/类
private void parseIntemediateTimerEventDefinition(Element timerEventDefinition, ActivityImpl timerActivity) {
  timerActivity.setProperty("type", "intermediateTimer");
  TimerDeclarationImpl timerDeclaration = parseTimer(timerEventDefinition, timerActivity, TimerCatchIntermediateEventJobHandler.TYPE);
  addTimerDeclaration(timerActivity, timerDeclaration);
  timerActivity.setScope(true);
  for (BpmnParseListener parseListener : parseListeners) {
    parseListener.parseIntermediateTimerEventDefinition(timerEventDefinition, timerActivity);
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:10,代码来源:BpmnParse.java

示例11: addTimerDeclaration

import org.activiti.engine.impl.jobexecutor.TimerDeclarationImpl; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected void addTimerDeclaration(ScopeImpl scope, TimerDeclarationImpl timerDeclaration) {
  List<TimerDeclarationImpl> timerDeclarations = (List<TimerDeclarationImpl>) scope.getProperty(PROPERTYNAME_TIMER_DECLARATION);
  if (timerDeclarations == null) {
    timerDeclarations = new ArrayList<TimerDeclarationImpl>();
    scope.setProperty(PROPERTYNAME_TIMER_DECLARATION, timerDeclarations);
  }
  timerDeclarations.add(timerDeclaration);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:10,代码来源:BpmnParse.java

示例12: addTimerDeclarations

import org.activiti.engine.impl.jobexecutor.TimerDeclarationImpl; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void addTimerDeclarations(ProcessDefinitionEntity processDefinition) {
  List<TimerDeclarationImpl> timerDeclarations = (List<TimerDeclarationImpl>) processDefinition.getProperty(BpmnParse.PROPERTYNAME_START_TIMER);
  if (timerDeclarations!=null) {
    for (TimerDeclarationImpl timerDeclaration : timerDeclarations) {
      TimerEntity timer = timerDeclaration.prepareTimerEntity(null);
      Context
        .getCommandContext()
        .getJobManager()
        .schedule(timer);
    }
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:14,代码来源:BpmnDeployer.java

示例13: parseTimerStartEventDefinition

import org.activiti.engine.impl.jobexecutor.TimerDeclarationImpl; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void parseTimerStartEventDefinition(Element timerEventDefinition, ActivityImpl timerActivity, ProcessDefinitionEntity processDefinition) {
  timerActivity.setProperty("type", "startTimerEvent");
  TimerDeclarationImpl timerDeclaration = parseTimer(timerEventDefinition, timerActivity, TimerStartEventJobHandler.TYPE);
  timerDeclaration.setJobHandlerConfiguration(processDefinition.getKey());    

  List<TimerDeclarationImpl> timerDeclarations = (List<TimerDeclarationImpl>) processDefinition.getProperty(PROPERTYNAME_START_TIMER);
  if (timerDeclarations == null) {
    timerDeclarations = new ArrayList<TimerDeclarationImpl>();
    processDefinition.setProperty(PROPERTYNAME_START_TIMER, timerDeclarations);
  }
  timerDeclarations.add(timerDeclaration);

}
 
开发者ID:iotsap,项目名称:FiWare-Template-Handler,代码行数:15,代码来源:BpmnParse.java

示例14: parseIntemediateTimerEventDefinition

import org.activiti.engine.impl.jobexecutor.TimerDeclarationImpl; //导入依赖的package包/类
private void parseIntemediateTimerEventDefinition(Element timerEventDefinition, ActivityImpl timerActivity, boolean isAfterEventBasedGateway) {
  timerActivity.setProperty("type", "intermediateTimer");
  TimerDeclarationImpl timerDeclaration = parseTimer(timerEventDefinition, timerActivity, TimerCatchIntermediateEventJobHandler.TYPE);
  if(isAfterEventBasedGateway) {
    addTimerDeclaration(timerActivity.getParent(), timerDeclaration);
  }else {
    addTimerDeclaration(timerActivity, timerDeclaration);
    timerActivity.setScope(true);
  }
  for (BpmnParseListener parseListener : parseListeners) {
    parseListener.parseIntermediateTimerEventDefinition(timerEventDefinition, timerActivity);
  }
}
 
开发者ID:iotsap,项目名称:FiWare-Template-Handler,代码行数:14,代码来源:BpmnParse.java

示例15: parseTimer

import org.activiti.engine.impl.jobexecutor.TimerDeclarationImpl; //导入依赖的package包/类
private TimerDeclarationImpl parseTimer(Element timerEventDefinition, ScopeImpl timerActivity, String jobHandlerType) {
  // TimeDate
  TimerDeclarationType type = TimerDeclarationType.DATE;
  Expression expression = parseExpression(timerEventDefinition, "timeDate");
  // TimeCycle
  if (expression == null) {
    type = TimerDeclarationType.CYCLE;
    expression = parseExpression(timerEventDefinition, "timeCycle");
  }
  // TimeDuration
  if (expression == null) {
    type = TimerDeclarationType.DURATION;
    expression = parseExpression(timerEventDefinition, "timeDuration");
  }    
  // neither date, cycle or duration configured!
  if (expression==null) {
    addError("Timer needs configuration (either timeDate, timeCycle or timeDuration is needed).", timerEventDefinition);      
  }    

  // Parse the timer declaration
  // TODO move the timer declaration into the bpmn activity or next to the
  // TimerSession
  TimerDeclarationImpl timerDeclaration = new TimerDeclarationImpl(expression, type, jobHandlerType);
  timerDeclaration.setJobHandlerConfiguration(timerActivity.getId());
  timerDeclaration.setExclusive("true".equals(timerEventDefinition.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "exclusive", String.valueOf(JobEntity.DEFAULT_EXCLUSIVE))));
  return timerDeclaration;
}
 
开发者ID:iotsap,项目名称:FiWare-Template-Handler,代码行数:28,代码来源:BpmnParse.java


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