Package org.drools.core.command.runtime.process

Examples of org.drools.core.command.runtime.process.StartProcessCommand


        return startProcess;
    }

    public Command newStartProcess(String processId,
            Map<String, Object> parameters) {
        StartProcessCommand startProcess = new StartProcessCommand();
        startProcess.setProcessId(processId);
        startProcess.setParameters(parameters);
        return startProcess;
    }
View Full Code Here


                             null );
    }

    public ProcessInstance startProcess(String processId,
                                        Map<String, Object> parameters) {
        StartProcessCommand command = new StartProcessCommand();
        command.setProcessId( processId );
        command.setParameters( parameters );
        return commandService.execute( command );
    }
View Full Code Here

    }


    @Test
    public void verifyNsElementImplFound() throws Exception {
        StartProcessCommand cmd = new StartProcessCommand();
        cmd.setProcessId("deployment-forgot-class");
        Map<String, Object> params = new HashMap<String, Object>();
       
        params.put("test", new Person("bob"));
        cmd.setParameters(params);
      
        JAXBContext jaxbContext = JAXBContext.newInstance(StartProcessCommand.class, Person.class);
        String xmlStr = serialize(jaxbContext, true, cmd);
        jaxbContext = JAXBContext.newInstance(StartProcessCommand.class);
        StartProcessCommand copyCmd = (StartProcessCommand) deserialize(jaxbContext, xmlStr);
     
        ProcessRequestBean procReqBean = new ProcessRequestBean();
        String msg = null;
        try {
            procReqBean.checkThatUserDefinedClassesWereUnmarshalled(copyCmd.getParameters());
        } catch( Exception e ) {
           assertTrue( "Expected an " + IllegalStateException.class.getSimpleName() + " instance", e instanceof IllegalStateException );
           msg = e.getMessage();
        }
        assertNotNull( "Expected exception to be thrown", msg );
View Full Code Here

     * for the real test logic.
     */
    private void runStartProcessAndDoStuffTest() {
        // test start process
        JaxbCommandsRequest
        cmdsRequest = new JaxbCommandsRequest(DEPLOYMENT_ID, new StartProcessCommand(TEST_PROCESS_DEF_NAME));
        JaxbCommandsResponse
        resp = this.jmsProcessJaxbCommandsRequest(cmdsRequest);

        // check response
        assertNotNull( "Null response", resp);
View Full Code Here

        List<Command> cmds = new ArrayList<Command>();
        req.setCommands(cmds);
        req.setDeploymentId("depId");
        req.setProcessInstanceId(43l);
        req.setVersion("6.0.1.0");
        StartProcessCommand spCmd = new StartProcessCommand("test.proc.yaml");
        cmds.add(spCmd);
        spCmd.getParameters().put("one", "a");
        spCmd.getParameters().put("two", "B");
        Object weirdParam = new Integer[] { 59, 2195 };
        spCmd.getParameters().put("thr", weirdParam);
       
        addClassesToSerializationProvider(weirdParam.getClass());

        JaxbCommandsRequest newReq = testRoundTrip(req);
        assertEquals(((StartProcessCommand) newReq.getCommands().get(0)).getParameters().get("two"), "B");

        req = new JaxbCommandsRequest("deployment", new StartProcessCommand("org.jbpm.humantask"));
        newReq = testRoundTrip(req);

        CorrelationKeyInfo corrKey = new CorrelationKeyInfo();
        corrKey.addProperty(new CorrelationPropertyInfo("null", "val"));
   
View Full Code Here

        KieSession ksession = runtimeEngine.getKieSession();
   
        Map<String, Object> params = new HashMap<String, Object>();
        String val = "initial-val";
        params.put("test", val);
        Command cmd = new StartProcessCommand("StructureRef");
        ((StartProcessCommand) cmd).setParameters(params);
        ProcessInstance processInstance = ksession.execute((StartProcessCommand) cmd);
        assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE);
   
        JaxbCommandsResponse resp = new JaxbCommandsResponse();
View Full Code Here

        Object arrayParam = new Float[]{9.0f, 12.0f};
        parameters.put("parameters", arrayParam);
       
        addClassesToSerializationProvider(arrayParam.getClass());
       
        Command<?> cmd = new StartProcessCommand("proc.with.array.params", parameters);
        JaxbCommandsRequest req = new JaxbCommandsRequest("test", cmd);
        Command<?> newCmd = testRoundTrip(req).getCommands().get(0);
        assertNotNull(newCmd);
    }
View Full Code Here

        List<Command> cmds = new ArrayList<Command>();
        req.setCommands(cmds);
        req.setDeploymentId("depId");
        req.setProcessInstanceId(43l);
        req.setVersion("2");
        StartProcessCommand spCmd = new StartProcessCommand("test.proc.yaml");
        cmds.add(spCmd);
        spCmd.getParameters().put("one", "a");
        spCmd.getParameters().put("two", "B");
        Object weirdParam = new Integer[] { 59, 2195 };
        spCmd.getParameters().put("thr", weirdParam);
       
        JaxbCommandsRequest newReq = testRoundTrip(req);
        assertEquals(((StartProcessCommand) newReq.getCommands().get(0)).getParameters().get("two"), "B");
       
        Object newStringReq = deserialize(cmdReqXmlStr);
View Full Code Here

   
    private ProcessInstance startProcessInstance(String processId, Map<String, Object> params) {
        Object result = null;
        try {
            result = processRequestBean.doKieSessionOperation(
                new StartProcessCommand(processId, params),
                deploymentId,
                null);
        } catch( IllegalArgumentException iae ) {
            if( iae.getMessage().startsWith("Unknown process ID")) {
                throw KieRemoteRestOperationException.notFound("Process '" + processId + "' is not known to this deployment.");
View Full Code Here

    public void testProcess() throws Exception {

        BatchExecutionCommandImpl cmd = new BatchExecutionCommandImpl();
        cmd.setLookup( "ksession1" );

        StartProcessCommand start = new StartProcessCommand( "org.drools.actions" , "process-instance-id" );
        start.putParameter( "person",
                            new Person( "lucaz",
                                        25 ) );
        start.putParameter( "person2",
                            new Person( "hadrian",
                                        25 ) );
        start.putParameter( "person3",
                            new Person( "baunax",
                                        21 ) );

        cmd.getCommands().add( start );
View Full Code Here

TOP

Related Classes of org.drools.core.command.runtime.process.StartProcessCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.