I've been trying to make a conditional sync with SymmetricDS. Problem is, no matter what I do it just ignores the table that is supposed to be synced conditionally and just syncs tables without conditions.
So I suppose, I use those conditions wrong. I couldn't find this material in User guide for current version, so I have the following:
insert into sym_router
(router_id,source_node_group_id,target_node_group_id,router_type,router_expression,create_time,last_update_time)
values('corp_2_one_store', 'corp', 'store', 'column','STORE_ID=:EXTERNAL_ID or OLD_STORE_ID=:EXTERNAL_ID',current_timestamp, current_timestamp);
insert into sym_trigger_router
(trigger_id,router_id,initial_load_order,initial_load_select,last_update_time,create_time)
values('item_selling_price','corp_2_one_store',100,'store_id=''$(externalId)''',current_timestamp,current_timestamp);
from samples packaged with SymmetricDS, but I changed "store" to "client" and "corp" to "server" in my own configs and it doesn't work anymore. And quite frankly, I have no idea what's going on here with STORE_ID=:EXTERNAL_ID or OLD_STORE_ID=:EXTERNAL_ID
and store_id=''$(externalId)''
and why there is two of them.
From the site I have from earlier versions this example:
insert into SYM_TRIGGER
(source_table_name, source_node_group_id, target_node_group_id, channel_id,
sync_on_insert, sync_on_update, sync_on_delete,
node_select,
initial_load_order, last_updated_by, last_updated_time, create_time)
values
('sale_transaction', 'corp', 'store', 'sale_transaction',
1, 1, 1,
'and external_id = $(curTriggerValue).store',
105, 'demo', current_timestamp, current_timestamp);
But this obviously doesn't work since half of this info is now stored in different place, but even removing colums that are not there anymore (who knows, maybe these new tables only store the same info for readability?) I can't get it to work.
Any suggestions?
Update
When I run just the training example everything works. So real question here is: what do these mean:
STORE_ID=:EXTERNAL_ID or OLD_STORE_ID=:EXTERNAL_ID
and store_id=''$(externalId)''
? And how can I change that if my nodes are called server
instead of corp
and client
instead of store
?
Update 2
According to this, my router is okay, and I have some problems with my sym_trigger_router
configuration, namely, store_id=''$(externalId)''