Package org.kie.internal.executor.api

Examples of org.kie.internal.executor.api.CommandContext


     * @param jobType The type of job: deploy or undeploy
     * @param deploymentUnit The deployment unit that should be acted upon
     * @return The initial status of the job in a {@link JaxbDeploymentJobResult} instance
     */
    private JaxbDeploymentJobResult scheduleDeploymentJobRequest(String deploymentId, JobType jobType, KModuleDeploymentUnit deploymentUnit) {
        CommandContext ctx = new CommandContext();
        ctx.setData(DEPLOYMENT_UNIT,  deploymentUnit);
        ctx.setData(JOB_TYPE, jobType);
        ctx.setData("businessKey", deploymentId);
        ctx.setData("retries", 0);
  ctx.setData("owner", ExecutorService.EXECUTOR_ID);
      
        String jobTypeLower = jobType.toString().toLowerCase();
      
        String jobId = "" + System.currentTimeMillis() + "-" + jobIdGen.incrementAndGet();
        ctx.setData(JOB_ID, jobId);
        JaxbDeploymentJobResult jobResult = new JaxbDeploymentJobResult(
                jobId,
                jobTypeLower + " job accepted.",
                convertKModuleDepUnitToJaxbDepUnit(deploymentUnit), jobType.toString());
        jobResult.getDeploymentUnit().setStatus(JaxbDeploymentStatus.ACCEPTED);
View Full Code Here


    public void removeOrganizationalUnitRequest( RemoveOrganizationalUnitRequest jobRequest ) {
        executorService.scheduleRequest(RemoveOrgUnitCmd.class.getName(), getContext(jobRequest));
    }
       
    protected CommandContext getContext(JobRequest jobRequest) {
        CommandContext ctx = new CommandContext();
        ctx.setData(JOB_REQUEST_KEY, jobRequest);
        ctx.setData("retries", 0);

        return ctx;
    }
View Full Code Here

    public void removeOrganizationalUnitRequest( RemoveOrganizationalUnitRequest jobRequest ) {
        executorService.scheduleRequest(RemoveOrgUnitCmd.class.getName(), getContext(jobRequest));
    }
       
    protected CommandContext getContext(JobRequest jobRequest) {
        CommandContext ctx = new CommandContext();
        ctx.setData(JOB_REQUEST_KEY, jobRequest);
        ctx.setData("retries", 0);

        return ctx;
    }
View Full Code Here

TOP

Related Classes of org.kie.internal.executor.api.CommandContext

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.