org.camunda.bpm.model.bpmn.instance.IntermediateCatchEvent Java Examples

The following examples show how to use org.camunda.bpm.model.bpmn.instance.IntermediateCatchEvent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: IntermediateCatchEventImpl.java    From camunda-bpmn-model with Apache License 2.0 5 votes vote down vote up
public static void registerType(ModelBuilder modelBuilder) {
  ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(IntermediateCatchEvent.class, BPMN_ELEMENT_INTERMEDIATE_CATCH_EVENT)
    .namespaceUri(BpmnModelConstants.BPMN20_NS)
    .extendsType(CatchEvent.class)
    .instanceProvider(new ModelTypeInstanceProvider<IntermediateCatchEvent>() {
      public IntermediateCatchEvent newInstance(ModelTypeInstanceContext instanceContext) {
        return new IntermediateCatchEventImpl(instanceContext);
      }
    });

  typeBuilder.build();
}
 
Example #2
Source File: IntermediateCatchEventImpl.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
public static void registerType(ModelBuilder modelBuilder) {
  ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(IntermediateCatchEvent.class, BPMN_ELEMENT_INTERMEDIATE_CATCH_EVENT)
    .namespaceUri(BpmnModelConstants.BPMN20_NS)
    .extendsType(CatchEvent.class)
    .instanceProvider(new ModelTypeInstanceProvider<IntermediateCatchEvent>() {
      public IntermediateCatchEvent newInstance(ModelTypeInstanceContext instanceContext) {
        return new IntermediateCatchEventImpl(instanceContext);
      }
    });

  typeBuilder.build();
}
 
Example #3
Source File: AbstractServiceTaskHandleDelegate.java    From wecube-platform with Apache License 2.0 4 votes vote down vote up
private ServiceInvocationEvent serviceInvocationEvent(DelegateExecution execution, ProcessDefinition procDef) {
    ServiceInvocationEventImpl event = new ServiceInvocationEventImpl();

    event.setDefinitionId(execution.getProcessDefinitionId());
    event.setDefinitionVersion(procDef.getVersion());
    event.setDefinitionKey(procDef.getKey());

    // event.setExecutionId(execution.getId());
    event.setBusinessKey(execution.getProcessBusinessKey());
    event.setInstanceId(execution.getProcessInstanceId());

    event.setEventSourceId(execution.getCurrentActivityId());
    event.setEventSourceName(execution.getCurrentActivityName());

    event.setEventType(ServiceInvocationEvent.EventType.SERVICE_INVOCATION);

    ServiceTask serviceTask = execution.getBpmnModelInstance()
            .getModelElementById(execution.getCurrentActivityId());

    List<EventBasedGateway> eventBaseGateways = serviceTask.getSucceedingNodes()
            .filterByType(EventBasedGateway.class).list();
    EventBasedGateway eventBaseGateway = null;
    if (!eventBaseGateways.isEmpty()) {
        eventBaseGateway = eventBaseGateways.get(0);
    }
    IntermediateCatchEvent intermediateCatchEvent = null;
    if (eventBaseGateway != null) {

        List<IntermediateCatchEvent> intermediateCatchEvents = eventBaseGateway.getSucceedingNodes()
                .filterByType(IntermediateCatchEvent.class).list();

        for (IntermediateCatchEvent ice : intermediateCatchEvents) {
            getLogger().debug("IntermediateCatchEvent:{} {}", ice.getId(), ice.getName());

            Collection<EventDefinition> eventDefinitions = ice.getEventDefinitions();

            for (EventDefinition ed : eventDefinitions) {
                getLogger().debug("EventDefinition: {} {}", ed.getId(), ed.getElementType().getTypeName());
                if ("signalEventDefinition".equals(ed.getElementType().getTypeName())) {
                    intermediateCatchEvent = ice;
                    break;
                }
            }

            if (intermediateCatchEvent != null) {
                break;
            }
        }

    }

    if (intermediateCatchEvent != null) {
        event.setExecutionId(intermediateCatchEvent.getId());
    }

    List<String> allowedOptions = tryCalAllowedOptions(execution);
    if (allowedOptions != null) {
        for (String option : allowedOptions) {
            event.addAllowedOption(option);
        }
    }

    return event;
}
 
Example #4
Source File: AbstractIntermediateCatchEventBuilder.java    From camunda-bpmn-model with Apache License 2.0 4 votes vote down vote up
protected AbstractIntermediateCatchEventBuilder(BpmnModelInstance modelInstance, IntermediateCatchEvent element, Class<?> selfType) {
  super(modelInstance, element, selfType);
}
 
Example #5
Source File: IntermediateCatchEventBuilder.java    From camunda-bpmn-model with Apache License 2.0 4 votes vote down vote up
public IntermediateCatchEventBuilder(BpmnModelInstance modelInstance, IntermediateCatchEvent element) {
  super(modelInstance, element, IntermediateCatchEventBuilder.class);
}
 
Example #6
Source File: AbstractIntermediateCatchEventBuilder.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
protected AbstractIntermediateCatchEventBuilder(BpmnModelInstance modelInstance, IntermediateCatchEvent element, Class<?> selfType) {
  super(modelInstance, element, selfType);
}
 
Example #7
Source File: IntermediateCatchEventBuilder.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
public IntermediateCatchEventBuilder(BpmnModelInstance modelInstance, IntermediateCatchEvent element) {
  super(modelInstance, element, IntermediateCatchEventBuilder.class);
}