//流程定義 KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); kbuilder.add(ResourceFactory.newClassPathResource("sample.bpmn"), ResourceType.BPMN2); KnowledgeBase kbase = kbuilder.newKnowledgeBase(); //流程會話 StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession(); // start a new process instance ksession.startProcess("com.sample.bpmn.hello");