@kleysonr The below cypher query may respond to your question:
MATCH (p:Person {name: "John"})-[:WORKS_FOR]->(c:Company),
(e:Event)-[:CHANGED_BY]->(p),
(e)-[:BELONGS_TO]->(pss:Process)
RETURN {name:p.name,companies:COLLECT(DISTINCT c.name),processes:COLLECT(DISTINCT pss.id)} As result
Note that John is working in two or more Companies;
The above cypher query is not filtered by company's name but they are returned in array(all affected companies names).
@jhakiz Thanks for the answer, but the query is bringing all the process where John is connected.
I'm looking for a different answer.
Based on the image above, John works for 2 companies at the same time. But for the process XT02145-1 he did a login using his account of Comapny 2 and did some change on the process. Then he did a logout of Company 2 and did a new login using his account of Company 3 and again changed the process.
I'm looking for all the process where John had the same behavior. So, he used different accounts to execute different actions in the same process.
@kleysonr as my answer's note said, the result returned by cypher query is not filtered by company's name. To do so put the below where:
MATCH (p:Person {name: "John"})-[:WORKS_FOR]->(c:Company),
(e:Event)-[:CHANGED_BY]->(p),
(e)-[:BELONGS_TO]->(pss:Process)
WHERE c.name IN ["Company 2","Company 3"]
RETURN {name:p.name,companies:COLLECT(DISTINCT c.name),processes:COLLECT(DISTINCT pss.id)} As result