2 Replies Latest reply on Nov 28, 2014 8:42 AM by Dmitry Losev

    KIE Workbench DEPLOY job issue

    Dmitry Losev Newbie

      I'm trying to create new Job on Deploys -> Jobs in KIE Workbench. I already have a few DEPLOY jobs which were automatically created when I called "/deployments/{deploymentId}/deploy" REST API method. New job should also deploy the same unit but should be executed at the certain date. I set date, owner, DeploymentUnit, JobType, businessKey and other parameters for the new job and it's executed at the certain time, but the following error happens:

       

      java.lang.ClassCastException: java.lang.String cannot be cast to org.jbpm.kie.services.impl.KModuleDeploymentUnit

        at org.jbpm.executor.impl.AvailableJobsExecutor.executeJob(AvailableJobsExecutor.java:153)

       

      When DEPLOY job is automatically created, CommandContext object is serialized to RequestData field of RequestInfo. When job is executed, RequestData is deserialized to CommandContext which contains the map of parameter name -> object pairs. If job is created manually, RequestData is deserialized to CommandContext which contains the map of parameter name -> string pairs. So, there are strings where objects are expected. Therefore ClassCastException happens.

       

      Is there any way to manually create  DEPLOY job?

      Are there other ways to start unit deployment or activate process definition by date?

       

      My goal is to schedule automatic business process version update, so that my application, connected to Workbench via remote runtime engine, uses updated process when it's time.

        • 1. Re: KIE Workbench DEPLOY job issue
          Maciej Swiderski Master

          as you already noticed the deploy command expects have deployment unit as parameter directly. So what you might do is to create your own command (or extend the existing one) that will be capable to create deployment unit object from string if not yet available.

           

          Please note that executor currently might not respect strictly time of execution.

           

          Another approach could be to use process that:

          - when started will set timer to a given time when it should be resumed

          - user REST work item handler to request deploy of given artifact

           

          That way you don't need to manually use jobs but simply start process instance giving the date and time when it should happen and the GAV of project to be deployed.

           

          HTH

          • 2. Re: KIE Workbench DEPLOY job issue
            Dmitry Losev Newbie

            Maciej, thank you for suggestions!