Hello,
I have a problem to control apoc.trigger's state (pause or resume) by given condition.I've did the research about the manual and website and found nothing relative content about this. Here is the my whole question:
Expected Goal
I want to complete a series transactions by apoc.trigger, and I hope defferent packs of apoc change their state(pause or resume) by given condition.
Goal Example
exsited apoc.trigger:
apoc.trigger1,apoc.trigger2,apoc.trigger3,apoc.trigger4*
Here is a node with a property "state", when the node.state=1, the apoc.trigger1 and apoc.trigger3 change their state to "pause". When node.state=2,apoc.trigger2 and apoc.trigger4 change state to "pause" etc , like this kind of control.
My Method and Experiment
I use the nested apoc.trigger to complete my goal.
here is the code:
call apoc.trigger.add('insipient','
unwind apoc.trigger.propertiesByKey($assignedNodeProperties,"state") as map
with map.node as node
where node.state=0
apoc.trigger.pause("createMethod")
',{})
Error:
How to Reproduce the Problem
node:
CREATE (:scenario {state: 0, name: "street"})
CREATE (:test {type: 1}),(:test{class: "apple"})
existed apoc:
call apoc.trigger.add('classify','
unwind apoc.trigger.propertiesByKey($assignedNodeProperties,"type") as map
with map.node as node
match(n:test{class:"apple"})
with node,n
where node.type=1
create(node)-[r:isA]->(n)
',{})
Specifications
Is there anyone could give me some clues to realize my goal or any suggestion to my method...?
Jelly