Call & Wait
The Call & Wait Intermediate Event element is located in the Event & Gateway drawer of the process editor palette.
This element is one of Axon.ivy facilities to integrate custom-made software, legacy systems, proprietary applications or any other external system through an Axon.ivy Java interface. The Call & Wait element is splitted into a Call part and a Wait part. The Call part is similar to the PI (Programming Interface) Activity process element. It can be used to call (send request) an external system. Whereas the Wait part is similar to the Wait Program Intermediate Event element and can be used to wait for the response from the external system. For the process designer the use of a Call & Wait element is easier compared to the use of a Program Interface followed by an Intermediate Event because he only has to configure one Java class and does not have to care about event identifiers.
The Call part of the element will instantiate a Java class that must
implement the interface IUserAsynchronousProcessExtension
call the method
performRequest each time a process comes to the Call
& Wait element. The common way to implement a Call bean is to extend the
abstract base class AbstractUserAsynchronousProcessExtension.
The Wait part of the element will interrupt the process execution and waits for an external event to occur. Technically spoken the current task will be ended and a new system task is created that waits for the event. If the event is fired the new task and therefore the process after the Call & Wait element will be executed.
You provide a listener for the external event by implementing a public
static inner Java class of the Call part with the name
IntermediateEvent that implements the
interface. The Call & Wait element
IntermediateEvent Java class. It can then trigger
the event by calling the method
the Axon.ivy runtime engine IProcessIntermediateEventBeanRuntime.
The common way to implement a Wait (Intermediate Event) bean is to
extend the abstract base class
The interface also includes an inner editor class to parametrize the beans. The editor provides one configuration which is set on both beans the Call and the Wait bean. You will find the documentation of the interface and the abstract class in the Java Doc of the Axon.ivy Public API.
An Axon.ivy Engine Enterprise Edition consists of multiple server instances (nodes) that are running on different machines.
As described above Call & Wait consists of two parts:
The Call part will be instantiated on all nodes, and it will do its job wherever it resides. After a call part a new task will be created in a waiting status
Normally the Wait part works only on the master node. When it fires (when the external event arrives) the task state will change. Such a task can be executed on every node.
This is the standard behaviour in order to eliminate racing conditions in normal Call & Wait situations.
Described behaviour is regarded as correct and it should cover most of the use cases. In case you understood the behaviour and still you need the Wait part of your Call & Wait bean to run on all closer nodes, you may instruct the engine to do so. Just have your bean class implement the (empty) marker interface IMultiNodeCapable and the above restriction will no longer apply.
Please be aware of the fact that having multiple running instances of the same bean may lead to race conditions!
The Name Tab is included in the mask of all process elements and contains the name and a description of the element.
On this tab you set the Java class which implements the interface
and defines a public static inner
IntermediateEvent that implements the interface
This class is called when the Call &
Wait step is executed. Furthermore, you can define exception handlers to
react on errors such as not reachable systems, insufficient privileges
and many more.
- Java Class to Execute
The fully qualified name of the Call & Wait Java class implementing IUserAsynchronousProcessExtension and a public static inner class called
IntermediateEventthat implements the interface IProcessIntermediateEventBean. Use the New Bean Class Wizard () to create a new Java source file with an example implementation of the bean class.
You can add a graphical configuration editor for the Java call (i.e. setting the parameter values) on the Call & Wait inscription mask. See section Tab Editor for more details.
- Program Error
Occurs whenever an exception is thrown during the execution of the class. The error can be handled by a catching Error Start.
Sets a timeout for the return of the call to the Call part Java class.
- Timeout Error
Occurs when the timeout is reached. The error can be handled by a catching Error Start.
On this tab you define the timeout behaviour during the Wait part of the element.
Here you can specify a time (Duration) how long the current case should wait for an intermediate event and what should happen if no event was received after this time. You can optionally start an exception process, delete the waiting task or continue the waiting task without receiving an intermediate event.
This tab displays the editor that can be integrated in the external Java
bean of the process element. The editor is implemented as an inner
public static class of the Java bean class and must have the name
Editor. Additionally the editor class must implement the
interface. The common way to
implement the editor class is to extend the abstract base class
and to override the
saveUiDataToConfiguration. The method
createEditorPanelContent can be used to build the UI components of
the editor. You can add any AWT/Swing component to the given
editorPanel parameter. With the given
parameter, which is of the type
you can create text
fields that support ivyScript and have smart buttons that provide access
to the process data, environment functions and Java classes.
Here is an example on how an editor could look like:
As you can see, the editor provides access to any process relevant data that can be used by your own process elements. For instance, you can easily transfer process data to your legacy system.
The following part shows the implementation of the above editor. As
mentioned earlier Axon.ivy provides the
represents a text field with ivyScript support and smart buttons. Inside
createEditorPanelContent use the method
editorEnvironment parameter to create an instance of such
an editor. Use the
loadUiDataFromConfiguration method to read the
bean configuration and show within the UI components. Inside this method
you can use the methods
getBeanConfigurationProperty to read the bean configuration. Use the
saveUiDataToConfiguration to save the data in the UI
components to the bean configuration. Inside this method you can use
save the bean configuration.
public static class Editor extends AbstractProcessExtensionConfigurationEditor
private IIvyScriptEditor editorUser;
private IIvyScriptEditor editorEventTyp;
private IIvyScriptEditor editorLinkId;
private IIvyScriptEditor editorFieldValue;
protected void createEditorPanelContent(Container editorPanel,
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("Event Typ"));
protected void loadUiDataFromConfiguration()
protected boolean saveUiDataToConfiguration()
At runtime you have to evaluate the IvyScript the user have entered into
the ivy script editors. If you implement for example the
class there is a perform method which
is executed at runtime. At this point you want to access the configured
data in the editor. The following code snippet show how you can evaluate
the value of an IIvyScriptEditor.
If you use the
IIvyScriptEditor you only get the value by calling the
executeIvyScript method of the AbstractUserProcessExtension.
public CompositeObject perform(IRequestId requestId, CompositeObject in,
IIvyScriptContext context) throws Exception
out = in.clone();
ownContext = createOwnContext(context);
String eventtyp = "";
String linkId = "";
String fieldValue = "";
String user= "";
user = (String)executeIvyScript(ownContext, getConfigurationProperty("User"));
eventtyp = (String)executeIvyScript(ownContext, getConfigurationProperty("Event Typ"));
linkId = (String)executeIvyScript(ownContext, getConfigurationProperty("Link-Id"));
fieldValue = (String)executeIvyScript(ownContext, getConfigurationProperty("Feldwert"));
// add your call here
On this tab you configure the task which is created when this element is executed by the awaitet event. This task will not appear in any user task list and is exclusively handled by the system. The values on this tab are therefore only relevant for analysing the finished tasks and not for the task list itself.
On this tab you can configure the output of the element (i.e. the data that leaves the element). You can use the variable result that holds additional information about the event received by the Wait part Java class.
See Output Tab for a more detailed description.
For each incoming connection you have a separate
available which carries the data of the Xth input. Hover with the
mouse over the incoming connections of the element to learn which
input connection corresponds to which variable.