• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java KieCommands类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.kie.api.command.KieCommands的典型用法代码示例。如果您正苦于以下问题:Java KieCommands类的具体用法?Java KieCommands怎么用?Java KieCommands使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



KieCommands类属于org.kie.api.command包,在下文中一共展示了KieCommands类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: processRules

import org.kie.api.command.KieCommands; //导入依赖的package包/类
public Measure processRules(@Body Measure measure) {
	
	KieServicesConfiguration config = KieServicesFactory.newRestConfiguration(
			kieHost, kieUser,
			kiePassword);
	
	Set<Class<?>> jaxBClasses = new HashSet<Class<?>>();
	jaxBClasses.add(Measure.class);
	
	config.addJaxbClasses(jaxBClasses);
	config.setMarshallingFormat(MarshallingFormat.JAXB);
	RuleServicesClient client = KieServicesFactory.newKieServicesClient(config)
			.getServicesClient(RuleServicesClient.class);

       List<Command<?>> cmds = new ArrayList<Command<?>>();
	KieCommands commands = KieServices.Factory.get().getCommands();
	cmds.add(commands.newInsert(measure));
	
    GetObjectsCommand getObjectsCommand = new GetObjectsCommand();
    getObjectsCommand.setOutIdentifier("objects");

	
	cmds.add(commands.newFireAllRules());
	cmds.add(getObjectsCommand);
	BatchExecutionCommand myCommands = CommandFactory.newBatchExecution(cmds,
			"DecisionTableKS");
	ServiceResponse<ExecutionResults> response = client.executeCommandsWithResults("iot-ocp-businessrules-service", myCommands);
			
	List responseList = (List) response.getResult().getValue("objects");
	
	Measure responseMeasure = (Measure) responseList.get(0);
	
	return responseMeasure;

}
 
开发者ID:sabre1041,项目名称:iot-ocp,代码行数:36,代码来源:BusinessRulesBean.java


示例2: executeCommands

import org.kie.api.command.KieCommands; //导入依赖的package包/类
@Test
public void executeCommands() {
	System.out.println("== Sending commands to the server ==");
	RuleServicesClient rulesClient = kieServicesClient
			.getServicesClient(RuleServicesClient.class);
	KieCommands commandsFactory = KieServices.Factory.get().getCommands();
	Command<?> insert = commandsFactory.newInsert("Some String OBJ");
	Command<?> fireAllRules = commandsFactory.newFireAllRules();
	Command<?> batchCommand = commandsFactory.newBatchExecution(Arrays
			.asList(insert, fireAllRules));
	ServiceResponse<ExecutionResults> executeResponse = rulesClient
			.executeCommandsWithResults(RULES_CONTAINER, batchCommand);
	if (executeResponse.getType() == ResponseType.SUCCESS) {
		System.out.println("Commands executed with success! Response: ");
		System.out.println(executeResponse.getResult());
	} else {
		System.out.println("Error executing rules. Message: ");
		System.out.println(executeResponse.getMsg());
	}
}
 
开发者ID:jesuino,项目名称:bpms6-examples,代码行数:21,代码来源:DecisionServerJMSTest.java


示例3: executeCommands

import org.kie.api.command.KieCommands; //导入依赖的package包/类
@Test
public void executeCommands() {
	System.out.println("== Sending commands to the server ==");
	RuleServicesClient rulesClient = kieServicesClient
			.getServicesClient(RuleServicesClient.class);
	KieCommands commandsFactory = KieServices.Factory.get().getCommands();
	Command<?> insert = commandsFactory.newInsert("Some String OBJ");
	Command<?> fireAllRules = commandsFactory.newFireAllRules();
	Command<?> batchCommand = commandsFactory.newBatchExecution(Arrays
			.asList(insert, fireAllRules));
	ServiceResponse<ExecutionResults> executeResponse = rulesClient.executeCommandsWithResults(RULES_CONTAINER, batchCommand);
	if (executeResponse.getType() == ResponseType.SUCCESS) {
		System.out.println("Commands executed with success! Response: ");
		System.out.println(executeResponse.getResult());
	} else {
		System.out.println("Error executing rules. Message: ");
		System.out.println(executeResponse.getMsg());
	}
}
 
