package ensaio; import java.io.File; import java.util.HashMap; import java.util.Map; import org.kie.api.KieBase; import org.kie.api.io.ResourceType; import org.kie.api.runtime.KieSession; import org.kie.internal.builder.KnowledgeBuilder; import org.kie.internal.builder.KnowledgeBuilderFactory; import org.kie.internal.io.ResourceFactory; /** * This is a sample file to launch a process. */ public class ProcessMain { public static final void main(String[] args) throws Exception { KieSession ksession = createKieSession(); ksession.addEventListener(new TestEventListener()); Map params = new HashMap(); params.put("action", "CreateAgent"); ksession.startProcess("InterfaceLayer.bpmn", params); ksession.dispose(); } private static KieSession createKieSession() { KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); File file = new File("C:\\Users\\Bruno Veloso\\Desktop\\UVIGO\\SchemaRepository\\"+"Producer003"+"\\InterfaceLayer.bpmn"); kbuilder.add(ResourceFactory.newFileResource(file), ResourceType.BPMN2); //kbuilder.add(ResourceFactory.newClassPathResource("InterfaceLayer.bpmn"), ResourceType.BPMN2); KieBase kbase = kbuilder.newKnowledgeBase(); return kbase.newKieSession(); } }