本文整理汇总了Java中org.camunda.bpm.engine.impl.event.EventType类的典型用法代码示例。如果您正苦于以下问题:Java EventType类的具体用法?Java EventType怎么用?Java EventType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EventType类属于org.camunda.bpm.engine.impl.event包,在下文中一共展示了EventType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initEventHandlers
import org.camunda.bpm.engine.impl.event.EventType; //导入依赖的package包/类
protected void initEventHandlers() {
if (eventHandlers == null) {
eventHandlers = new HashMap<String, EventHandler>();
SignalEventHandler signalEventHander = new SignalEventHandler();
eventHandlers.put(signalEventHander.getEventHandlerType(), signalEventHander);
CompensationEventHandler compensationEventHandler = new CompensationEventHandler();
eventHandlers.put(compensationEventHandler.getEventHandlerType(), compensationEventHandler);
EventHandler messageEventHandler = new EventHandlerImpl(EventType.MESSAGE);
eventHandlers.put(messageEventHandler.getEventHandlerType(), messageEventHandler);
EventHandler conditionalEventHandler = new ConditionalEventHandler();
eventHandlers.put(conditionalEventHandler.getEventHandlerType(), conditionalEventHandler);
}
if (customEventHandlers != null) {
for (EventHandler eventHandler : customEventHandlers) {
eventHandlers.put(eventHandler.getEventHandlerType(), eventHandler);
}
}
}
示例2: addEventSubscriptionDeclaration
import org.camunda.bpm.engine.impl.event.EventType; //导入依赖的package包/类
protected void addEventSubscriptionDeclaration(EventSubscriptionDeclaration subscription, ScopeImpl scope, Element element) {
if (subscription.getEventType().equals(EventType.MESSAGE.name()) && (!subscription.hasEventName())) {
addError("Cannot have a message event subscription with an empty or missing name", element);
}
Map<String, EventSubscriptionDeclaration> eventDefinitions = scope.getProperties().get(BpmnProperties.EVENT_SUBSCRIPTION_DECLARATIONS);
// if this is a message event, validate that it is the only one with the provided name for this scope
if (hasMultipleMessageEventDefinitionsWithSameName(subscription, eventDefinitions.values())){
addError("Cannot have more than one message event subscription with name '" + subscription.getUnresolvedEventName() + "' for scope '" + scope.getId() + "'",
element);
}
// if this is a signal event, validate that it is the only one with the provided name for this scope
if (hasMultipleSignalEventDefinitionsWithSameName(subscription, eventDefinitions.values())){
addError("Cannot have more than one signal event subscription with name '" + subscription.getUnresolvedEventName() + "' for scope '" + scope.getId() + "'",
element);
}
// if this is a conditional event, validate that it is the only one with the provided condition
if (subscription.isStartEvent() && hasMultipleConditionalEventDefinitionsWithSameCondition(subscription, eventDefinitions.values())) {
addError("Cannot have more than one conditional event subscription with the same condition '" + ((ConditionalEventDefinition) subscription).getConditionAsString() + "'", element);
}
scope.getProperties().putMapEntry(BpmnProperties.EVENT_SUBSCRIPTION_DECLARATIONS, subscription.getActivityId(), subscription);
}
示例3: parseSignalEventDefinition
import org.camunda.bpm.engine.impl.event.EventType; //导入依赖的package包/类
protected EventSubscriptionDeclaration parseSignalEventDefinition(Element signalEventDefinitionElement) {
String signalRef = signalEventDefinitionElement.attribute("signalRef");
if (signalRef == null) {
addError("signalEventDefinition does not have required property 'signalRef'", signalEventDefinitionElement);
return null;
} else {
SignalDefinition signalDefinition = signals.get(resolveName(signalRef));
if (signalDefinition == null) {
addError("Could not find signal with id '" + signalRef + "'", signalEventDefinitionElement);
}
EventSubscriptionDeclaration signalEventDefinition = new EventSubscriptionDeclaration(signalDefinition.getExpression(), EventType.SIGNAL);
boolean throwingAsynch = TRUE.equals(signalEventDefinitionElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "async", "false"));
signalEventDefinition.setAsync(throwingAsynch);
return signalEventDefinition;
}
}
示例4: removeObsoleteEventSubscriptions
import org.camunda.bpm.engine.impl.event.EventType; //导入依赖的package包/类
protected void removeObsoleteEventSubscriptions(ProcessDefinitionEntity processDefinition, ProcessDefinitionEntity latestProcessDefinition) {
// remove all subscriptions for the previous version
if (latestProcessDefinition != null) {
EventSubscriptionManager eventSubscriptionManager = getEventSubscriptionManager();
List<EventSubscriptionEntity> subscriptionsToDelete = new ArrayList<EventSubscriptionEntity>();
List<EventSubscriptionEntity> messageEventSubscriptions = eventSubscriptionManager
.findEventSubscriptionsByConfiguration(EventType.MESSAGE.name(), latestProcessDefinition.getId());
subscriptionsToDelete.addAll(messageEventSubscriptions);
List<EventSubscriptionEntity> signalEventSubscriptions = eventSubscriptionManager
.findEventSubscriptionsByConfiguration(EventType.SIGNAL.name(), latestProcessDefinition.getId());
subscriptionsToDelete.addAll(signalEventSubscriptions);
List<EventSubscriptionEntity> conditionalEventSubscriptions = eventSubscriptionManager
.findEventSubscriptionsByConfiguration(EventType.CONDITONAL.name(), latestProcessDefinition.getId());
subscriptionsToDelete.addAll(conditionalEventSubscriptions);
for (EventSubscriptionEntity eventSubscriptionEntity : subscriptionsToDelete) {
eventSubscriptionEntity.delete();
}
}
}
示例5: testDeploymentCreatesSubscriptions
import org.camunda.bpm.engine.impl.event.EventType; //导入依赖的package包/类
@Test
@Deployment(resources = "org/camunda/bpm/engine/test/bpmn/event/conditional/ConditionalStartEventTest.testSingleConditionalStartEvent.bpmn20.xml")
public void testDeploymentCreatesSubscriptions() {
// given a deployed process
String processDefinitionId = repositoryService.createProcessDefinitionQuery().processDefinitionKey(CONDITIONAL_EVENT_PROCESS).singleResult().getId();
// when
List<EventSubscription> eventSubscriptions = runtimeService.createEventSubscriptionQuery().list();
// then
assertEquals(1, eventSubscriptions.size());
EventSubscriptionEntity conditionalEventSubscription = (EventSubscriptionEntity) eventSubscriptions.get(0);
assertEquals(EventType.CONDITONAL.name(), conditionalEventSubscription.getEventType());
assertEquals(processDefinitionId, conditionalEventSubscription.getConfiguration());
assertNull(conditionalEventSubscription.getEventName());
assertNull(conditionalEventSubscription.getExecutionId());
assertNull(conditionalEventSubscription.getProcessInstanceId());
}
示例6: testStartInstanceWithBeanCondition
import org.camunda.bpm.engine.impl.event.EventType; //导入依赖的package包/类
@Test
public void testStartInstanceWithBeanCondition() {
List<EventSubscription> eventSubscriptions = runtimeService.createEventSubscriptionQuery().list();
assertEquals(1, eventSubscriptions.size());
assertEquals(EventType.CONDITONAL.name(), eventSubscriptions.get(0).getEventType());
List<ProcessInstance> instances = runtimeService
.createConditionEvaluation()
.setVariable("foo", 1)
.evaluateStartConditions();
assertEquals(1, instances.size());
assertNotNull(runtimeService.createProcessInstanceQuery().processDefinitionKey("conditionalEventProcess").singleResult());
VariableInstance vars = runtimeService.createVariableInstanceQuery().singleResult();
assertEquals(vars.getProcessInstanceId(), instances.get(0).getId());
assertEquals(1, vars.getValue());
}
示例7: addMessageSubscription
import org.camunda.bpm.engine.impl.event.EventType; //导入依赖的package包/类
protected void addMessageSubscription(final ActivityExecution context, String eventName) {
ExecutionEntity executionEntity = (ExecutionEntity)context;
EventSubscriptionEntity eventSubscriptionEntity = new EventSubscriptionEntity(executionEntity, EventType.MESSAGE);
eventSubscriptionEntity.setEventName(eventName);
eventSubscriptionEntity.setActivity(executionEntity.getActivity());
eventSubscriptionEntity.insert();
}
示例8: addMessageSubscription
import org.camunda.bpm.engine.impl.event.EventType; //导入依赖的package包/类
protected void addMessageSubscription(final ActivityExecution execution, String eventName) {
ExecutionEntity executionEntity = (ExecutionEntity)execution;
EventSubscriptionEntity eventSubscriptionEntity = new EventSubscriptionEntity(executionEntity, EventType.MESSAGE);
eventSubscriptionEntity.setEventName(eventName);
eventSubscriptionEntity.setActivity(executionEntity.getActivity());
eventSubscriptionEntity.insert();
}
示例9: eventSubscription
import org.camunda.bpm.engine.impl.event.EventType; //导入依赖的package包/类
public ProcessDefinitionQuery eventSubscription(EventType eventType, String eventName) {
ensureNotNull("event type", eventType);
ensureNotNull("event name", eventName);
this.eventSubscriptionType = eventType.name();
this.eventSubscriptionName = eventName;
return this;
}
示例10: instantiateScopes
import org.camunda.bpm.engine.impl.event.EventType; //导入依赖的package包/类
@Override
protected void instantiateScopes(
MigratingScopeInstance ancestorScopeInstance,
MigratingScopeInstanceBranch executionBranch,
List<ScopeImpl> scopesToInstantiate) {
if (scopesToInstantiate.isEmpty()) {
return;
}
ExecutionEntity ancestorScopeExecution = ancestorScopeInstance.resolveRepresentativeExecution();
ExecutionEntity parentExecution = ancestorScopeExecution;
for (ScopeImpl scope : scopesToInstantiate) {
ExecutionEntity compensationScopeExecution = parentExecution.createExecution();
compensationScopeExecution.setScope(true);
compensationScopeExecution.setEventScope(true);
compensationScopeExecution.setActivity((PvmActivity) scope);
compensationScopeExecution.setActive(false);
compensationScopeExecution.activityInstanceStarting();
compensationScopeExecution.enterActivityInstance();
EventSubscriptionEntity eventSubscription = EventSubscriptionEntity.createAndInsert(parentExecution, EventType.COMPENSATE, (ActivityImpl) scope);
eventSubscription.setConfiguration(compensationScopeExecution.getId());
executionBranch.visited(new MigratingEventScopeInstance(eventSubscription, compensationScopeExecution, scope));
parentExecution = compensationScopeExecution;
}
}
示例11: deleteEventSubscription
import org.camunda.bpm.engine.impl.event.EventType; //导入依赖的package包/类
public void deleteEventSubscription(EventSubscriptionEntity persistentObject) {
getDbEntityManager().delete(persistentObject);
if (persistentObject.isSubscriptionForEventType(EventType.SIGNAL)) {
createdSignalSubscriptions.remove(persistentObject);
}
// if the event subscription has been triggered asynchronously but not yet executed
List<JobEntity> asyncJobs = getJobManager().findJobsByConfiguration(ProcessEventJobHandler.TYPE, persistentObject.getId(), persistentObject.getTenantId());
for (JobEntity asyncJob : asyncJobs) {
asyncJob.delete();
}
}
示例12: EventSubscriptionEntity
import org.camunda.bpm.engine.impl.event.EventType; //导入依赖的package包/类
public EventSubscriptionEntity(ExecutionEntity executionEntity, EventType eventType) {
this(eventType);
setExecution(executionEntity);
setActivity(execution.getActivity());
this.processInstanceId = executionEntity.getProcessInstanceId();
this.tenantId = executionEntity.getTenantId();
}
示例13: createAndInsert
import org.camunda.bpm.engine.impl.event.EventType; //导入依赖的package包/类
public static EventSubscriptionEntity createAndInsert(ExecutionEntity executionEntity, EventType eventType, ActivityImpl activity, String configuration) {
EventSubscriptionEntity eventSubscription = new EventSubscriptionEntity(executionEntity, eventType);
eventSubscription.setActivity(activity);
eventSubscription.setTenantId(executionEntity.getTenantId());
eventSubscription.setConfiguration(configuration);
eventSubscription.insert();
return eventSubscription;
}
示例14: removeEventSubscriptionsExceptCompensation
import org.camunda.bpm.engine.impl.event.EventType; //导入依赖的package包/类
protected void removeEventSubscriptionsExceptCompensation() {
// remove event subscriptions which are not compensate event subscriptions
List<EventSubscriptionEntity> eventSubscriptions = getEventSubscriptions();
for (EventSubscriptionEntity eventSubscriptionEntity : eventSubscriptions) {
if (!EventType.COMPENSATE.name().equals(eventSubscriptionEntity.getEventType())) {
eventSubscriptionEntity.delete();
}
}
}
示例15: getCompensateEventSubscriptions
import org.camunda.bpm.engine.impl.event.EventType; //导入依赖的package包/类
public List<EventSubscriptionEntity> getCompensateEventSubscriptions() {
List<EventSubscriptionEntity> eventSubscriptions = getEventSubscriptionsInternal();
List<EventSubscriptionEntity> result = new ArrayList<EventSubscriptionEntity>(eventSubscriptions.size());
for (EventSubscriptionEntity eventSubscriptionEntity : eventSubscriptions) {
if (eventSubscriptionEntity.isSubscriptionForEventType(EventType.COMPENSATE)) {
result.add(eventSubscriptionEntity);
}
}
return result;
}