create table DEF_ACTIVITY (DBID_ bigint not null, CLASS_ varchar(255) not null, NAME_ varchar(255), UUID_ varchar(500), CHILD_NODE_ bigint, FAULT_QNAME_ varchar(255), catchVariableDefinition bigint, IS_DEFAULT_CH_ bit, DEL_JOIN_FAIL_ bit, EXEC_SRC_ASYNC bit, SCOPE_ bigint, TARG_JOIN_COND_ bigint, EXT_ACTIVITY_NAME varchar(255), EXT_ACTIVITY_ID bigint, PARTNER_LINK_ varchar(255), OPERATION_NAME_ varchar(255), IN_VAR_NAME_ varchar(255), OUT_VAR_NAME_ varchar(255), ONE_WAY_ bit, PT_QNAME_ varchar(255), ANON_OUT_MESS_ bigint, ANON_IN_MESS_ bigint, MSG_TYPE_QNAME_ varchar(255), MSG_EXCHANGE_ varchar(255), CREATE_INST_ bit, OP_KEY_ varchar(3999), INPUT_TYPE_ varchar(255), VALIDATE_ bit, ISOLATED_ bit, EXIT_ON_FAULT_ bit, NODE_ bigint, COND_ bigint, ACTIVITY_ bigint, ELSE_ACTIVITY_ bigint, COUNTER_NAME_ varchar(255), PARALLEL_ bit, SUC_BRANCHES_ bit, START_COUNT_ bigint, FINAL_COUNT_ bigint, COMPL_COND_ bigint, DURATION_ bigint, DEADLINE_ bigint, FAULT_VAR_ varchar(255), TARGET_ varchar(255), INBOUND_PROCESS_ bigint, EXT_PROCESS_ bigint, primary key (DBID_)) ENGINE=InnoDB;
create table DEF_COPY_ELT (DBID_ bigint not null, KEEP_SRC_ELT_ bit, IGNORE_MISS_DATA_ bit, FROM_ bigint, TO_ bigint, INVOKE_IN_ID_ bigint, INDEX_ integer, INVOKE_OUT_ID_ bigint, REPLY_ID_ bigint, RECEIVE_IN_ID_ bigint, ASSIGN_ID_ bigint, ASSIGN_INDEX_ integer, ON_MSG_IN_ID_ bigint, ON_EVT_IN_ID_ bigint, primary key (DBID_)) ENGINE=InnoDB;
create table DEF_CORREL (DBID_ bigint not null, INITIATE_ varchar(255), CS_ bigint, INVOKE_REQ_ID_ bigint, INVOKE_RES_ID_ bigint, REPLY_ID_ bigint, RECEIVE_ID_ bigint, ON_MSG_ID_ bigint, ON_EVT_ID_ bigint, primary key (DBID_)) ENGINE=InnoDB;
create table DEF_CS (DBID_ bigint not null, NAME_ varchar(255), SCOPE_ID_ bigint, CS_NAME_ varchar(255), primary key (DBID_)) ENGINE=InnoDB;
create table DEF_CS_PROPERTIES_ (CS_ID_ bigint not null, elt bigint not null, NAME_QNAME_ varchar(255) not null, primary key (CS_ID_, NAME_QNAME_)) ENGINE=InnoDB;
create table DEF_ELSE_IF (IF_ID_ bigint not null, CONDITION_ bigint, ACTIVITY_ bigint, INDEX_ integer not null, primary key (IF_ID_, INDEX_)) ENGINE=InnoDB;
create table DEF_EXCEPTHNDLR (DBID_ bigint not null, CLASS_ varchar(255) not null, DBVERSION_ integer not null, EXCEPT_CLASS_ varchar(255), TRANSACT_ bit, RETHROW_MASKED_ bit, NODENAME_ varchar(255), primary key (DBID_)) ENGINE=InnoDB;
create table DEF_FROM_PART (DBID_ bigint not null, PART_ varchar(255), TO_VAR_ varchar(255), primary key (DBID_)) ENGINE=InnoDB;
create table DEF_FROM_TO_ELT (DBID_ bigint not null, CLASS_ varchar(255) not null, VARIANT_ varchar(255), VARIABLE_ varchar(255), PART_ varchar(255), PARTNER_LINK_ varchar(255), PROP_QNAME_ varchar(255), VAR_QUERY_ bigint, EXPRESSION_ bigint, LITERAL_VAL_ longtext, ENDPOINT_REF_ varchar(255), primary key (DBID_)) ENGINE=InnoDB;
create table DEF_LINK (DBID_ bigint not null, NAME_ varchar(255), SOURCE_ACTIVITY_ bigint, TARGET_ACTIVITY_ bigint, FLOW_ID_ bigint, primary key (DBID_)) ENGINE=InnoDB;
create table DEF_LINK_SOURCE (DBID_ bigint not null, LINK_NAME_ varchar(255), LINK_ bigint, TRANS_COND_ bigint, ACTIVITY_ID_ bigint, primary key (DBID_)) ENGINE=InnoDB;
create table DEF_LINK_TARGET (DBID_ bigint not null, LINK_NAME_ varchar(255), LINK_ bigint, ACTIVITY_ID_ bigint, primary key (DBID_)) ENGINE=InnoDB;
create table DEF_NAMESPACE (DBID_ bigint not null, URI_ varchar(255), PREFIX_ varchar(255), SNIPPET_ID_ bigint, primary key (DBID_)) ENGINE=InnoDB;
create table DEF_NODE (DBID_ bigint not null, DBVERSION_ integer not null, PROCESS_ bigint, EXCEPTHNDLR_ bigint, NAME_ varchar(255) not null unique, DESCR_ varchar(255), PARENT_ bigint, BEHAV_OBJ_ bigint, PARENT_IDX_ integer, primary key (DBID_)) ENGINE=InnoDB;
create table DEF_ON_ALARM (DBID_ bigint not null, UUID_ varchar(255), DURATION_ bigint, DEADLINE_ bigint, REPEAT_ bigint, ACTIVITY_ bigint, ACTIVITY_ID_ bigint, PICK_ID_ bigint, primary key (DBID_)) ENGINE=InnoDB;
create table DEF_ON_EVT (DBID_ bigint not null, PARTNER_LINK_ varchar(255), IN_VAR_NAME_ varchar(255), MSG_EXCHANGE_ varchar(255), ANON_IN_MESS_ bigint, OP_KEY_ varchar(3999), ACTIVITY_ bigint, INBOUND_ELT_ bigint, INPUT_TYPE_ varchar(255), ACTIVITY_ID_ bigint, primary key (DBID_)) ENGINE=InnoDB;
create table DEF_ON_MSG (DBID_ bigint not null, PARTNER_LINK_ varchar(255), IN_VAR_NAME_ varchar(255), MSG_EXCHANGE_ varchar(255), ANON_IN_MESS_ bigint, OP_KEY_ varchar(3999), ACTIVITY_ bigint, INBOUND_ELT_ bigint, INPUT_TYPE_ varchar(255), PICK_ID_ bigint, primary key (DBID_)) ENGINE=InnoDB;
create table DEF_PLNK (DBID_ bigint not null, NAME_ varchar(255), MYROLEPT_QNAME_ varchar(255), PARTROLEPT_QNAME_ varchar(255), P_END_REF longtext, MY_END_REF longtext, SCOPE_ID_ bigint, PLNK_NAME_ varchar(255), primary key (DBID_)) ENGINE=InnoDB;
create table DEF_PLNKTYPE (DBID_ bigint not null, NAME_QNAME_ varchar(255), WSDLINFOS_ID_ bigint, PLNK_QNAME_ varchar(255), primary key (DBID_)) ENGINE=InnoDB;
create table DEF_PLNKT_ROLES (PLNKTYPE_ID_ bigint not null, PT_QNAME_ varchar(255), ROLE_NAME_ varchar(255) not null, primary key (PLNKTYPE_ID_, ROLE_NAME_)) ENGINE=InnoDB;
create table DEF_PROCESS (DBID_ bigint not null, DBVERSION_ integer not null, EXCEPTHNDLR_ bigint, NAME_ varchar(255), VERSION_ integer, DEPLOYED_ datetime, INITIAL_ bigint, PROCESS_UUID_ varchar(255), QUERY_LANG_ varchar(255), EXPR_LANG_ varchar(255), DEL_JOIN_FAIL_ bit, EXIT_ON_FAULT_ bit, TARGET_NS_ varchar(255), START_ELTS_ integer, WSDL_INFOS_ bigint, instanceCreationLock bigint, primary key (DBID_)) ENGINE=InnoDB;
create table DEF_PROC_COMMON_CS (PROCESS_ID_ bigint not null, CS_ID_ bigint not null) ENGINE=InnoDB;
create table DEF_PROC_RESOURCES (PROCESS_ID_ bigint not null, CONTENT_ longblob, NAME_ varchar(255) not null, primary key (PROCESS_ID_, NAME_)) ENGINE=InnoDB;
create table DEF_PROPALIAS (DBID_ bigint not null, PROP_PART_ varchar(255), PROP_QNAME_ varchar(255), MSGTYPE_QNAME_ varchar(255), TYPE_QNAME_ varchar(255), ELT_QNAME_ varchar(255), QUERY_ bigint, WSDLINFOS_ID_ bigint, primary key (DBID_)) ENGINE=InnoDB;
create table DEF_SCOPE_MESSEXS (SCOPE_ID_ bigint not null, MESSEX_NAME_ varchar(255)) ENGINE=InnoDB;
create table DEF_SCOPE_VARINIT (SCOPE_ID_ bigint not null, VAR_NAME_ varchar(255)) ENGINE=InnoDB;
create table DEF_SNIPPET (DBID_ bigint not null auto_increment, CLASS_ varchar(255) not null, TXT_ varchar(3999), LANG_ varchar(255), primary key (DBID_)) ENGINE=InnoDB;
create table DEF_TO_PART (DBID_ bigint not null, PART_ varchar(255), FROM_VAR_ varchar(255), primary key (DBID_)) ENGINE=InnoDB;
create table DEF_VARIABLE (DBID_ bigint not null, NAME_ varchar(255), MSGTYPE_QNAME_ varchar(255), TYPE_QNAME_ varchar(255), ELT_QNAME_ varchar(255), VIRTUAL_COPY_ bigint, DEFAULT_VAL_ longtext, SCOPE_ID_ bigint, VAR_NAME_ varchar(255), primary key (DBID_)) ENGINE=InnoDB;
create table DEF_VAR_PARTS (VAR_ID_ bigint not null, TYPE_QNAME_ varchar(255), ELT_QNAME_ varchar(255), NAME_ varchar(255) not null, primary key (VAR_ID_, NAME_)) ENGINE=InnoDB;
create table DEF_WSDLINFOS (DBID_ bigint not null, primary key (DBID_)) ENGINE=InnoDB;
create table DEF_WSDLINFOS_wsdlDefinitions (WSDLINFOS_ID_ bigint not null, WSDLINFOS_DEF_ longblob) ENGINE=InnoDB;
create table DEF_WSDL_PROPERTY (DBID_ bigint not null, ELT_QNAME_ varchar(255), NAME_QNAME_ varchar(255), TYPE_QNAME_ varchar(255), WSDLINFOS_ID_ bigint, primary key (DBID_)) ENGINE=InnoDB;
create table RUNT_ACTIV_PROC (DBID_ bigint not null, PROCESS_UUID_ varchar(255), PROCESS_QNAME_ varchar(255) unique, primary key (DBID_)) ENGINE=InnoDB;
create table RUNT_BPEL_FAULT_ (DBID_ bigint not null, CLASS_ varchar(255) not null, FAULT_QNAME_ varchar(255), CONTENT_ longtext, primary key (DBID_)) ENGINE=InnoDB;
create table RUNT_CS_RUNTIME (DBID_ bigint not null, DBVERSION_ integer not null, SCOPE_ID_ bigint not null, NAME_ varchar(255) not null, INITIALIZED_ bit, primary key (DBID_)) ENGINE=InnoDB;
create table RUNT_CS_RUN_PROP (CS_ID_ bigint not null, VALUE_ longtext, QNAME_ varchar(255) not null, primary key (CS_ID_, QNAME_)) ENGINE=InnoDB;
create table RUNT_EXECUTION (DBID_ bigint not null, CLASS_ char(1) not null, DBVERSION_ integer not null, NODE_ varchar(255), ID_ varchar(255) not null unique, STATE_ varchar(255), RESUME_STATE_ varchar(255), PARENT_ bigint, INSTANCE_ bigint, ACTIVITY_UUID_ varchar(255), FOREACH_ID_ bigint, SCOPE_RT_ID_ bigint, WAITING_EXEC_ID_ bigint, INSTANCE_UUID_ varchar(255), PROCESS_UUID_ varchar(255), INSTANCE_STATE_ varchar(255), PARENT_INST_START_TIME_ datetime, primary key (DBID_)) ENGINE=InnoDB;
create table RUNT_EXEC_INVOKE_DATA (DBID_ bigint not null, OP_KEY_ varchar(3999), MSG_PARTS_ longtext, ENDPOINT_ longtext, primary key (DBID_)) ENGINE=InnoDB;
create table RUNT_FOREACH_RUNTIME (DBID_ bigint not null, DBVERSION_ integer not null, COUNTER_FINAL_ integer, COUNTER_CURRENT_ integer, BRANCH_COUNT_ integer, primary key (DBID_)) ENGINE=InnoDB;
create table RUNT_INST_COUNT (DBID_ bigint not null, PROCESS_UUID_ varchar(255), PROCESS_QNAME_ varchar(255), primary key (DBID_)) ENGINE=InnoDB;
create table RUNT_JOB (DBID_ bigint not null, CLASS_ varchar(255) not null, DBVERSION_ integer not null, DUEDATE_ datetime, ISSUSPENDED_ bit, LOCKOWNER_ varchar(255), LOCKEXPTIME_ datetime, PRIORITY_ integer, RETRIES_ integer, DELAY_ bigint, EXCEPTION_ bigint, EXECUTION_ bigint, SIGNAL_ varchar(255), REPEAT_ bigint, INVOKE_DATA_ bigint, SIG_INVOKE_DATA_ bigint, primary key (DBID_)) ENGINE=InnoDB;
create table RUNT_JOB_EXCEPTION_ (DBID_ bigint not null, EXCEPTION_ longblob, primary key (DBID_)) ENGINE=InnoDB;
create table RUNT_LINK_RUNTIME (DBID_ bigint not null, DBVERSION_ integer not null, STATUS_ varchar(255), WAITING_EXEC_ bigint, NAME_ varchar(255), ACT_INST_UUID_ varchar(255), FLOW_RUNTIME_ID_ bigint, primary key (DBID_)) ENGINE=InnoDB;
create table RUNT_PENDING_MESS (DBID_ bigint not null, DBVERSION_ integer not null, MSG_PARTS_ longtext, MSG_CARRIER_ID_ varchar(255), OP_KEY_ varchar(3999), ADDED_DATE_ datetime, primary key (DBID_)) ENGINE=InnoDB;
create table RUNT_PEND_MSG_CS_KEYS (MSG_ID_ bigint not null, KEY_ integer) ENGINE=InnoDB;
create table RUNT_PL_RUNTIME (DBID_ bigint not null, DBVERSION_ integer not null, NAME_ varchar(255) not null, SCOPE_ID_ bigint not null, P_END_REF longtext, primary key (DBID_)) ENGINE=InnoDB;
create table RUNT_PROC_COUNT (DBID_ bigint not null, DBVERSION_ bigint not null, COUNTER_ bigint, primary key (DBID_)) ENGINE=InnoDB;
create table RUNT_REPLIER (DBID_ bigint not null, DBVERSION_ integer not null, MSG_EXCHG_ varchar(255), OP_KEY_ varchar(3999), SCOPE_RUNTIME_ bigint, primary key (DBID_)) ENGINE=InnoDB;
create table RUNT_SCOPE_RUNTIME (DBID_ bigint not null, DBVERSION_ integer not null, PARENT_ bigint, END_DATE_ bigint, ACTIVITY_UUID_ varchar(255), SCOPE_DEF_ varchar(255), SCOPE_STATE_ tinyblob, LAST_EXCEPTION_ bigint, COMPENSATE_EXEC_ bigint, primary key (DBID_)) ENGINE=InnoDB;
create table RUNT_SIG_INVOKE_DATA (DBID_ bigint not null, MSG_PARTS_ longtext, FAULT_QNAME_ varchar(255), INVOKE_EXCEPTION_ longblob, primary key (DBID_)) ENGINE=InnoDB;
create table RUNT_VAR_RUNTIME (DBID_ bigint not null, DBVERSION_ integer not null, NAME_ varchar(255) not null, VALUE_ longtext, IS_MSG_ bit not null, SCOPE_ID_ bigint not null, primary key (DBID_)) ENGINE=InnoDB;
create table RUNT_WAIT_EXEC (DBID_ bigint not null, DBVERSION_ integer not null, EXEC_ID_ bigint, IN_ELT_ varchar(255), primary key (DBID_)) ENGINE=InnoDB;
create table RUNT_WAIT_EXEC_CS_ (WAIT_ID_ bigint not null, CS_ID_ bigint not null, primary key (WAIT_ID_, CS_ID_)) ENGINE=InnoDB;
create table RUNT_WAIT_EXEC_CS_KEYS (WAIT_ID_ bigint not null, KEY_ integer) ENGINE=InnoDB;
create index IF_COND_IDX on DEF_ACTIVITY (COND_);
create index IF_ACT_IDX on DEF_ACTIVITY (ACTIVITY_);
create index ACT_SCOPE_IDX on DEF_ACTIVITY (SCOPE_);
create index WAIT_DLINE_IDX on DEF_ACTIVITY (DEADLINE_);
create index FOR_FINAL_IDX on DEF_ACTIVITY (FINAL_COUNT_);
create index FOR_START_IDX on DEF_ACTIVITY (START_COUNT_);
create index ELSE_ACT_IDX on DEF_ACTIVITY (ELSE_ACTIVITY_);
create index RECV_IN_MSG_IDX on DEF_ACTIVITY (ANON_IN_MESS_);
create index ACT_CHILD_IDX on DEF_ACTIVITY (CHILD_NODE_);
create index FOR_COND_IDX on DEF_ACTIVITY (COMPL_COND_);
create index ACT_JOIN_COND_IDX on DEF_ACTIVITY (TARG_JOIN_COND_);
create index REPLY_OUT_IDX on DEF_ACTIVITY (ANON_OUT_MESS_);
create index WAIT_DUR_IDX on DEF_ACTIVITY (DURATION_);
alter table DEF_ACTIVITY add constraint REPLY_OUT_FK foreign key (ANON_OUT_MESS_) references DEF_VARIABLE (DBID_);
alter table DEF_ACTIVITY add constraint ELSE_ACT_FK foreign key (ELSE_ACTIVITY_) references DEF_NODE (DBID_);
alter table DEF_ACTIVITY add constraint FOR_START_FK foreign key (START_COUNT_) references DEF_SNIPPET (DBID_);
alter table DEF_ACTIVITY add constraint ACT_SCOPE_FK foreign key (SCOPE_) references DEF_ACTIVITY (DBID_);
alter table DEF_ACTIVITY add constraint IF_ACT_FK foreign key (ACTIVITY_) references DEF_NODE (DBID_);
alter table DEF_ACTIVITY add constraint ACT_CHILD_FK foreign key (CHILD_NODE_) references DEF_NODE (DBID_);
alter table DEF_ACTIVITY add constraint FOR_COND_FK foreign key (COMPL_COND_) references DEF_SNIPPET (DBID_);
alter table DEF_ACTIVITY add constraint WAIT_DLINE_FK foreign key (DEADLINE_) references DEF_SNIPPET (DBID_);
alter table DEF_ACTIVITY add constraint IF_COND_FK foreign key (COND_) references DEF_SNIPPET (DBID_);
alter table DEF_ACTIVITY add constraint WAIT_DUR_FK foreign key (DURATION_) references DEF_SNIPPET (DBID_);
alter table DEF_ACTIVITY add constraint FKCA401E295BE3B464 foreign key (catchVariableDefinition) references DEF_VARIABLE (DBID_);
alter table DEF_ACTIVITY add constraint ACT_JOIN_COND_FK foreign key (TARG_JOIN_COND_) references DEF_SNIPPET (DBID_);
alter table DEF_ACTIVITY add constraint FKCA401E2934D2137C foreign key (EXT_PROCESS_) references DEF_PROCESS (DBID_);
alter table DEF_ACTIVITY add constraint FKCA401E29EBD7E30B foreign key (NODE_) references DEF_NODE (DBID_);
alter table DEF_ACTIVITY add constraint FOR_FINAL_FK foreign key (FINAL_COUNT_) references DEF_SNIPPET (DBID_);
alter table DEF_ACTIVITY add constraint RECV_IN_MSG_FK foreign key (ANON_IN_MESS_) references DEF_VARIABLE (DBID_);
alter table DEF_ACTIVITY add constraint FKCA401E299D390524 foreign key (INBOUND_PROCESS_) references DEF_PROCESS (DBID_);
create index ASSIGN_COPY_IDX on DEF_COPY_ELT (ASSIGN_ID_);
create index INVOKE_OUT_IDX on DEF_COPY_ELT (INVOKE_OUT_ID_);
create index RECEIVE_IN_IDX on DEF_COPY_ELT (RECEIVE_IN_ID_);
create index INVOKE_IN_IDX on DEF_COPY_ELT (INVOKE_IN_ID_);
create index REPLY_MSG_EX_IDX on DEF_COPY_ELT (REPLY_ID_);
alter table DEF_COPY_ELT add constraint RECEIVE_IN_FK foreign key (RECEIVE_IN_ID_) references DEF_ACTIVITY (DBID_);
alter table DEF_COPY_ELT add constraint FKEDF5BDD5C53F732 foreign key (ON_MSG_IN_ID_) references DEF_ON_MSG (DBID_);
alter table DEF_COPY_ELT add constraint REPLY_MSG_EX_FK foreign key (REPLY_ID_) references DEF_ACTIVITY (DBID_);
alter table DEF_COPY_ELT add constraint FKEDF5BDDDE1523BD foreign key (FROM_) references DEF_FROM_TO_ELT (DBID_);
alter table DEF_COPY_ELT add constraint ASSIGN_COPY_FK foreign key (ASSIGN_ID_) references DEF_ACTIVITY (DBID_);
alter table DEF_COPY_ELT add constraint INVOKE_IN_FK foreign key (INVOKE_IN_ID_) references DEF_ACTIVITY (DBID_);
alter table DEF_COPY_ELT add constraint INVOKE_OUT_FK foreign key (INVOKE_OUT_ID_) references DEF_ACTIVITY (DBID_);
alter table DEF_COPY_ELT add constraint FKEDF5BDD6464ED5D foreign key (TO_) references DEF_FROM_TO_ELT (DBID_);
alter table DEF_COPY_ELT add constraint FKEDF5BDD3A9909E3 foreign key (ON_EVT_IN_ID_) references DEF_ON_EVT (DBID_);
create index REPLY_COR_IDX on DEF_CORREL (REPLY_ID_);
create index INV_RES_IDX on DEF_CORREL (INVOKE_RES_ID_);
create index INV_REQ_IDX on DEF_CORREL (INVOKE_REQ_ID_);
create index RECV_COR_IDX on DEF_CORREL (RECEIVE_ID_);
alter table DEF_CORREL add constraint FK59CAAEED6F00CA0D foreign key (CS_) references DEF_CS (DBID_);
alter table DEF_CORREL add constraint REPLY_COR_FK foreign key (REPLY_ID_) references DEF_ACTIVITY (DBID_);
alter table DEF_CORREL add constraint FK59CAAEED1BC92050 foreign key (ON_MSG_ID_) references DEF_ON_MSG (DBID_);
alter table DEF_CORREL add constraint INV_RES_FK foreign key (INVOKE_RES_ID_) references DEF_ACTIVITY (DBID_);
alter table DEF_CORREL add constraint RECV_COR_FK foreign key (RECEIVE_ID_) references DEF_ACTIVITY (DBID_);
alter table DEF_CORREL add constraint FK59CAAEEDF7C10905 foreign key (ON_EVT_ID_) references DEF_ON_EVT (DBID_);
alter table DEF_CORREL add constraint INV_REQ_FK foreign key (INVOKE_REQ_ID_) references DEF_ACTIVITY (DBID_);
create index SCOPE_CS_IDX on DEF_CS (SCOPE_ID_);
alter table DEF_CS add constraint SCOPE_CS_FK foreign key (SCOPE_ID_) references DEF_ACTIVITY (DBID_);
alter table DEF_CS_PROPERTIES_ add constraint FK1882EBD71E706273 foreign key (CS_ID_) references DEF_CS (DBID_);
alter table DEF_CS_PROPERTIES_ add constraint FK1882EBD72B0757BD foreign key (elt) references DEF_WSDL_PROPERTY (DBID_);
create index ELSIF_IDX on DEF_ELSE_IF (IF_ID_);
create index ELSIF_ACT_IDX on DEF_ELSE_IF (ACTIVITY_);
create index ELSIF_COND_IDX on DEF_ELSE_IF (CONDITION_);
alter table DEF_ELSE_IF add constraint ELSIF_FK foreign key (IF_ID_) references DEF_ACTIVITY (DBID_);
alter table DEF_ELSE_IF add constraint ELSIF_ACT_FK foreign key (ACTIVITY_) references DEF_NODE (DBID_);
alter table DEF_ELSE_IF add constraint ELSIF_COND_FK foreign key (CONDITION_) references DEF_SNIPPET (DBID_);
alter table DEF_FROM_TO_ELT add constraint FKFD0421A4C4132A10 foreign key (EXPRESSION_) references DEF_SNIPPET (DBID_);
alter table DEF_FROM_TO_ELT add constraint FKFD0421A43ADD900A foreign key (VAR_QUERY_) references DEF_SNIPPET (DBID_);
create index FLOW_LINK_IDX on DEF_LINK (FLOW_ID_);
alter table DEF_LINK add constraint FLOW_LINK_FK foreign key (FLOW_ID_) references DEF_ACTIVITY (DBID_);
alter table DEF_LINK add constraint FK56AF8014C74809C5 foreign key (SOURCE_ACTIVITY_) references DEF_ACTIVITY (DBID_);
alter table DEF_LINK add constraint FK56AF8014A26937BB foreign key (TARGET_ACTIVITY_) references DEF_ACTIVITY (DBID_);
create index ACT_SRC_LNK_IDX on DEF_LINK_SOURCE (ACTIVITY_ID_);
alter table DEF_LINK_SOURCE add constraint FK7E0B5AA6DE682DBD foreign key (LINK_) references DEF_LINK (DBID_);
alter table DEF_LINK_SOURCE add constraint ACT_SRC_LNK_FK foreign key (ACTIVITY_ID_) references DEF_ACTIVITY (DBID_);
alter table DEF_LINK_SOURCE add constraint FK7E0B5AA635D1566F foreign key (TRANS_COND_) references DEF_SNIPPET (DBID_);
create index ACT_TGT_LNK_IDX on DEF_LINK_TARGET (ACTIVITY_ID_);
alter table DEF_LINK_TARGET add constraint FK7EF9641CDE682DBD foreign key (LINK_) references DEF_LINK (DBID_);
alter table DEF_LINK_TARGET add constraint ACT_TGT_LNK_FK foreign key (ACTIVITY_ID_) references DEF_ACTIVITY (DBID_);
alter table DEF_NAMESPACE add constraint FKBC348D61329E08E foreign key (SNIPPET_ID_) references DEF_SNIPPET (DBID_);
create index IDX_NODE_PROCESS on DEF_NODE (PROCESS_);
create index IDX_EXHDLR_NODE on DEF_NODE (EXCEPTHNDLR_);
create index IDX_NODE_BEHAV_OBJ on DEF_NODE (BEHAV_OBJ_);
create index IDX_NODE_PARENT on DEF_NODE (PARENT_);
alter table DEF_NODE add constraint FK_NODE_PROCESS foreign key (PROCESS_) references DEF_PROCESS (DBID_);
alter table DEF_NODE add constraint FK_NODE_BEHAV_OBJ foreign key (BEHAV_OBJ_) references DEF_ACTIVITY (DBID_);
alter table DEF_NODE add constraint FK_EXHDLR_NODE foreign key (EXCEPTHNDLR_) references DEF_EXCEPTHNDLR (DBID_);
alter table DEF_NODE add constraint FK_NODE_PARENT foreign key (PARENT_) references DEF_NODE (DBID_);
create index PICK_ON_ALRM_IDX on DEF_ON_ALARM (PICK_ID_);
create index ACT_ON_ALARM_IDX on DEF_ON_ALARM (ACTIVITY_ID_);
alter table DEF_ON_ALARM add constraint FKD0C506EBFAD5EF6D foreign key (REPEAT_) references DEF_SNIPPET (DBID_);
alter table DEF_ON_ALARM add constraint ACT_ON_ALARM_FK foreign key (ACTIVITY_ID_) references DEF_ACTIVITY (DBID_);
alter table DEF_ON_ALARM add constraint FKD0C506EB58E1CE94 foreign key (DURATION_) references DEF_SNIPPET (DBID_);
alter table DEF_ON_ALARM add constraint FKD0C506EBF1C83F9E foreign key (ACTIVITY_) references DEF_NODE (DBID_);
alter table DEF_ON_ALARM add constraint PICK_ON_ALRM_FK foreign key (PICK_ID_) references DEF_ACTIVITY (DBID_);
alter table DEF_ON_ALARM add constraint FKD0C506EB5C32DA50 foreign key (DEADLINE_) references DEF_SNIPPET (DBID_);
create index ACT_ON_EVT_IDX on DEF_ON_EVT (ACTIVITY_ID_);
alter table DEF_ON_EVT add constraint ACT_ON_EVT_FK foreign key (ACTIVITY_ID_) references DEF_ACTIVITY (DBID_);
alter table DEF_ON_EVT add constraint FK6E3C78FD9F1241FC foreign key (INBOUND_ELT_) references DEF_ACTIVITY (DBID_);
alter table DEF_ON_EVT add constraint FK6E3C78FDF1C83F9E foreign key (ACTIVITY_) references DEF_NODE (DBID_);
alter table DEF_ON_EVT add constraint FK6E3C78FDF7237F7A foreign key (ANON_IN_MESS_) references DEF_VARIABLE (DBID_);
create index PICK_ON_MSG_IDX on DEF_ON_MSG (PICK_ID_);
alter table DEF_ON_MSG add constraint FK6E3C969B9F1241FC foreign key (INBOUND_ELT_) references DEF_ACTIVITY (DBID_);
alter table DEF_ON_MSG add constraint FK6E3C969BF1C83F9E foreign key (ACTIVITY_) references DEF_NODE (DBID_);
alter table DEF_ON_MSG add constraint PICK_ON_MSG_FK foreign key (PICK_ID_) references DEF_ACTIVITY (DBID_);
alter table DEF_ON_MSG add constraint FK6E3C969BF7237F7A foreign key (ANON_IN_MESS_) references DEF_VARIABLE (DBID_);
create index SCOPE_PL_IDX on DEF_PLNK (SCOPE_ID_);
alter table DEF_PLNK add constraint SCOPE_PL_FK foreign key (SCOPE_ID_) references DEF_ACTIVITY (DBID_);
alter table DEF_PLNKTYPE add constraint FKB268428D64EEA1B7 foreign key (WSDLINFOS_ID_) references DEF_WSDLINFOS (DBID_);
alter table DEF_PLNKT_ROLES add constraint FK7D378ABFA4BE5179 foreign key (PLNKTYPE_ID_) references DEF_PLNKTYPE (DBID_);
create index IDX_EXHDLR_PROCESS on DEF_PROCESS (EXCEPTHNDLR_);
create index PROCESS_INST_CNT_IDX on DEF_PROCESS (instanceCreationLock);
create index IDX_PROCDEF_INIT on DEF_PROCESS (INITIAL_);
create index PROCESS_UUID_IDX on DEF_PROCESS (PROCESS_UUID_);
alter table DEF_PROCESS add constraint FK_PROCDEF_INITIAL foreign key (INITIAL_) references DEF_NODE (DBID_);
alter table DEF_PROCESS add constraint FK9429A3F5E142EB34 foreign key (instanceCreationLock) references RUNT_INST_COUNT (DBID_);
alter table DEF_PROCESS add constraint FK_EXHDLR_PROCESS foreign key (EXCEPTHNDLR_) references DEF_EXCEPTHNDLR (DBID_);
alter table DEF_PROCESS add constraint FK9429A3F59A504866 foreign key (WSDL_INFOS_) references DEF_WSDLINFOS (DBID_);
alter table DEF_PROC_COMMON_CS add constraint FK4295E5351E706273 foreign key (CS_ID_) references DEF_CS (DBID_);
alter table DEF_PROC_COMMON_CS add constraint FK4295E535F1DBFC22 foreign key (PROCESS_ID_) references DEF_PROCESS (DBID_);
alter table DEF_PROC_RESOURCES add constraint FK24F1AFF6F1DBFC22 foreign key (PROCESS_ID_) references DEF_PROCESS (DBID_);
alter table DEF_PROPALIAS add constraint FK4643D0D364EEA1B7 foreign key (WSDLINFOS_ID_) references DEF_WSDLINFOS (DBID_);
alter table DEF_PROPALIAS add constraint FK4643D0D32E48839 foreign key (QUERY_) references DEF_SNIPPET (DBID_);
create index SCOPE_MSG_EX_IDX on DEF_SCOPE_MESSEXS (SCOPE_ID_);
alter table DEF_SCOPE_MESSEXS add constraint SCOPE_MSG_EX_FK foreign key (SCOPE_ID_) references DEF_ACTIVITY (DBID_);
create index SCOPE_INIT_VAR_IDX on DEF_SCOPE_VARINIT (SCOPE_ID_);
alter table DEF_SCOPE_VARINIT add constraint SCOPE_INIT_VAR_FK foreign key (SCOPE_ID_) references DEF_ACTIVITY (DBID_);
create index SCOPE_VAR_IDX on DEF_VARIABLE (SCOPE_ID_);
alter table DEF_VARIABLE add constraint FKE278FD9681EEAE9 foreign key (VIRTUAL_COPY_) references DEF_COPY_ELT (DBID_);
alter table DEF_VARIABLE add constraint SCOPE_VAR_FK foreign key (SCOPE_ID_) references DEF_ACTIVITY (DBID_);
alter table DEF_VAR_PARTS add constraint FK930457AECC8F6326 foreign key (VAR_ID_) references DEF_VARIABLE (DBID_);
alter table DEF_WSDLINFOS_wsdlDefinitions add constraint FK26B03DE464EEA1B7 foreign key (WSDLINFOS_ID_) references DEF_WSDLINFOS (DBID_);
alter table DEF_WSDL_PROPERTY add constraint FK3542887664EEA1B7 foreign key (WSDLINFOS_ID_) references DEF_WSDLINFOS (DBID_);
create index BPEL_SCOPE_CS_IDX on RUNT_CS_RUNTIME (SCOPE_ID_);
alter table RUNT_CS_RUNTIME add constraint BPEL_SCOPE_CS_FK foreign key (SCOPE_ID_) references RUNT_SCOPE_RUNTIME (DBID_);
create index IDX_CS_RUN_PROP_CS_ on RUNT_CS_RUN_PROP (CS_ID_);
create index IDX_CS_RUN_PROP_QNAME_ on RUNT_CS_RUN_PROP (QNAME_);
alter table RUNT_CS_RUN_PROP add constraint FK_CS_RUN_PROP_CS_ foreign key (CS_ID_) references RUNT_CS_RUNTIME (DBID_);
create index IDX_EXEC_PARENT on RUNT_EXECUTION (PARENT_);
create index IDX_EXEC_INST_UUID_ on RUNT_EXECUTION (INSTANCE_UUID_);
create index BPEL_EXEC_FOREACH_IDX on RUNT_EXECUTION (FOREACH_ID_);
create index BPEL_EXEC_WAIT_IDX on RUNT_EXECUTION (WAITING_EXEC_ID_);
create index BPEL_EXEC_SCOPE_IDX on RUNT_EXECUTION (SCOPE_RT_ID_);
create index IDX_EXEC_INSTANCE on RUNT_EXECUTION (INSTANCE_);
alter table RUNT_EXECUTION add constraint BPEL_EXEC_FOREACH_FK foreign key (FOREACH_ID_) references RUNT_FOREACH_RUNTIME (DBID_);
alter table RUNT_EXECUTION add constraint BPEL_EXEC_SCOPE_FK foreign key (SCOPE_RT_ID_) references RUNT_SCOPE_RUNTIME (DBID_);
alter table RUNT_EXECUTION add constraint BPEL_EXEC_WAIT_FK foreign key (WAITING_EXEC_ID_) references RUNT_WAIT_EXEC (DBID_);
alter table RUNT_EXECUTION add constraint FK_EXEC_INSTANCE foreign key (INSTANCE_) references RUNT_EXECUTION (DBID_);
alter table RUNT_EXECUTION add constraint FK_EXEC_PARENT foreign key (PARENT_) references RUNT_EXECUTION (DBID_);
create index COUNT_PROCESS_UUID_IDX on RUNT_INST_COUNT (PROCESS_UUID_);
create index IDX_INVOKE_JOB_DATA_ on RUNT_JOB (INVOKE_DATA_);
create index IDX_JOB_DUE_DATE_ on RUNT_JOB (DUEDATE_);
create index IDX_SIG_JOB_DATA_ on RUNT_JOB (SIG_INVOKE_DATA_);
create index IDX_JOB_EXECUTION on RUNT_JOB (EXECUTION_);
create index IDX_JOB_EXCEPT_ on RUNT_JOB (EXCEPTION_);
create index IDX_JOB_PRIORITY_ on RUNT_JOB (PRIORITY_);
alter table RUNT_JOB add constraint FK_INVOKE_JOB_DATA_ foreign key (INVOKE_DATA_) references RUNT_EXEC_INVOKE_DATA (DBID_);
alter table RUNT_JOB add constraint FK_JOB_EXCEPT_ foreign key (EXCEPTION_) references RUNT_JOB_EXCEPTION_ (DBID_);
alter table RUNT_JOB add constraint FK_SIG_JOB_DATA_ foreign key (SIG_INVOKE_DATA_) references RUNT_SIG_INVOKE_DATA (DBID_);
alter table RUNT_JOB add constraint FK_JOB_EXECUTION foreign key (EXECUTION_) references RUNT_EXECUTION (DBID_);
create index BPEL_LINK_EXEC_IDX on RUNT_LINK_RUNTIME (WAITING_EXEC_);
create index BPEL_FLOW_LINK_IDX on RUNT_LINK_RUNTIME (FLOW_RUNTIME_ID_);
alter table RUNT_LINK_RUNTIME add constraint BPEL_LINK_EXEC_FK foreign key (WAITING_EXEC_) references RUNT_EXECUTION (DBID_);
alter table RUNT_LINK_RUNTIME add constraint BPEL_FLOW_LINK_FK foreign key (FLOW_RUNTIME_ID_) references RUNT_EXECUTION (DBID_);
create index PENDING_MSG_OP_KEY_IDX on RUNT_PENDING_MESS (OP_KEY_);
create index IDX_MSG_CS_KEY on RUNT_PEND_MSG_CS_KEYS (MSG_ID_);
create index PENDING_MSG_CS_KEY_IDX on RUNT_PEND_MSG_CS_KEYS (KEY_);
alter table RUNT_PEND_MSG_CS_KEYS add constraint FK_MSG_CS_KEY foreign key (MSG_ID_) references RUNT_PENDING_MESS (DBID_);
create index BPEL_SCOPE_PLK_IDX on RUNT_PL_RUNTIME (SCOPE_ID_);
alter table RUNT_PL_RUNTIME add constraint BPEL_SCOPE_PLK_FK foreign key (SCOPE_ID_) references RUNT_SCOPE_RUNTIME (DBID_);
create index REPLIER_SCOPE_IDX on RUNT_REPLIER (SCOPE_RUNTIME_);
alter table RUNT_REPLIER add constraint REPLIER_SCOPE_FK foreign key (SCOPE_RUNTIME_) references RUNT_SCOPE_RUNTIME (DBID_);
create index SR_EXCEPTION_IDX on RUNT_SCOPE_RUNTIME (LAST_EXCEPTION_);
create index BPEL_SR_PARENT_IDX on RUNT_SCOPE_RUNTIME (PARENT_);
create index SR_COMP_EXEC_IDX on RUNT_SCOPE_RUNTIME (COMPENSATE_EXEC_);
alter table RUNT_SCOPE_RUNTIME add constraint SR_EXCEPTION_FK foreign key (LAST_EXCEPTION_) references RUNT_BPEL_FAULT_ (DBID_);
alter table RUNT_SCOPE_RUNTIME add constraint SR_COMP_EXEC_FK foreign key (COMPENSATE_EXEC_) references RUNT_EXECUTION (DBID_);
alter table RUNT_SCOPE_RUNTIME add constraint BPEL_SR_PARENT_FK foreign key (PARENT_) references RUNT_SCOPE_RUNTIME (DBID_);
create index BPEL_SCOPE_VAR_IDX on RUNT_VAR_RUNTIME (SCOPE_ID_);
alter table RUNT_VAR_RUNTIME add constraint BPEL_SCOPE_VAR_FK foreign key (SCOPE_ID_) references RUNT_SCOPE_RUNTIME (DBID_);
create index WAIT_EXEC_EXEC_IDX on RUNT_WAIT_EXEC (EXEC_ID_);
alter table RUNT_WAIT_EXEC add constraint WAIT_EXEC_EXEC_FK foreign key (EXEC_ID_) references RUNT_EXECUTION (DBID_);
create index WAIT_EXEC_CS_IDX on RUNT_WAIT_EXEC_CS_ (CS_ID_);
create index IDX_WAIT_CS on RUNT_WAIT_EXEC_CS_ (WAIT_ID_);
alter table RUNT_WAIT_EXEC_CS_ add constraint FK_WAIT_CS foreign key (WAIT_ID_) references RUNT_WAIT_EXEC (DBID_);
alter table RUNT_WAIT_EXEC_CS_ add constraint WAIT_EXEC_CS_FK foreign key (CS_ID_) references RUNT_CS_RUNTIME (DBID_);
create index IDX_WAIT_CS_KEY on RUNT_WAIT_EXEC_CS_KEYS (WAIT_ID_);
create index WAIT_EXEC_CS_KEY_IDX on RUNT_WAIT_EXEC_CS_KEYS (KEY_);
alter table RUNT_WAIT_EXEC_CS_KEYS add constraint FK_WAIT_CS_KEY foreign key (WAIT_ID_) references RUNT_WAIT_EXEC (DBID_);
create table BPEL_CORE_SEQS ( sequence_name varchar(255) not null ,  next_val bigint, primary key ( sequence_name ) )  ENGINE=InnoDB;
