SoftwareMining - Business Rule Extraction and Documentation 

Business Rule  
COBOL Documentation
PRD_CALL.html
Persistent Records:
Signature (From Linkage Section) 
Working Storage Section

 

Analyst's Description/Comments
Data Filters Applied to this rule:
  • NONE
Statement Category Filters: The following statement types have been filtererd out
  • Screen Handling Statements

Business Rule Code
/**
 * mainx_M10
 */
public void mainx_M10 ()
{
}

/**
 * c000Main_M20
 */
public void c000Main_M20 ()
{
  idata.getWd(0).setValue("001PENCIL    BLACK     010000   170");
  idata.getWd(1).setValue("002RULER     WHITE     010000  0200");
  idata.getWd(2).setValue("003CD-R      GOLD      010000  0899");
  idata.getWd(3).setValue("004PRINTER               1 00 19999");
  idata.getWd(4).setValue("005TONER     BLACK       1  0  8900");
  idata.getWd(5).setValue("006TONER     RED         1  0  9900");
  idata.getWd(6).setValue("007PAPER     WHITE       5  0  2570");
  idata.getWd(7).setValue("0083.5 FLOPPYBLUE       10  0  1099");
  idata.getWd(8).setValue("009ENVELOPES WHITE     100  0  2699");
  idata.getWd(9).setValue("01012XCD ROM GREY        1  0  1299");

  while ( true ) {
    // termination condition 
    if (ACMUtil.ACMCheck88Vars(idata.getWsEntry(), idata.wsEntryWsTerminate)) {
      break;
    }
    perform("getTotalValue_M30");
    perform("displayChoices_M130");
    if (ACMUtil.ACMCheck88Vars(idata.getWsEntry(), idata.wsEntryWsNext)) {
      perform("readNextProduct_M60");
    } else if (ACMUtil.ACMCheck88Vars(idata.getWsEntry(), idata.wsEntryWsAgain)) {
        idata.setWsIdx(0);
        perform("readNextProduct_M60");
      } else if (ACMUtil.ACMCheck88Vars(idata.getWsEntry(), idata.wsEntryWsTerminate)) {
          ; // continue
        } else {
          perform("invalidOption_M110");
        }
  }
  stop();
}

/**
 * getTotalValue_M30
 */
public void getTotalValue_M30 ()
{
}

/**
 * c000GetTotal_M40
 */
public void c000GetTotal_M40 ()
{
  idata.setWsTotalValue(0.0);
  // initialize loop variable
  idata.setI(1);

  while ( true ) {
    // termination condition 
    if (idata.getI().getAsInt() == 11) {
      break;
    }
    idata.setWsTemp(idata.getWd(idata.getI().getAsInt() - 1).getAsString());
    product2.setProductInfo(idata.getWsTempValue());
    idata.setWsTotalValue(idata.getWsTotalValue().getAsDouble() + (product2.getProdQty().getAsDouble() * product2.getProdPrice().getAsDouble()));
    idata.setWsMiscWsTotal(idata.getWsTotalValue());

    // increment loop variable
    idata.setI(idata.getIValue() + 1);
  }
}

/**
 * c010GetTotalExit_M50
 */
public void c010GetTotalExit_M50 ()
{
  goBack();
}

/**
 * readNextProduct_M60
 */
public void readNextProduct_M60 ()
{
}

/**
 * c000ReadIncrementIndex_M70
 */
public void c000ReadIncrementIndex_M70 ()
{
  idata.setWsIdx(idata.getWsIdxValue() + 1);
  if (idata.getWsIdx().getAsInt() == 10) {
    idata.setWsIdx(1);
  }
}

/**
 * c010ReadMove_M80
 */
public void c010ReadMove_M80 ()
{
  idata.setWsTemp(idata.getWd(idata.getWsIdx().getAsInt() - 1).getAsString());
  product2.setProductInfo(idata.getWsTempValue());
}

/**
 * c020ReadCall_M90
 */
public void c020ReadCall_M90 ()
{

  BaseService prdViewBS;
  prdViewBS = ServicesFactory.create("com.softwaremining.examples.product.CPrdView", this);
  prdViewBS.execute(product2.getProductInfo());

  ServicesFactory.cancelService("com.softwaremining.examples.product.CPrdView");
  idata.getWd(idata.getWsIdx().getAsInt() - 1).setValue(product2.getProductInfoValue());
}

/**
 * c030ReadExit_M100
 */
public void c030ReadExit_M100 ()
{
  goBack();
}

/**
 * invalidOption_M110
 */
public void invalidOption_M110 ()
{
}

/**
 * invalidSect1_M120
 */
public void invalidSect1_M120 ()
{
  idata.setWsErrMess("Invalid Option, Please Try again");
  perform("displayError_M160");
  goBack();
}

/**
 * displayChoices_M130
 */
public void displayChoices_M130 ()
{
}

/**
 * dispSec01_M140
 */
public void dispSec01_M140 ()
{
  idata.setWsErrMess("Entry ext , tart again , xit ");
  perform("displayError_M160");
}

/**
 * dispSec02_M150
 */
public void dispSec02_M150 ()
{
  goBack();
}

/**
 * displayError_M160
 */
public void displayError_M160 ()
{
}

/**
 * c001DisplayError_M170
 */
public void c001DisplayError_M170 ()
{
}

/**
 * c002DisplayError_M180
 */
public void c002DisplayError_M180 ()
{
  goBack();
}