Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
6 replies
Subscribers
11 subscribers
Views
3275 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Data and Records
I'm having issues attmepting to set up an Entity Record Type based on an exi
marks
over 10 years ago
I'm having issues attmepting to set up an Entity Record Type based on an existing mySQL table.
I manually created a data type based on the database (is there a way to import the structure from mySQL instead?). I then exported the XSD and manually updated that file to indicate that the a_id field was the primary field and would be auto-incremented. I then removed the original data type and attempted to import the new XSD file, but get a message that
The element type "xsd:sequence" must be terminated by the matching end-tag "</xsd:sequence>"
Although the XSD file definitely has both of those tags:
<xsd:schema
targetNamespace="
obmdev.appiancloud.com/.../"
xmlns:types150="
obmdev.appiancloud.com/.../"
xmlns:xsd="
www.w3.org/.../XMLSchema">
<xsd:complexType name="training">
<xsd:sequence>
<xsd:element name="a_id" nillable="true" type="xsd:int"/>
<xsd:annotation>
<xsd:appinfo source="appian.jpa">...
OriginalPostID-76791
OriginalPostID-76791
Discussion posts and replies are publicly visible
0
marks
over 10 years ago
...
@Id
@GeneratedValue
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="tra_name" nillable="true" type="xsd:string"/>
<xsd:element name="tra_number" nillable="true" type="xsd:string"/>
<xsd:element name="tra_provider_name" nillable="true" type="xsd:string"/>
<xsd:element name="tra_state_datetime" nillable="true" type="xsd:dateTime"/>
<xsd:element name="tra_end_datetime" nillable="true" type="xsd:dateTime"/>
<xsd:element name="tra_brochure_doc_id" nillable="true" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
What am I missing here? Is there an easier way to create a record type based on existing DB table?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
chase.putnam
over 10 years ago
Hi Mark,
It looks like your first element declaration had an end tag even though you were further declaring information within it.
You first element should be:
<xsd:element name="a_id" nillable="true" type="xsd:int">
<xsd:annotation>
<xsd:appinfo source="appian.jpa">
@Id
@GeneratedValue
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
The only difference is on the first line, I edited out the /> to a > after type="xsd:int".
Ending a line with /> closes the element tag. You need it to remain open to have the children annotation and app info items within it. Then it closes with the </xsd:element> at the end.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
marks
over 10 years ago
OK--that fixed the first issue. Now, once I create the "training" data type, then attempt to create the data store based on it, I get the "no matching tables found" message when verifying it. The detailed message:
The data source schema does not match the type mappings: Missing column: aid in Appian.training (APNX-2-4056-000)
The actual field name is "a_id"). Is there an issue using an underscore in a DB table field?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
chase.putnam
over 10 years ago
Hi Mark,
Every time you change a CDT xsd that will map to a database table and you are not just adding additional elements (columns), you will need to drop the table in the database and allow Appian to create the table upon data store verification (or manually edit the table to match the structure changes made in the xsd file). Please try that and see if it allows Appian to create the table.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
marks
over 10 years ago
My change to the XSD was to match the existing table (making "a_id" the primary and setting it to auto-increment), not to change the table. So, either a) my XSD still does not match the table, or b) Appian doesn't allow me to use an existing table (which already has test data)--I have to let Appian create it. Which is it?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Andrew P Gramann
Certified Lead Developer
over 10 years ago
Try adding @Column(name="a_id") to the other annotations you have on the column in your cdt definition.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel