Class EventMapper
- java.lang.Object
-
- jadex.platform.service.processengine.EventMapper
-
public class EventMapper extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EventMapper.MappingInfo
static class
EventMapper.ModelDetails
-
Field Summary
Fields Modifier and Type Field Description protected IInternalAccess
component
The process engine component.protected java.util.Map<java.lang.String,java.util.List<EventMapper.MappingInfo>>
instancemappings
The map of event types to process models.protected java.util.Map<java.lang.String,java.util.List<EventMapper.MappingInfo>>
instanceprocs
The map of registration id to mapping infos (for cleanup).protected java.util.Map<java.lang.String,java.util.Set<java.lang.String>>
instancewaits
The model to instance wait event types.protected java.util.Map<java.lang.String,java.util.List<EventMapper.MappingInfo>>
modelmappings
The map of event types to mapping infos.protected java.util.Map<java.lang.String,java.util.List<EventMapper.MappingInfo>>
modelprocs
The map of process to mapping infos (for cleanup).
-
Constructor Summary
Constructors Constructor Description EventMapper(IInternalAccess component)
Create a new event mapper.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
addInstanceMapping(UnparsedExpression uexp, java.lang.String[] events, java.util.Map<java.lang.String,java.lang.Object> vals, java.lang.String[] imports, boolean remove, IResultCommand<IFuture<java.lang.Void>,java.lang.Object> cmd)
Added an instance mapping.void
addModelMapping(java.lang.String[] events, IFilter<java.lang.Object> filter, java.lang.String modelname, IResourceIdentifier rid, java.lang.String actid, SubscriptionIntermediateFuture<ProcessEngineEvent> fut, java.util.Set<java.lang.String> waittypes, java.util.Set<java.lang.String> epstarttypes)
Added a mapping.static java.lang.String
getEventType(java.lang.Object event, java.lang.String type)
Get the event type.protected void
internalProcessInstanceEvent(java.lang.Object event, java.lang.String type, java.util.List<EventMapper.MappingInfo> mis, int i, Future<java.lang.Boolean> ret)
boolean
isEventInstanceWaitRelevant(java.lang.String event)
Test if an event type is potentially matched by any of the intermediate wait events (domain types).IFuture<java.lang.Boolean>
processInstanceEvent(java.lang.Object event, java.lang.String type)
Map an event to a process instance.EventMapper.ModelDetails
processModelEvent(java.lang.Object event, java.lang.String type)
Map an event to a process model.void
removeInstanceMappings(java.lang.String id)
Remove mappings for a process instance.void
removeModelMappings(java.lang.String modelname)
Remove mappings for a process model.
-
-
-
Field Detail
-
component
protected IInternalAccess component
The process engine component.
-
modelmappings
protected java.util.Map<java.lang.String,java.util.List<EventMapper.MappingInfo>> modelmappings
The map of event types to mapping infos.
-
modelprocs
protected java.util.Map<java.lang.String,java.util.List<EventMapper.MappingInfo>> modelprocs
The map of process to mapping infos (for cleanup).
-
instancemappings
protected java.util.Map<java.lang.String,java.util.List<EventMapper.MappingInfo>> instancemappings
The map of event types to process models.
-
instanceprocs
protected java.util.Map<java.lang.String,java.util.List<EventMapper.MappingInfo>> instanceprocs
The map of registration id to mapping infos (for cleanup).
-
instancewaits
protected java.util.Map<java.lang.String,java.util.Set<java.lang.String>> instancewaits
The model to instance wait event types.
-
-
Constructor Detail
-
EventMapper
public EventMapper(IInternalAccess component)
Create a new event mapper.
-
-
Method Detail
-
processInstanceEvent
public IFuture<java.lang.Boolean> processInstanceEvent(java.lang.Object event, java.lang.String type)
Map an event to a process instance.- Parameters:
event
- The event object.- Returns:
- The process model.
-
internalProcessInstanceEvent
protected void internalProcessInstanceEvent(java.lang.Object event, java.lang.String type, java.util.List<EventMapper.MappingInfo> mis, int i, Future<java.lang.Boolean> ret)
- Parameters:
event
-type
-mis
-i
-ret
-
-
processModelEvent
public EventMapper.ModelDetails processModelEvent(java.lang.Object event, java.lang.String type)
Map an event to a process model.- Parameters:
event
- The event object.- Returns:
- The process model.
-
getEventType
public static java.lang.String getEventType(java.lang.Object event, java.lang.String type)
Get the event type. Extracs the type from the event object, when the type nulls.
-
addInstanceMapping
public java.lang.String addInstanceMapping(UnparsedExpression uexp, java.lang.String[] events, java.util.Map<java.lang.String,java.lang.Object> vals, java.lang.String[] imports, boolean remove, IResultCommand<IFuture<java.lang.Void>,java.lang.Object> cmd)
Added an instance mapping.- Parameters:
event
- The event name.filter
- The optional filter.info
- The modelname.
-
removeInstanceMappings
public void removeInstanceMappings(java.lang.String id)
Remove mappings for a process instance.- Parameters:
id
- The id from the registration.
-
addModelMapping
public void addModelMapping(java.lang.String[] events, IFilter<java.lang.Object> filter, java.lang.String modelname, IResourceIdentifier rid, java.lang.String actid, SubscriptionIntermediateFuture<ProcessEngineEvent> fut, java.util.Set<java.lang.String> waittypes, java.util.Set<java.lang.String> epstarttypes)
Added a mapping.- Parameters:
event
- The event name.filter
- The optional filter.modelname
- The modelname.
-
removeModelMappings
public void removeModelMappings(java.lang.String modelname)
Remove mappings for a process model.- Parameters:
modelname
- The modelname.
-
isEventInstanceWaitRelevant
public boolean isEventInstanceWaitRelevant(java.lang.String event)
Test if an event type is potentially matched by any of the intermediate wait events (domain types).
-
-