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

Java StringUtils类代码示例

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

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



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

示例1: updateToVersion

import org.drools.core.util.StringUtils; //导入依赖的package包/类
public boolean updateToVersion(String version) {
    checkStatus();
    if (StringUtils.isEmpty(version)) {
        throw new IllegalArgumentException("Update to version cannot accept an empty version");
    }
    ReleaseId releaseId = kieServices.newReleaseId(
            rulesConfiguration.getGroupId(),
            rulesConfiguration.getArtifactId(),
            version);
    Results results = kieContainer.updateToVersion(releaseId);
    this.releaseId = kieContainer.getReleaseId();
    KieSessionUtils.logResults(results);
    if (results.hasMessages(Message.Level.ERROR)) {
        LOGGER.error("Update to version {} aborted due to errors", version);
        return false;
    }
    LOGGER.info("Update to version {} completed", version);
    return true;
}
 
开发者ID:redhat-italy,项目名称:hacep,代码行数:20,代码来源:RulesManager.java


示例2: unmarshal

import org.drools.core.util.StringUtils; //导入依赖的package包/类
@Override
public PluggableIAction unmarshal(final String iActionString) throws RuleModelDRLPersistenceException {
    List<String> parameters = StringUtils.splitArgumentsList(PersistenceExtensionUtils.unwrapParenthesis(iActionString));

    if (!parameters.isEmpty() && "kcontext".equals(parameters.get(0))) {
        if (parameters.size() == 2) {
            return new ActionHardConstraintMatch(PersistenceExtensionUtils.extractConstraintMatchValue(parameters.get(1)));
        }
        if (parameters.size() == 3) {
            try {
                int bendableScoreLevel = Integer.parseInt(parameters.get(1));

                return new ActionBendableHardConstraintMatch(bendableScoreLevel,
                                                             PersistenceExtensionUtils.extractConstraintMatchValue(parameters.get(2)));
            } catch (NumberFormatException e) {
                LOGGER.error("Could not parse bendable score level parameter " + parameters.get(1) + " as an Integer");
            }
        }
    }

    throw new RuleModelDRLPersistenceException("Could not unmarshal action string '" + iActionString);
}
 
开发者ID:kiegroup,项目名称:optaplanner-wb,代码行数:23,代码来源:HardConstraintMatchPersistenceExtension.java


示例3: setupClasspathKmoduleBuilder

