Java Code Examples for org.camunda.bpm.application.ProcessApplication#deploymentDescriptors()

The following examples show how to use org.camunda.bpm.application.ProcessApplication#deploymentDescriptors() . 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: ParseProcessesXmlStep.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
protected String[] getDeploymentDescriptorLocations(AbstractProcessApplication processApplication) {
  ProcessApplication annotation = processApplication.getClass().getAnnotation(ProcessApplication.class);
  if(annotation == null) {
    return new String[] {ProcessApplication.DEFAULT_META_INF_PROCESSES_XML};

  } else {
    return annotation.deploymentDescriptors();

  }
}
 
Example 2
Source File: ProcessesXmlProcessor.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
protected String[] getDeploymentDescriptors(DeploymentUnit deploymentUnit) throws DeploymentUnitProcessingException {

    final ComponentDescription processApplicationComponent = ProcessApplicationAttachments.getProcessApplicationComponent(deploymentUnit);
    final String paClassName = processApplicationComponent.getComponentClassName();

    String[] deploymentDescriptorResourceNames = null;

    Module module = deploymentUnit.getAttachment(MODULE);

    Class<?> paClass = null;
    try {
      paClass = (Class<?>) module.getClassLoader().loadClass(paClassName);
    } catch (ClassNotFoundException e) {
      throw new DeploymentUnitProcessingException("Unable to load process application class '"+paClassName+"'.");
    }

    ProcessApplication annotation = paClass.getAnnotation(ProcessApplication.class);

    if(annotation == null) {
      deploymentDescriptorResourceNames = new String[]{ PROCESSES_XML };

    } else {
      deploymentDescriptorResourceNames = annotation.deploymentDescriptors();

    }
    return deploymentDescriptorResourceNames;
  }
 
Example 3
Source File: ProcessesXmlProcessor.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
protected String[] getDeploymentDescriptors(DeploymentUnit deploymentUnit) throws DeploymentUnitProcessingException {

    final ComponentDescription processApplicationComponent = ProcessApplicationAttachments.getProcessApplicationComponent(deploymentUnit);
    final String paClassName = processApplicationComponent.getComponentClassName();

    String[] deploymentDescriptorResourceNames = null;

    Module module = deploymentUnit.getAttachment(MODULE);

    Class<?> paClass = null;
    try {
      paClass = (Class<?>) module.getClassLoader().loadClass(paClassName);
    } catch (ClassNotFoundException e) {
      throw new DeploymentUnitProcessingException("Unable to load process application class '"+paClassName+"'.");
    }

    ProcessApplication annotation = paClass.getAnnotation(ProcessApplication.class);

    if(annotation == null) {
      deploymentDescriptorResourceNames = new String[]{ PROCESSES_XML };

    } else {
      deploymentDescriptorResourceNames = annotation.deploymentDescriptors();

    }
    return deploymentDescriptorResourceNames;
  }