Questions Tagged With eventhttps://answers.axonivy.com/tags/event/?type=rss&user=Flatyquestions tagged <span class="tag">event</span>enMon, 15 Sep 2014 10:58:45 -0400Using the Intermediate Eventhttps://answers.axonivy.com/questions/951/using-the-intermediate-event<p>Hello guys. :) I wanted to ask if someone could provide me with an example of an intermediate event.</p> <p>I tried to follow the example that is in the xpert ivy designer guide. Which can be found <a href="https://www.google.de/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;cad=rja&amp;uact=8&amp;ved=0CCEQFjAA&amp;url=http%3A%2F%2Fwww.ivyteam.ch%2Fdownloads%2Fxivy%2F4.2.0%2Fdoc%2FDesignerGuide.pdf&amp;ei=lakWVImnAcmOO9f3gfAD&amp;usg=AFQjCNFcVI--hj6yjeu5xZJPB7o5O2Eg8g&amp;sig2=9bo_LNnJ6gFn8EglCjvg4Q&amp;bvm=bv.75097201,d.ZWU">here</a>. But I have no clue of what I'm doing. :(</p> <p>This is my code: </p> <pre><code>import java.awt.Container; </code></pre> <p>import java.awt.GridBagConstraints; import java.awt.GridLayout; import java.awt.Insets;</p> <p>import javax.swing.JLabel;</p> <p>import ch.ivyteam.ivy.persistence.PersistencyException; import ch.ivyteam.ivy.process.extension.IIvyScriptEditor; import ch.ivyteam.ivy.process.extension.IProcessExtensionConfigurationEditorEnvironment; import ch.ivyteam.ivy.process.extension.impl.AbstractProcessExtensionConfigurationEditor; import ch.ivyteam.ivy.process.intermediateevent.AbstractProcessIntermediateEventBean; import ch.ivyteam.ivy.process.intermediateevent.IProcessIntermediateEventBean; import ch.ivyteam.log.Logger;</p> <p>/*<em> * </em>/</p> <p>/<em><em> * @author Flaty </em> </em>/ public class IntermediateTest extends AbstractProcessIntermediateEventBean implements IProcessIntermediateEventBean {</p> <pre><code>/** * */ public IntermediateTest() { super("IntermediateTest", "Description of IntermediateTest", String.class); } /* (non-Javadoc) * @see ch.ivyteam.ivy.process.eventstart.IProcessStartEventBean#poll() */ @Override public void poll() { boolean eventOccured = true; String additionalInformation = ""; String resultObject = ""; // An external system was trigger to do something. // The external system or the one who triggered the external system must provide // a event identifier so that later the event identifier can be used to match // the waiting IntermediateEvent with the event from the external system. // Therefore, the event identifier has to be provided twice. // First, on the IntermediateEvent Inscription Mask to define for // which event the IntermediateEvent has to wait for. // Second, on the IntermediateEventBean to specify which event was received. // However, the external system that sends the event must somehow provide the event identifier in his event data. String eventIdentifier = ""; // ===&gt; Add here your code to poll for new events from the external system // that should trigger the continue of waiting processes &lt;=== // Parse the event identifier and the result object out of the event data if (eventOccured) { try { getEventBeanRuntime().fireProcessIntermediateEventEx( eventIdentifier, resultObject, additionalInformation); } catch (PersistencyException ex) { // ===&gt; Add here your exception handling code if the event cannot be processed &lt;=== } } } /** * @author Flaty * */ public static class Editor extends AbstractProcessExtensionConfigurationEditor { private IIvyScriptEditor editorUser; private IIvyScriptEditor editorEventTyp; private IIvyScriptEditor editorLinkId; private IIvyScriptEditor editorFieldValue; @Override protected void createEditorPanelContent(Container editorPanel, IProcessExtensionConfigurationEditorEnvironment editorEnvironment) { editorPanel.setLayout(new GridLayout(4,2)); editorUser = editorEnvironment.createIvyScriptEditor(null,null, "String"); editorEventTyp = editorEnvironment.createIvyScriptEditor(null,null, "String"); editorLinkId = editorEnvironment.createIvyScriptEditor(null, null, "String"); editorFieldValue = editorEnvironment.createIvyScriptEditor(null, null); editorPanel.add(new JLabel("User")); editorPanel.add(editorUser.getComponent()); editorPanel.add(new JLabel("Event Typ")); editorPanel.add(editorEventTyp.getComponent()); editorPanel.add(new JLabel("Link-Id")); editorPanel.add(editorLinkId.getComponent()); editorPanel.add(new JLabel("Feldwert")); editorPanel.add(editorFieldValue.getComponent()); } @Override protected void loadUiDataFromConfiguration() { editorUser.setText(getBeanConfigurationProperty("User")); editorEventTyp.setText(getBeanConfigurationProperty("EventTyp")); editorLinkId.setText(getBeanConfigurationProperty("LinkId")); editorFieldValue.setText(getBeanConfigurationProperty("Feldwert")); } @Override protected boolean saveUiDataToConfiguration() { setBeanConfigurationProperty("User", editorUser.getText()); setBeanConfigurationProperty("EventTyp", editorEventTyp.getText()); setBeanConfigurationProperty("LinkId", editorLinkId.getText()); setBeanConfigurationProperty("Feldwert", editorFieldValue.getText()); return true; } } </code></pre> <p>}</p> <p>So it is calling the poll method but I don't know what to do now. Actually we want to send an email in advance ( which is not a problem ) and that with this email we want to tell someone else that he should do something. And our process should wait. Than the other person should be able to send some parameters and let the process proceed. </p> <p>I hope the problem is understandable and I hope it is not completely stupid what we are trying to do.</p> <p>Thanks in advance. :)</p>FlatyMon, 15 Sep 2014 10:58:45 -0400https://answers.axonivy.com/questions/951/using-the-intermediate-eventevent