0

i am atg beginner

I have to add few processes to payment pipeline(paymentpipeline.xml) as I have to do some integration stuff. Please let me know how to add processes to payment pipeline and how to invoke them ? Also, i am not able to find paymentpipeline.xml in my project. Do i need to create it or do changes in commercepipeline.xml? Thanks

Buddha
  • 4,339
  • 2
  • 27
  • 51
user3554403
  • 11
  • 1
  • 5

1 Answers1

0

You can find paymentpipeline.xml in %DYNAMO_HOME%\..\DCS\src\config\atg\commerce\payment

To create a new process you need to implement PipelineProcessor.

import atg.nucleus.logging.ApplicationLoggingImpl;
import atg.service.pipeline.PipelineProcessor;

public class MyProcessor extends ApplicationLoggingImpl implements PipelineProcessor
{
    public int[] getRetCodes()
    {
        return new int{1,2};
    }

    public int runProcess(final Object pParam, final PipelineResult pResult) throws Exception 
    {
        // do what ever you wish to do here
        //1 is transaction status
        return 1;
    }
}

This creates a class that will be called when the pipeline chain is called. Next thing required is you need to create a properties file to create a component. It may typically look like this.

$class=/demo/atg/order/processor/MyProcessor
$scope=global

Modify PipelinePayment.xml and add a new pipelinechain. To invoke an individual processor in chain call PipelineManager.runProcess and pass chained of the created processor.

<pipelinechain name=" lastExistingchain" transaction="TX_REQUIRED" headlink="sampleDemoLink">
   <pipelinelink name="sampleDemoLink" transaction="TX_REQUIRED">
      <processor jndi="demo/atg/order/processor/MyProcessor"/>
   </pipelinelink>
</pipelinechain>

Depending on your requirement you may have to add this pipeline link in an existing pipelinechain insttead of creating a new chain.

Buddha
  • 4,339
  • 2
  • 27
  • 51