开发者ID:jesuino,项目名称:bpms6-examples,代码行数:20,代码来源:DecisionServerTest.java


示例4: createRandomCommand

import org.kie.api.command.KieCommands; //导入依赖的package包/类
public BatchExecutionCommand createRandomCommand() {
    Person person = new Person();
    String name = NAMES[random.nextInt(NAMES.length)];
    person.setName(name);

    List<Command<?>> cmds = new ArrayList<Command<?>>();
    KieCommands commands = KieServices.Factory.get().getCommands();
    cmds.add(commands.newInsert(person));
    cmds.add(commands.newFireAllRules());
    cmds.add(commands.newQuery("greetings", "get greeting"));
    BatchExecutionCommand command = commands.newBatchExecution(cmds, "HelloRulesSession");
    return command;
}
 
开发者ID:fabric8-quickstarts,项目名称:spring-boot-camel-drools,代码行数:14,代码来源:DecisionServerHelper.java


示例5: executeCommands

import org.kie.api.command.KieCommands; //导入依赖的package包/类
@Test
public void executeCommands() {
	System.out.println("== Sending commands to the server ==");
	RuleServicesClient rulesClient = kieServicesClient
			.getServicesClient(RuleServicesClient.class);
	KieCommands commandsFactory = KieServices.Factory.get().getCommands();
	Command<?> insert = commandsFactory.newInsert("Some String OBJ");
	Command<?> fireAllRules = commandsFactory.newFireAllRules();
	Command<?> batchCommand = commandsFactory.newBatchExecution(Arrays
			.asList(insert, fireAllRules));
	ServiceResponse<String> executeResponse = rulesClient.executeCommands(RULES_CONTAINER, batchCommand);
	if (executeResponse.getType() == ResponseType.SUCCESS) {
		System.out.println("Commands executed with success! Response: ");
		System.out.println(executeResponse.getResult());
	} else {
		System.out.println("Error executing rules. Message: ");
		System.out.println(executeResponse.getMsg());
	}
}
 
开发者ID:jesuino,项目名称:bpms6-examples,代码行数:20,代码来源:DecisionServerTest.java


示例6: insertAndFireAll

import org.kie.api.command.KieCommands; //导入依赖的package包/类
public void insertAndFireAll(Exchange exchange) {
    final Message in = exchange.getIn();
    final Object body = in.getBody();

    final KieCommands kieCommands = KieServices.Factory.get().getCommands();

    final List<Command> commands = new ArrayList<Command>();
    // since KIE commands are JAXB-annotated, the body has to be JAXB annotated class as well
    commands.add(kieCommands.newInsert(body, "person"));
    commands.add(kieCommands.newFireAllRules());

    BatchExecutionCommand command = kieCommands.newBatchExecution(commands);
    in.setBody(command);
}
 
开发者ID:jboss-integration,项目名称:fuse-bxms-integ,代码行数:15,代码来源:DroolsCommandHelper.java


示例7: fireRules

import org.kie.api.command.KieCommands; //导入依赖的package包/类
public Results fireRules(List data) {
    Results res = new Results();

    KieCommands commands = kServices.getCommands();

    List<Command> cmds = new ArrayList<Command>();

    cmds.add(commands.newInsertElements(data));
    cmds.add(CommandFactory.newFireAllRules());
    cmds.add(CommandFactory.newQuery(QUERY_RESULT, QUERY_NAME));

    ExecutionResults er = session.execute(commands.newBatchExecution(cmds));

    this.addResults(res.getResults(), er, QUERY_RESULT);

    return res;
}
 
开发者ID:Stratio,项目名称:Decision,代码行数:18,代码来源:DroolsStatelessSession.java


示例8: getCommands

import org.kie.api.command.KieCommands; //导入依赖的package包/类
@Override
public KieCommands getCommands() {
    return kieServices.getCommands();
}
 
开发者ID:deepu105,项目名称:drools-demo,代码行数:5,代码来源:DefaultKieServicesBean.java



注:本文中的org.kie.api.command.KieCommands类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NetworkInfo类代码示例发布时间:2022-05-23
下一篇:
Java NotEmpty类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap