4 Replies Latest reply on Aug 13, 2016 1:53 PM by Richard Moore

    Batch Artifacts - access list

    Richard Moore Master

      I would like to write a batchlet that needs a property passed that is actually a ref of one of my batch.xml batch artifacts. How can I reference these from within a batchlet?

        • 1. Re: Batch Artifacts - access list
          Cheng Fang Master

          can you just pass it as a batch property as usual?

           

          then the the ref value may be duplicated in both batch.xml and job.xml, which may be a maintenance problem.  You reference the artifact by its fully qualified class name, without declaring it in batch.xml, just as one way to avoid that duplicate.

           

          <batchlet ref="xBatchlet">
            <properties>
            <property name="foo" value="bar"/>

          • 2. Re: Batch Artifacts - access list
            Cheng Fang Master

            any batch artifact is managed by JBeret, the batch runtime container.  Applications should not directly invokes its lifecycle methods.  Even if you get hold of its class name, manage to instantiate it, the instance will be a different one from what JBeret has.

            • 3. Re: Batch Artifacts - access list
              Richard Moore Master

              I am creating an FTP delivery batchlet that I will give a ref of ftpDelivery, one of the properties will be sourcePostTransferAction which I want to be a ref defined in the batch.xml - moveWithRename, moveWithSameName, moveWithTargetName, and delete. This would also allow us to write any other custom action and give it a ref name. This means I would have to resolve the name in the ftpDelivery batchlet.

               

              <batchlet ref="fpeDelivery">

                <properties>

                <property name="sourcePostTransferAction" value="moveWithSameName" />

              • 4. Re: Batch Artifacts - access list
                Richard Moore Master

                Never mind, I will create them as a jndi name and resolve it from there.

                1 of 1 people found this helpful