0
votes

I'm using an Oozie bundle to manage two coordinators (for now). They are the same process, but for two different clients. I have the client names defined in the bundle.properties file that I call when I launch the bundle.xml. I'm trying to use the client name to name each of the coordinators, but I keep seeing variations of the following error:

Error: E0701 : E0701: XML schema error, cvc-pattern-valid: Value 'Daily_job_#{client1}' is not facet-valid with respect to pattern '(a-zA-Z*){1,39}' for type 'IDENTIFIER'

I have been playing around with using ${} to access the variable name vs #{} based on this post here: Renaming Oozie coordinator dynamically. I seem to be able to access the variables as properties just fine from the bundle.properties just not in the name.

Here is what I've tried in the bundle.xml:

<coordinator name='Daily_job_#{client1}' >
...
      <property>
          <name>client</name>
          <value>${client1}</value>
      </property>

</coordinator>

and

<coordinator name='Daily_job_${client1}' >
...
</coordinator>

In the bundle.properties:

client1=firstclientname
client2=secondclientname

I'm able to access the value of client within the property in the coordinator and workflow but I can't seem to name the coordinator based on the property. Can anyone help me? Thank you!

2

2 Answers

0
votes

Seeing as you're getting that particular error seems to indicate the name which happens to be a bundle:IDENTIFIER type does not conform to the schema that was defined by the Oozie developers.

What this means is that your XML is being validated for well-formedness against a schema and the bundle:IDENTIFIER is checked against a regular expression that only allows alphanumerics, dashes and underscores in the name with a minimum of 1 character up to 40 characters.

<xs:simpleType name="IDENTIFIER">
    <xs:restriction base="xs:string">
        <xs:pattern value="([a-zA-Z]([\-_a-zA-Z0-9])*){1,39})"/>
    </xs:restriction>
</xs:simpleType>

Well-formedness is a XML pre-processing step and is probably restricting your substitution characters as $ # { } are not included in the regular expression.

https://github.com/apache/oozie/blob/master/client/src/main/resources/oozie-bundle-0.2.xsd

0
votes

I was using Oozie bundle schema 0.1: xmlns='uri:oozie:bundle:0.1', and by changing it to 0.2:xmlns='uri:oozie:bundle:0.2' it works now. I am also using the second variation with ${}, so in the bundle.xml:

<coordinator name='Daily_job_${client1}' >
...
</coordinator>

Is the one to use.