<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Intermediate Event Bean Running State</title><link>https://answers.axonivy.com/questions/1380/intermediate-event-bean-running-state</link><description>&lt;p&gt;I have an &lt;a href="http://developer.axonivy.com/doc/latest/DesignerGuideHtml/ivy.processmodeling.html#ivy-processmodels-elements-intermediate"&gt;Intermediate Event Bean&lt;/a&gt; which is &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;used in several processes in the same
   project and&lt;/li&gt;
&lt;li&gt;the project is deployed to multiple &lt;a href="http://developer.axonivy.com/doc/latest/DesignerGuideHtml/ivy.concepts.html#ivy-deployment-processmodelversion"&gt;PMV&lt;/a&gt;s&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Is an Intermediate Event Bean started once per &lt;a href="http://developer.axonivy.com/doc/latest/DesignerGuideHtml/ivy.concepts.html#ivy-deployment-application"&gt;Application&lt;/a&gt;, project (PMV) or element on the engine?&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/1380/intermediate-event-bean-running-state" rel="self"></atom:link><language>en</language><lastBuildDate>Thu, 25 Jun 2015 11:58:49 -0400</lastBuildDate><item><title>Answer by Flavio Sadeghi</title><link>https://answers.axonivy.com/questions/1380/intermediate-event-bean-running-state/1381</link><description>&lt;p&gt;A Intermediate Event Bean is &lt;strong&gt;started for each element and for each PMV&lt;/strong&gt;, when the PMV is &lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/application/ActivityState.html#ACTIVE"&gt;active&lt;/a&gt;. Note, also an &lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/application/ReleaseState.html#ARCHIVED"&gt;archived&lt;/a&gt; PMV is an active one. &lt;/p&gt;
&lt;p&gt;In a cluster environment (Enterprise Edition) an Intermediate Event Bean is &lt;strong&gt;only started on the master node&lt;/strong&gt;. Visit the &lt;a href="http://developer.axonivy.com/doc/latest/DesignerGuideHtml/ivy.processmodeling.html#ivy-processmodels-elements-intermediate"&gt;User Guide&lt;/a&gt; for more info.&lt;/p&gt;
&lt;p&gt;When an Intermediate Event Bean should only to the job in the &lt;a href="http://developer.axonivy.com/doc/latest/publicApi/ch/ivyteam/ivy/application/ReleaseState.html#RELEASED"&gt;&lt;code&gt;released&lt;/code&gt;&lt;/a&gt; PMV, the following condition could be integrated into the poll-Method to cancel the execution:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;@Override
public void poll() {

    ReleaseState pmvReleaseState = getEventBeanRuntime().getIntermediateEventElement().getProcessModelVersion().getReleaseState();
    boolean isReleasedPmv = ReleaseState.RELEASED.equals(pmvReleaseState);
    if (!isReleasedPmv) {
        return;
    }

    // ...
}
&lt;/code&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Flavio Sadeghi</dc:creator><pubDate>Thu, 25 Jun 2015 11:58:49 -0400</pubDate><guid>https://answers.axonivy.com/questions/1380/intermediate-event-bean-running-state/1381</guid></item></channel></rss>