DistributeStack function

The DistributeStack function performs these actions in the distribution component:

  1. Moves the input stack to the Busy status.
  2. Creates a stack description .xml file in the internal storage folder next to the output file. The stack description file conforms to the CcmBomStackDescription XSD. You can find the B&OM XSD files here: <deploy root>\KCM\Documentation\5.8\Resources\Schemas\Output Management
  3. Executes the exit point configured in the OnStackDistribute property for the Distribution component. If the default script called DistributeStack is used, it copies the print and stack description files from the internal storage folder to the output folder.
  4. Moves the input stack to the Finished status, updates the stack type to "Finished (99)," and sets the finish time.
  5. When configured, calls the communication exit point for each communication that is part of the stack.

Also, when configured, the function calls the request accounting exit point for each request completed by the distribution of this stack.

Parameters

The DistributeStack function does not have any input parameters. It searches the run-time database for a stack in the Waiting status and stack type "Distribute (70)." If multiple records are available, they are picked up one by one, but the order is not determined.

Result

If a stack is processed successfully, DistributeStack returns its stack identifier, represented as a string. If no stack is available, DistributeStack returns the empty string.

If an error is encountered, the DistributeStack function moves the input stack to the Error status and sets the error message.

If you call the DistributeStack function from different CCM_Distribution processes simultaneously, we recommend that you run them in a separate Windows Service.