Scan, Pack and Ship > Progress Black Box Workflow Tasks
  
Progress Black Box Workflow Tasks
When you implement a shipment- or pack-level button through a black box call to Progress logic, the Progress logic responds with a status code. The following sample code is an example of a pack-level extension button that makes a black box call to Progress logic and returns an information message.
{
"id" : "packExtnBtn1Id",
"iconCls" : "packSealTickBtn",
"tooltip" : "Seal Pack",
"readOnlyDisable" : "true",
"enableStatusList" : [""],
"packMaintenanceShow" : "true",
"responseStatus" : {"INFO001" : {
"id" : "shExtnBtn3Id",
"packStatusList" : ["", "SEALED", "RATED"],
"prompt" : "true",
"packCountCheck" : "true"}
},
"shipmentTask" : {
"id" : "shExtnBtn3Id",
"packStatusList" : ["", "SEALED", "RATED"],
"prompt" : "true",
"packCountCheck" : "true"
},
"handler" : "function(){performWfTaskPackButtonAction.call(this,\"Seal Pack\", \"W-SNPKCL\");}"
}
 
With the exception of the members in Black Box Workflow Task Members, the object members in the sample code are described in Parent Object Members.

Black Box Workflow Task Members
 
Member
Function
responseStatus
The member responseStatus has a member for each response code you want to link with a handler action. In the sample code, the status code key is INFO. There are three different status code keys:
INFO means an information message.
WARN means a warning message.
ERROR means an error message.
shipmentTask
This member allows you to configure a shipment-level button to run automatically when the pack-level button action completes successfully. You can also express conditions before the shipment-level action is run. Configure the handler action using a JavaScript object with the following members:
id determines the ID of the pack- or shipment-level button to be executed.
packStatusList outlines a list of pack statuses. All packs on the transaction must have a status on this list before the transaction-level button can be executed.
prompt specifies if a popup message is displayed, asking the user to confirm they want to execute the pack- or shipment-level button.
packCountCheck activates a pre-execution check. This check verifies the pack count override is equal to the number of packs on the transaction before the pack- or shipment-level task is executed.
Progress logic through a black box call can return many status messages. The client browser joins all information and warning response messages and displays them in a single user message. The client browser displays a separate user message for each error message. If a response code is returned without any text message, the response is not displayed. However, the response code can be used to trigger a response action on the client. On the extension button, you can configure event handling for the response status codes returned by the black box message request. The event is the status code. You can configure the handler using the extension button member responseStatus. This member is a JavaScript object that has a member for each response code you want to link with a handler action. The handler action identifies the button to be executed. Configure the handler action using a JavaScript object with the members:
id
packStatusList
prompt
When a black box message returns multiple status codes, the response handler is only executed for the first returned status code for which a handler has been configured. When a response handler is executed, the member shipmentTask for that configured button is not processed. The member shipmentTask is executed only if no response status matches an entry in the member responseStatus.