Search in sources :

Example 1 with ContextInstanceFactory

use of org.jbpm.process.instance.impl.ContextInstanceFactory in project jbpm by kiegroup.

the class WorkItemNodeInstance method getContextInstance.

@Override
public ContextInstance getContextInstance(Context context) {
    ContextInstanceFactory conf = ContextInstanceFactoryRegistry.INSTANCE.getContextInstanceFactory(context);
    if (conf == null) {
        throw new IllegalArgumentException("Illegal context type (registry not found): " + context.getClass());
    }
    ContextInstance contextInstance = (ContextInstance) conf.getContextInstance(context, this, (ProcessInstance) getProcessInstance());
    if (contextInstance == null) {
        throw new IllegalArgumentException("Illegal context type (instance not found): " + context.getClass());
    }
    return contextInstance;
}
Also used : ContextInstance(org.jbpm.process.instance.ContextInstance) ProcessInstance(org.jbpm.process.instance.ProcessInstance) ContextInstanceFactory(org.jbpm.process.instance.impl.ContextInstanceFactory)

Example 2 with ContextInstanceFactory

use of org.jbpm.process.instance.impl.ContextInstanceFactory in project jbpm by kiegroup.

the class RuleSetNodeInstance method getContextInstance.

@Override
public ContextInstance getContextInstance(Context context) {
    ContextInstanceFactory conf = ContextInstanceFactoryRegistry.INSTANCE.getContextInstanceFactory(context);
    if (conf == null) {
        throw new IllegalArgumentException("Illegal context type (registry not found): " + context.getClass());
    }
    ContextInstance contextInstance = (ContextInstance) conf.getContextInstance(context, this, (ProcessInstance) getProcessInstance());
    if (contextInstance == null) {
        throw new IllegalArgumentException("Illegal context type (instance not found): " + context.getClass());
    }
    return contextInstance;
}
Also used : ContextInstance(org.jbpm.process.instance.ContextInstance) ProcessInstance(org.jbpm.process.instance.ProcessInstance) ContextInstanceFactory(org.jbpm.process.instance.impl.ContextInstanceFactory)

Example 3 with ContextInstanceFactory

use of org.jbpm.process.instance.impl.ContextInstanceFactory in project jbpm by kiegroup.

the class SubProcessNodeInstance method getContextInstance.

@Override
public ContextInstance getContextInstance(Context context) {
    ContextInstanceFactory conf = ContextInstanceFactoryRegistry.INSTANCE.getContextInstanceFactory(context);
    if (conf == null) {
        throw new IllegalArgumentException("Illegal context type (registry not found): " + context.getClass());
    }
    ContextInstance contextInstance = (ContextInstance) conf.getContextInstance(context, this, (ProcessInstance) getProcessInstance());
    if (contextInstance == null) {
        throw new IllegalArgumentException("Illegal context type (instance not found): " + context.getClass());
    }
    return contextInstance;
}
Also used : ContextInstance(org.jbpm.process.instance.ContextInstance) ProcessInstance(org.jbpm.process.instance.ProcessInstance) ContextInstanceFactory(org.jbpm.process.instance.impl.ContextInstanceFactory)

Example 4 with ContextInstanceFactory

use of org.jbpm.process.instance.impl.ContextInstanceFactory in project jbpm by kiegroup.

the class CompositeContextNodeInstance method getContextInstance.

public ContextInstance getContextInstance(final Context context) {
    ContextInstanceFactory conf = ContextInstanceFactoryRegistry.INSTANCE.getContextInstanceFactory(context);
    if (conf == null) {
        throw new IllegalArgumentException("Illegal context type (registry not found): " + context.getClass());
    }
    ContextInstance contextInstance = (ContextInstance) conf.getContextInstance(context, this, (ProcessInstance) getProcessInstance());
    if (contextInstance == null) {
        throw new IllegalArgumentException("Illegal context type (instance not found): " + context.getClass());
    }
    return contextInstance;
}
Also used : ContextInstance(org.jbpm.process.instance.ContextInstance) ProcessInstance(org.jbpm.process.instance.ProcessInstance) ContextInstanceFactory(org.jbpm.process.instance.impl.ContextInstanceFactory)

Aggregations

ContextInstance (org.jbpm.process.instance.ContextInstance)4 ProcessInstance (org.jbpm.process.instance.ProcessInstance)4 ContextInstanceFactory (org.jbpm.process.instance.impl.ContextInstanceFactory)4