# Custom filter/CPD - Event-Driven

**URL:** https://discourse.paraview.org/t/custom-filter-cpd-event-driven/295
**Category:** Development
**Created:** [July 10, 2018, 4:36pm UTC](https://discourse.paraview.org/t/custom-filter-cpd-event-driven/295 "2018-07-10T16:36:56Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![michal.wozniak](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/848f3c/32.png) [@michal.wozniak](https://discourse.paraview.org/u/michal.wozniak)
#### Post date: [July 10, 2018, 4:36pm UTC](https://discourse.paraview.org/t/custom-filter-cpd-event-driven/295/1 "2018-07-10T16:36:56Z")

</div>

Hi @utkarsh.ayachit,

My colleagues and I went to meet you a couple of months ago during Kitware’s training courses. We told you about our problem with our huge state files and how long it was taking during each update.

We are using custom filters (.CPD) to simplify the pipeline. We were wondering back then if it was possible to separate their update process :

- execute inner “pipeline” only when the outer pipeline trigger the custom filter
- the custom filter would use an event-driven pipeline
- 

![event_driven_cpd](https://discourse.paraview.org/uploads/default/original/1X/26642c7b3e7029e643d07e5fbba22511741f57d8.png)

 ![Ideal_concept](https://discourse.paraview.org/uploads/default/original/1X/65b5bc11ebda1b23b0e9c9a947c277d4c81c42e7.jpg)

You told us that it was possible by doing some modification in our XML.

I have been looking through the LoadCustomProxyDefinitions logic and I don’t see anything related to this. So how do you transform the .cpd to be able to use an event-driven pipeline

Thank you.

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [July 15, 2018, 2:12pm UTC](https://discourse.paraview.org/t/custom-filter-cpd-event-driven/295/2 "2018-07-15T14:12:33Z")

</div>

I don’t follow. In a single threaded application, I don’t see the difference between “Current Version” and “Ideal concept”. What’s an “event driven pipeline”?

A custom filter is just wrapper for an inner pipeline(s). The end points in the inner pipeline are directly connected to the outer pipeline when the custom filter is instantiated in a regular ParaView pipeline.

---

<div class="post-metadata">

### Author: ![michal.wozniak](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/848f3c/32.png) [@michal.wozniak](https://discourse.paraview.org/u/michal.wozniak)
#### Post date: [July 17, 2018, 2:33pm UTC](https://discourse.paraview.org/t/custom-filter-cpd-event-driven/295/3 "2018-07-17T14:33:23Z")

</div>

> [@utkarsh.ayachit](#):
>
> The end points in the inner pipeline are directly connected to the outer pipeline when the custom filter is instantiated in a regular ParaView pipeline.

![image](https://discourse.paraview.org/uploads/default/original/1X/4d3f1d93c697286b7ff0a1b6bd4fe04ead0ffd18.jpg)

in the “current version”, when you trigger apply on filter 4, it will verify filter 3 to see if it need to update its data, then it will verify 2,3 - 2,2 ,2.1 …

so if your custom filter is using multiple ( eg 10+ ), it will verify the 10+ inner filters.

![image](https://discourse.paraview.org/uploads/default/original/1X/70e4cd96b294ef51e66a2a555f19f2132d107568.jpg)

In the outer pipeline we only see the "custom filter (2), therefore each time we are determining if it is required to update the data, we should only verify the outer layer. It should have a similar behavior to the programmable filter

programmable filter :

- Has an “inner pipeline” created by the python script
- each filter in our script aren’t doing anything validation to see if they need to be updated.
- Outer layer decide if it needs to be updated

is it possible to create a custom filter that replicates the behavior of the programmable filter?

thanks

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [July 18, 2018, 12:28am UTC](https://discourse.paraview.org/t/custom-filter-cpd-event-driven/295/4 "2018-07-18T00:28:27Z")

</div>

> [@michal.wozniak](#):
>
> is it possible to create a custom filter that replicates the behavior of the programmable filter?

Ah! No, the custom filter cannot be used for that purpose. You should indeed use programmable filters, or custom vtkAlgorithm subclasses, or PythonAlgorithm (pv 3.6 onwards) based Python filters for that.