import org.drools.core.util.StringUtils; //导入依赖的package包/类
private static RuntimeEnvironmentBuilder setupClasspathKmoduleBuilder(KieContainer kieContainer,
                                                                      String kbaseName,
                                                                      String ksessionName) {
    if (StringUtils.isEmpty(kbaseName)) {
        KieBaseModel defaultKBaseModel = ((KieContainerImpl)kieContainer).getKieProject().getDefaultKieBaseModel();
        if (defaultKBaseModel != null) {
            kbaseName = defaultKBaseModel.getName();
        } else {
            kbaseName = DEFAULT_KBASE_NAME;
        }
    }
    InternalKieModule module = (InternalKieModule) ((KieContainerImpl)kieContainer).getKieModuleForKBase(kbaseName);
    if (module == null) {
        throw new IllegalStateException("Cannot find kbase with name " + kbaseName);
    }
    KieBase kbase = kieContainer.getKieBase(kbaseName);

    return getDefault()
            .knowledgeBase(kbase)
            .classLoader(kieContainer.getClassLoader())
            .registerableItemsFactory(new KModuleRegisterableItemsFactory(kieContainer, ksessionName));
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:23,代码来源:PatchedRuntimeEnvironmentBuilder.java


示例4: setupClasspathKmoduleBuilder

import org.drools.core.util.StringUtils; //导入依赖的package包/类
private static RuntimeEnvironmentBuilder setupClasspathKmoduleBuilder(KieContainer kieContainer, String kbaseName, String ksessionName) {
    if (StringUtils.isEmpty(kbaseName)) {
        KieBaseModel defaultKBaseModel = ((KieContainerImpl)kieContainer).getKieProject().getDefaultKieBaseModel();
        if (defaultKBaseModel != null) {
            kbaseName = defaultKBaseModel.getName();
        } else {
            kbaseName = DEFAULT_KBASE_NAME;
        }
    }
    InternalKieModule module = (InternalKieModule)((KieContainerImpl)kieContainer).getKieModuleForKBase(kbaseName);
    if (module == null) {
        throw new IllegalStateException("Cannot find kbase with name " + kbaseName);
    }
    KieBase kbase = kieContainer.getKieBase(kbaseName);

    return getDefault().knowledgeBase(kbase).classLoader(kieContainer.getClassLoader())
        .registerableItemsFactory(new KModuleRegisterableItemsFactory(kieContainer, ksessionName));
}
 
开发者ID:jboss-integration,项目名称:fuse-bxms-integ,代码行数:19,代码来源:PatchedRuntimeEnvironmentBuilder.java


示例5: process

import org.drools.core.util.StringUtils; //导入依赖的package包/类
public void process(Exchange exchange) throws Exception {

        byte[] body2 = (byte[])exchange.getOut().getBody();

        if (body2 != null) {
            ByteArrayInputStream bais = new ByteArrayInputStream(body2);

            SOAPMessage soapMessage = MessageFactory.newInstance().createMessage();
            SOAPBody soapBody = soapMessage.getSOAPPart().getEnvelope().getBody();
            QName payloadName = new QName("http://soap.jax.drools.org/", "executeResponse", "ns1");
            QName responseName = new QName("http://soap.jax.drools.org/", "return", "ns1");
            SOAPBodyElement payload = soapBody.addBodyElement(payloadName);
            SOAPElement response = payload.addChildElement(responseName);
            response.addTextNode(StringUtils.toString(bais));

            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            soapMessage.writeTo(baos);

            exchange.getOut().setBody(new String(baos.toByteArray()));
        }
    }
 
开发者ID:jboss-integration,项目名称:fuse-bxms-integ,代码行数:22,代码来源:PostCxfTransportSoapProcessor.java


示例6: process

import org.drools.core.util.StringUtils; //导入依赖的package包/类
public void process(Exchange exchange) throws Exception {
    InputStream is = (InputStream)exchange.getIn().getBody();
    // Bad Hack - Need to remote it and fix it in Camel (if it's a camel problem)
    // I need to copy the results here because I loose them at the end of the method
    if (is != null) {
        String results = StringUtils.toString(is);
        SOAPMessage soapMessage = MessageFactory.newInstance().createMessage();
        SOAPBody body = soapMessage.getSOAPPart().getEnvelope().getBody();
        QName payloadName = new QName("http://soap.jax.drools.org/", "executeResponse", "ns1");
        QName responseName = new QName("http://soap.jax.drools.org/", "return", "ns1");
        SOAPBodyElement payload = body.addBodyElement(payloadName);
        SOAPElement response = payload.addChildElement(responseName);
        // Bad Hack - Need to remote it and fix it in Camel (if it's a camel problem)
        // response.addTextNode( StringUtils.toString( is ) );
        response.addTextNode(results);
        exchange.getOut().setBody(soapMessage);
    }
}
 
开发者ID:jboss-integration,项目名称:fuse-bxms-integ,代码行数:19,代码来源:PostCxfSoapProcessor.java


示例7: getContent

import org.drools.core.util.StringUtils; //导入依赖的package包/类
public String getContent(String name, String... vars) {
    Map<String, String> map = new HashMap<String, String>();
    int counter = 1;
    for (String var : vars) {
        map.put("var" + counter++, var);
    }

    if (!StringUtils.isEmpty(copyToDataFormat)) {
        writer.println();
        writer.println("@declare{\"" + name + "\"}");
    }
    String s = (String)TemplateRuntime.execute(tempReg.getNamedTemplate(name), map);
    if (!StringUtils.isEmpty(copyToDataFormat)) {
        writer.print(prettyPrintXml(template.requestBody("direct:to-" + copyToDataFormat, s, String.class)));
        writer.println("@end{}");
    }

    return roundTripFromXml(s.trim());
}
 
开发者ID:jboss-integration,项目名称:fuse-bxms-integ,代码行数:20,代码来源:BatchTest.java


示例8: start

import org.drools.core.util.StringUtils; //导入依赖的package包/类
public void start(String groupId, String artifactId, String version) {
    if (started.compareAndSet(false, true)) {
        kieServices = KieServices.Factory.get();
        if (!(StringUtils.isEmpty(groupId) || StringUtils.isEmpty(artifactId) || StringUtils.isEmpty(version)) &&
                (!rulesConfiguration.getGroupId().equals(groupId) || !rulesConfiguration.getArtifactId().equals(artifactId))) {
            throw new IllegalStateException(String.format("Cannot start a Rule Manager with different Group Id and Artifact. " +
                            "Rule configuration releaseId [%s:%s:%s] cached value [%s:%s:%s]",
                    rulesConfiguration.getGroupId(), rulesConfiguration.getArtifactId(), rulesConfiguration.getVersion(),
                    groupId, artifactId, version));
        }

        this.kieContainer = newKieContainer(version);
        this.releaseId = this.kieContainer.getReleaseId();
    }
}
 
开发者ID:redhat-italy,项目名称:hacep,代码行数:16,代码来源:RulesManager.java


示例9: newKieContainer

import org.drools.core.util.StringUtils; //导入依赖的package包/类
public KieContainer newKieContainer(String version) {
    ReleaseId releaseId = kieServices.newReleaseId(
            rulesConfiguration.getGroupId(),
            rulesConfiguration.getArtifactId(),
            StringUtils.isEmpty(version) ? rulesConfiguration.getVersion() : version);
    return kieServices.newKieContainer(releaseId);
}
 
开发者ID:redhat-italy,项目名称:hacep,代码行数:8,代码来源:RulesManager.java


示例10: getKieBase

import org.drools.core.util.StringUtils; //导入依赖的package包/类
public KieBase getKieBase(KieContainer kieContainer) {
    checkStatus();
    if (!StringUtils.isEmpty(rulesConfiguration.getKieBaseName())) {
        return kieContainer.getKieBase(rulesConfiguration.getKieBaseName());
    }
    return kieContainer.getKieBase();
}
 
开发者ID:redhat-italy,项目名称:hacep,代码行数:8,代码来源:RulesManager.java


示例11: newKieSession

import org.drools.core.util.StringUtils; //导入依赖的package包/类
public KieSession newKieSession(KieContainer kieContainer) {
    checkStatus();
    if (!StringUtils.isEmpty(rulesConfiguration.getKieSessionName())) {
        return kieContainer.newKieSession(rulesConfiguration.getKieSessionName());
    }
    return kieContainer.newKieSession();
}
 
开发者ID:redhat-italy,项目名称:hacep,代码行数:8,代码来源:RulesManager.java


示例12: testBoundarySignalFromV6ToV5

import org.drools.core.util.StringUtils; //导入依赖的package包/类
public void testBoundarySignalFromV6ToV5() throws Exception {

        // Deploy processes
        String deploymentId = repositoryService.createDeployment()
                .addClasspathResource("org/activiti/engine/test/regression/signalBoundaryCatch.bpmn")
                .deploymentProperty(DeploymentProperties.DEPLOY_AS_FLOWABLE5_PROCESS_DEFINITION, Boolean.TRUE)
                .deploy()
                .getId();
        
        String deploymentId2 = repositoryService.createDeployment()
                .addClasspathResource("org/activiti/engine/test/regression/signalThrow.bpmn")
                .deploy()
                .getId();

        runtimeService.startProcessInstanceByKey("signalBoundaryCatch");
        runtimeService.startProcessInstanceByKey("signalThrow");
        
        ProcessDefinition v5Definition = repositoryService.createProcessDefinitionQuery().processDefinitionEngineVersion("v5").singleResult();
        assertNotNull(v5Definition);
        assertEquals("signalBoundaryCatch", v5Definition.getKey());
        
        ProcessDefinition v6Definition = repositoryService.createProcessDefinitionQuery().processDefinitionKey("signalThrow").singleResult();
        assertNotNull(v6Definition);
        assertTrue(StringUtils.isEmpty(v6Definition.getEngineVersion()));
        
        org.flowable.task.api.Task signalTask = taskService.createTaskQuery().processDefinitionKey("signalBoundaryCatch").singleResult();
        assertNotNull(signalTask);
        assertEquals("task", signalTask.getTaskDefinitionKey());
        
        org.flowable.task.api.Task beforeTask = taskService.createTaskQuery().processDefinitionKey("signalThrow").singleResult();
        taskService.complete(beforeTask.getId());
        
        org.flowable.task.api.Task afterTask = taskService.createTaskQuery().processDefinitionKey("signalBoundaryCatch").singleResult();
        assertNotNull(afterTask);
        assertEquals("afterTask", afterTask.getTaskDefinitionKey());
        
        // Clean
        repositoryService.deleteDeployment(deploymentId, true);
        repositoryService.deleteDeployment(deploymentId2, true);
    }
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:41,代码来源:SignalV6andV5Test.java


示例13: testBoundarySignalFromV5ToV6

import org.drools.core.util.StringUtils; //导入依赖的package包/类
public void testBoundarySignalFromV5ToV6() throws Exception {

        // Deploy processes
        String deploymentId = repositoryService.createDeployment()
                .addClasspathResource("org/activiti/engine/test/regression/signalBoundaryCatch.bpmn")
                .deploy()
                .getId();
        
        String deploymentId2 = repositoryService.createDeployment()
                .addClasspathResource("org/activiti/engine/test/regression/signalThrow.bpmn")
                .deploymentProperty(DeploymentProperties.DEPLOY_AS_FLOWABLE5_PROCESS_DEFINITION, Boolean.TRUE)
                .deploy()
                .getId();

        runtimeService.startProcessInstanceByKey("signalBoundaryCatch");
        runtimeService.startProcessInstanceByKey("signalThrow");
        
        ProcessDefinition v5Definition = repositoryService.createProcessDefinitionQuery().processDefinitionEngineVersion("v5").singleResult();
        assertNotNull(v5Definition);
        assertEquals("signalThrow", v5Definition.getKey());
        
        ProcessDefinition v6Definition = repositoryService.createProcessDefinitionQuery().processDefinitionKey("signalBoundaryCatch").singleResult();
        assertNotNull(v6Definition);
        assertTrue(StringUtils.isEmpty(v6Definition.getEngineVersion()));
        
        org.flowable.task.api.Task signalTask = taskService.createTaskQuery().processDefinitionKey("signalBoundaryCatch").singleResult();
        assertNotNull(signalTask);
        assertEquals("task", signalTask.getTaskDefinitionKey());
        
        org.flowable.task.api.Task beforeTask = taskService.createTaskQuery().processDefinitionKey("signalThrow").singleResult();
        taskService.complete(beforeTask.getId());
        
        org.flowable.task.api.Task afterTask = taskService.createTaskQuery().processDefinitionKey("signalBoundaryCatch").singleResult();
        assertNotNull(afterTask);
        assertEquals("afterTask", afterTask.getTaskDefinitionKey());
        
        // Clean
        repositoryService.deleteDeployment(deploymentId, true);
        repositoryService.deleteDeployment(deploymentId2, true);
    }
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:41,代码来源:SignalV6andV5Test.java


示例14: submitAppInfoAttachment

import org.drools.core.util.StringUtils; //导入依赖的package包/类
@Override
public void submitAppInfoAttachment(JiraTicket ticket, String json, JiraAuth auth) throws IOException {

	String filename = StringUtils.deleteAny(ticket.getId(), "\\./") + ".json";
    File f = new File(System.getProperty("java.io.tmpdir"), filename);
    if(f.exists()) {f.delete();}
    if(!f.exists()) {f.createNewFile();}
    
    try (FileOutputStream fos = new FileOutputStream(f)) {
     String prettyVal = POMUtils.MAPPER.writerWithDefaultPrettyPrinter().writeValueAsString(POMUtils.parseJSONtoNode(json));
     fos.write(prettyVal.getBytes());
    }

    try {
        String url = "https://"+auth.getUsername()+":"+auth.getPassword()+"@"+jiraHost+"/rest/api/2/issue/"+ticket.getId()+"/attachments";

        MultiValueMap<String, Object> parts = new LinkedMultiValueMap<String, Object>();
        parts.add("file",new FileSystemResource(f.getAbsolutePath()));

        HttpHeaders requestHeaders = new HttpHeaders();
        requestHeaders.set("X-Atlassian-Token", "nocheck");
        HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(parts, requestHeaders);

        HttpComponentsClientHttpRequestFactory fact = new HttpComponentsClientHttpRequestFactory();
        RestTemplate rt = new RestTemplate(fact);
        rt.exchange(url, HttpMethod.POST, requestEntity, String.class);
    } finally {
        f.delete();
    }
}
 
开发者ID:KRMAssociatesInc,项目名称:eHMP,代码行数:31,代码来源:JiraDao.java


示例15: submitAttachment

import org.drools.core.util.StringUtils; //导入依赖的package包/类
@Override
public void submitAttachment(JiraTicket ticket, String screenshot, JiraAuth auth) throws IOException {
	
	if(screenshot.startsWith("data:image/png;base64")) {screenshot = screenshot.substring("data:image/png;base64".length());}
    byte[] blob = Base64.decodeBase64(screenshot);

    String filename = StringUtils.deleteAny(ticket.getId(), "\\./") + ".bmp";
	File f = new File(System.getProperty("java.io.tmpdir"), filename);
	if(f.exists()) {f.delete();}
	if(!f.exists()) {f.createNewFile();}
	try (FileOutputStream fos = new FileOutputStream(f)) {
		fos.write(blob);
	}

    try {
        String url = "https://"+auth.getUsername()+":"+auth.getPassword()+"@"+jiraHost+"/rest/api/2/issue/"+ticket.getId()+"/attachments";

        MultiValueMap<String, Object> parts = new LinkedMultiValueMap<String, Object>();
        parts.add("file",new FileSystemResource(f.getAbsolutePath()));

        HttpHeaders requestHeaders = new HttpHeaders();
        requestHeaders.set("X-Atlassian-Token", "nocheck");
        HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(parts, requestHeaders);

        HttpComponentsClientHttpRequestFactory fact = new HttpComponentsClientHttpRequestFactory();
        RestTemplate rt = new RestTemplate(fact);
        rt.exchange(url, HttpMethod.POST, requestEntity, String.class);
    } finally {
        f.delete();
    }
}
 
开发者ID:KRMAssociatesInc,项目名称:eHMP,代码行数:32,代码来源:JiraDao.java


示例16: configure

import org.drools.core.util.StringUtils; //导入依赖的package包/类
protected void configure(KieComponent component, String uri) {
    ksessionId = getKsessionId(uri);

    if (!StringUtils.isEmpty(ksessionId)) {
        executor = component.getCamelContext().getRegistry().lookup(ksessionId, CommandExecutor.class);
        if (executor == null) {
            if (NO_KSESSION_ENDPOINT.equals(ksessionId)) {
                executorsByName = new HashMap<String, CommandExecutor>();
            } else {
                throw new RuntimeCamelException("Failed to instantiate KieEndpoint. Could not find ksession for " + " uri=\"" + uri + "\". Check configuration.");
            }
        }
    }
}
 
开发者ID:jboss-integration,项目名称:fuse-bxms-integ,代码行数:15,代码来源:KieEndpoint.java


示例17: process

import org.drools.core.util.StringUtils; //导入依赖的package包/类
public void process(Exchange exchange) throws Exception {
    Object object = exchange.getIn().getBody();
    if (object instanceof Response) {
        Response res = (Response)object;
        if (res.getStatus() == Status.OK.getStatusCode()) {
            exchange.getIn().setBody(StringUtils.toString((InputStream)((Response)object).getEntity()));
        }
    }
}
 
开发者ID:jboss-integration,项目名称:fuse-bxms-integ,代码行数:10,代码来源:PostCxfrs.java


示例18: before

import org.drools.core.util.StringUtils; //导入依赖的package包/类
@Before
public void before() throws Exception {
    tempReg.addNamedTemplate("tempReg", TemplateCompiler.compileTemplate(getClass().getResourceAsStream(dataformat + ".mvt"), (Map<String, Class<? extends Node>>)null));
    TemplateRuntime.execute(tempReg.getNamedTemplate("tempReg"), null, tempReg);

    XMLUnit.setIgnoreComments(true);
    XMLUnit.setIgnoreWhitespace(true);
    XMLUnit.setIgnoreAttributeOrder(true);
    XMLUnit.setNormalizeWhitespace(true);
    XMLUnit.setNormalize(true);

    if (!StringUtils.isEmpty(copyToDataFormat)) {
        writer = new PrintWriter(new BufferedWriter(new FileWriter(copyToDataFormat + ".mvt", true)));
    }
}
 
开发者ID:jboss-integration,项目名称:fuse-bxms-integ,代码行数:16,代码来源:BatchTest.java


示例19: testIntermediateSignalFromV6ToV5

import org.drools.core.util.StringUtils; //导入依赖的package包/类
public void testIntermediateSignalFromV6ToV5() throws Exception {

        // Deploy processes
        String deploymentId = repositoryService.createDeployment()
                .addClasspathResource("org/activiti/engine/test/regression/signalIntermediateCatch.bpmn")
                .deploymentProperty(DeploymentProperties.DEPLOY_AS_FLOWABLE5_PROCESS_DEFINITION, Boolean.TRUE)
                .deploy()
                .getId();
        
        String deploymentId2 = repositoryService.createDeployment()
                .addClasspathResource("org/activiti/engine/test/regression/signalThrow.bpmn")
                .deploy()
                .getId();

        runtimeService.startProcessInstanceByKey("signalIntermediateCatch");
        runtimeService.startProcessInstanceByKey("signalThrow");
        
        ProcessDefinition v5Definition = repositoryService.createProcessDefinitionQuery().processDefinitionEngineVersion("v5").singleResult();
        assertNotNull(v5Definition);
        assertEquals("signalIntermediateCatch", v5Definition.getKey());
        
        ProcessDefinition v6Definition = repositoryService.createProcessDefinitionQuery().processDefinitionKey("signalThrow").singleResult();
        assertNotNull(v6Definition);
        assertTrue(StringUtils.isEmpty(v6Definition.getEngineVersion()));
        
        org.flowable.task.api.Task signalTask = taskService.createTaskQuery().processDefinitionKey("signalIntermediateCatch").singleResult();
        assertNotNull(signalTask);
        assertEquals("task", signalTask.getTaskDefinitionKey());
        taskService.complete(signalTask.getId());
        
        org.flowable.task.api.Task beforeTask = taskService.createTaskQuery().processDefinitionKey("signalThrow").singleResult();
        taskService.complete(beforeTask.getId());
        
        org.flowable.task.api.Task afterTask = taskService.createTaskQuery().processDefinitionKey("signalIntermediateCatch").singleResult();
        assertNotNull(afterTask);
        assertEquals("afterTask", afterTask.getTaskDefinitionKey());
        
        // Clean
        repositoryService.deleteDeployment(deploymentId, true);
        repositoryService.deleteDeployment(deploymentId2, true);
    }
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:42,代码来源:SignalV6andV5Test.java


示例20: testIntermediateSignalFromV5ToV6

import org.drools.core.util.StringUtils; //导入依赖的package包/类
public void testIntermediateSignalFromV5ToV6() throws Exception {

        // Deploy processes
        String deploymentId = repositoryService.createDeployment()
                .addClasspathResource("org/activiti/engine/test/regression/signalIntermediateCatch.bpmn")
                .deploy()
                .getId();
        
        String deploymentId2 = repositoryService.createDeployment()
                .addClasspathResource("org/activiti/engine/test/regression/signalThrow.bpmn")
                .deploymentProperty(DeploymentProperties.DEPLOY_AS_FLOWABLE5_PROCESS_DEFINITION, Boolean.TRUE)
                .deploy()
                .getId();

        runtimeService.startProcessInstanceByKey("signalIntermediateCatch");
        runtimeService.startProcessInstanceByKey("signalThrow");
        
        ProcessDefinition v5Definition = repositoryService.createProcessDefinitionQuery().processDefinitionEngineVersion("v5").singleResult();
        assertNotNull(v5Definition);
        assertEquals("signalThrow", v5Definition.getKey());
        
        ProcessDefinition v6Definition = repositoryService.createProcessDefinitionQuery().processDefinitionKey("signalIntermediateCatch").singleResult();
        assertNotNull(v6Definition);
        assertTrue(StringUtils.isEmpty(v6Definition.getEngineVersion()));
        
        org.flowable.task.api.Task signalTask = taskService.createTaskQuery().processDefinitionKey("signalIntermediateCatch").singleResult();
        assertNotNull(signalTask);
        assertEquals("task", signalTask.getTaskDefinitionKey());
        taskService.complete(signalTask.getId());
        
        org.flowable.task.api.Task beforeTask = taskService.createTaskQuery().processDefinitionKey("signalThrow").singleResult();
        taskService.complete(beforeTask.getId());
        
        org.flowable.task.api.Task afterTask = taskService.createTaskQuery().processDefinitionKey("signalIntermediateCatch").singleResult();
        assertNotNull(afterTask);
        assertEquals("afterTask", afterTask.getTaskDefinitionKey());
        
        // Clean
        repositoryService.deleteDeployment(deploymentId, true);
        repositoryService.deleteDeployment(deploymentId2, true);
    }
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:42,代码来源:SignalV6andV5Test.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java DTMException类代码示例发布时间:2022-05-23
下一篇:
Java MenuAssert类代码示例发布时间: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