Search in sources :

Example 1 with EventTransformer

use of org.jbpm.process.core.event.EventTransformer in project jbpm by kiegroup.

the class StartNodeInstance method signalEvent.

public void signalEvent(String type, Object event) {
    String variableName = (String) getStartNode().getMetaData("TriggerMapping");
    if (variableName != null) {
        VariableScopeInstance variableScopeInstance = (VariableScopeInstance) resolveContextInstance(VariableScope.VARIABLE_SCOPE, variableName);
        if (variableScopeInstance == null) {
            throw new IllegalArgumentException("Could not find variable for start node: " + variableName);
        }
        EventTransformer transformer = getStartNode().getEventTransformer();
        if (transformer != null) {
            event = transformer.transformEvent(event);
        }
        variableScopeInstance.setVariable(variableName, event);
    }
    triggerCompleted();
}
Also used : VariableScopeInstance(org.jbpm.process.instance.context.variable.VariableScopeInstance) EventTransformer(org.jbpm.process.core.event.EventTransformer)

Example 2 with EventTransformer

use of org.jbpm.process.core.event.EventTransformer in project jbpm by kiegroup.

the class EventNodeInstance method signalEvent.

public void signalEvent(String type, Object event) {
    String variableName = getEventNode().getVariableName();
    if (variableName != null) {
        VariableScopeInstance variableScopeInstance = (VariableScopeInstance) resolveContextInstance(VariableScope.VARIABLE_SCOPE, variableName);
        if (variableScopeInstance == null) {
            throw new IllegalArgumentException("Could not find variable for event node: " + variableName);
        }
        EventTransformer transformer = getEventNode().getEventTransformer();
        if (transformer != null) {
            event = transformer.transformEvent(event);
        }
        variableScopeInstance.setVariable(variableName, event);
    }
    triggerCompleted();
}
Also used : VariableScopeInstance(org.jbpm.process.instance.context.variable.VariableScopeInstance) EventTransformer(org.jbpm.process.core.event.EventTransformer)

Aggregations

EventTransformer (org.jbpm.process.core.event.EventTransformer)2 VariableScopeInstance (org.jbpm.process.instance.context.variable.VariableScopeInstance)2