Hello guys. :) I wanted to ask if someone could provide me with an example of an intermediate event. I tried to follow the example that is in the xpert ivy designer guide. Which can be found here. But I have no clue of what I'm doing. :( This is my code:
import java.awt.GridBagConstraints; import java.awt.GridLayout; import java.awt.Insets; import javax.swing.JLabel; 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; /* * / / * @author Flaty / public class IntermediateTest extends AbstractProcessIntermediateEventBean implements IProcessIntermediateEventBean {
} 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. I hope the problem is understandable and I hope it is not completely stupid what we are trying to do. Thanks in advance. :) asked 15.09.2014 at 10:58 Flaty |
The poll() method will be executed in regular intervals. And as soon as the boolean variable eventOccurred switches to true, the code within the if-statement is executed and as a consequence, the workflow is resumed. So actually, you only have to implement the part of poll() after the comment-section
Here you actually can do, whatever you like to check if your event occurred. E.g. check contents of a file or a database-table, send an http request to somewhere and parse its response etc. Take care of the event id. Since you might have multiple cases, which are waiting at this process step, ivy identifies which case to continue according to the id. answered 15.09.2014 at 13:40 Dominik Regli ♦ Thank you, and can I define the interval in which the poll method is called? And do is there some sort of unique ID related with a workflow that I could use or do I have to create an own?
(15.09.2014 at 13:44)
Flaty
You can set the poll time interval with getEventBeanRuntime().setPollTimeInterval(...) You have to generate an event id on your own e.g. with GuidUtil.generateID(). Generate the id on the inscription mask. Within the poll() method you should receive the id from event itself.
(15.09.2014 at 14:27)
Dominik Regli ♦
@Flaty was my answer useful for you? If yes, please mark it as 'accepted' with the tick-symbol at the left. Thanks!
(16.09.2014 at 12:05)
Dominik Regli ♦
|
Once you sign in you will be able to subscribe for any updates here
By RSS:Markdown Basics
Tags:
Asked: 15.09.2014 at 10:58
Seen: 2,918 times
Last updated: 16.09.2014 at 12:05
Could you be a little bit more concrete, on what you want to do?
As far as I understood, you want to have a workflow, that 1. stops at a certain point 2. sends an email to a user 3. and waits, until the user does something (what should he do?) As soon as the user has done, what he was asked for, the workflow continues.
Did I understand right, or do you intend to do sth. different?
You understood it correctly. In later steps we want to try to communicate to another system so the event talks to the system and the systems answers. But for the moment we want to send an email to someone and we thought that we might could send a link to the user which he clicks and than the workflow continues. Or something like this so we don't know how to make the program listen for an event and how to trigger it from the outside.
Thanks for your quick reply. :)