Creating Context Variable

You can create multiple context variables in a process flow using the PutContextVar action. Once they are created, you can use these context variables in the context of the process context as and when required.

Steps to create a Context Variable

  1. Click hierarchy structure in the Repository View panel. Expand the Action list and select the Put-Context-Var action. Drag it to the Graph Canvas area. The Put-Context-Var action is displayed in the Graph Canvas.

     

  2. Right-click Put-Context-Var action and select View Properties. The properties of the Put-Context-Var action are displayed in the Properties Panel in the Bottom Pane (see Figure 99).

     

  3. Click the Edit button. The Edit Context Variables screen is displayed. This screen displays a list of existing context variables and the Add Variable ( ), Edit Variable ( ) and Delete Variable ( ) buttons.



     

    The Edit Variable and Delete Variable buttons appear as disabled if no context variables have been created or no existing context variables have been selected.

  4. Click Add Variable ( ) button to create a new context variable.

    The Context Variable Information screen is displayed.



  5. Select the name of the activity for which you want create the context variable, from the dropdown list Activity Name. This dropdown lists all the activities that are currently present on the Graph Canvas. Once you select the activity, all the attributes of the selected activity, are listed in the Variable Name dropdown list.

    If the Activity Name field is left blank, then a new context variable is declared.

  6. Select the attribute for which you want to create the context variable, from the dropdown list Variable Name. For example, you can select the File Path field in case of a File Source or File Target activity.

    If the Activity Name field is blank, then the current context variables will be listed in the Variable Name dropdown list.

  7. Enter the value that you want to set for the attribute/context variable, in the Variable Value field.

     Encryption Using Vault

    To encrypt the Variable Vaule using Vault, first create a vault and instead of writing the Vaule in plain text, write the aliasName and the key, which contains the Variable Value, in the following format:

    {Vault.aliasName.key}

    where,

    • Following an opening curly parentheses, 'Vault' is a keyword (V in 'Vault' is UPPERCASE).
    • aliasName is the Vault Alias, where the paramete is defined.
    • key is the parameter which stores the Variable Value.
    • Finally closed by a closing curly parentheses.
    • A period is used as a separator between Vault and aliasName; and aliasName and key.


    For example, for a Variable fileName, instead of writing its value in plain text, type in the Variable Value as {Vault.safe.client_key}

    You can even append the current date or time stamp with the name of the file in the Variable Value field. To do this, click in the Variable Value field, and press <CTRL> + <Space Bar>. A list of the date and time format is displayed. Selecting a format from this list, displays it in the Variable Value field. Alternately, you can enter the required file path with the file name as in the example:
    C:\target\File_target%%yyyy-MM-dd%%.txt
     
    The Variable Value field does not support '&' and '<' symbols.

  8. Click Done.This adds the context variable and takes the control back to the Edit Context Variables screen, where the new context variable is added to the list of existing context variables.



    You can add multiple context variables (up to a maximum of 100) for the process flow.

  9. Click Done on the Edit Context Variables screen to add all the displayed context variables to the context of the process flow.

    Similarly, you can edit a context variable, by selecting it from the list of existing context variables on the Edit Context Variables screen. This selection will enable the Edit Variable button. Clicking this button will display the Context Variable Information screen with the selected context variable details in edit mode. You can make the necessary changes and click Done to save the modified context variable.
     
    You can delete a context variable, by selecting it from the list of existing context variables on the Edit Context Variables screen. You can select multiple context variables to delete, by pressing <CTRL> and the context variables. This selection(s) will enable the Delete Variable button. Clicking this button will delete the selected context variable(s).



 Settings to View Logs for Standalone/REST(API) triggered Process Flow in Adeptia Connect Dashboard

To View the logs in Connect Dashboard of Process Flow either triggered by REST (API) or executed standalone:

  1. Ensure that 'View Logs on Connect Dashboard' property is enabled.
  2. Set the following required parameters to view its entry in the Connect Dashboard:

     

    Context Variable NameAvailable Key on Parent ContextPossible Value
    transactionTypetransactionType500 (App)
    501 (File)
    502 (EDI)
    504 (Custom)
    templateNametemplateName 
    templateIdtemplateId 
    spokeCompanyName / partnerNamespokeCompanyName / partnerName 
    spokeCompanyIdspokeCompanyId 
    PF_ReferenceIDPF_ReferenceID 
    transactionExecutionLoggerIdparentTxnExecutionLoggerId 
    hubCompanyNamehubCompanyName 
    hubCompanyIdhubCompanyId 
    directiondirection3200 (Inbound)
    3201 (Outbound)
    3202 (VAN)

    Note

    In case any of the above parameters is not defined in Process Flow Context, and only 'View Logs on Connect Dashboard' property is enabled, the entry in the Connect Database will be blank.

 Settings to to run transaction using REST Webhook in a synchronous mode

To run the transaction using REST Webhook in a synchronous mode:

  1. First, set the following predefined context parameters into the process flow.

    Variable NameDescriptionDefault Value
    responseThe response text to be sent as successful response 
    faultThe response text to be sent as invalid response 
    statusCodeThe HTTP status code202 for successful response 500 for invalid response
    contentTypeThe content type of responseTEXT PLAIN

     

     

  2. Send the queryParameter async into the request. The possible values for this parameter is true or false.
    When parameter value is async=false then the REST listener call will be synchronous with process flow execution, else if the parameter is not specified or is async=true, the call will be asynchronous.

 

Note

If no parameter is set then it is assumed it to be a fault with 500 (Internal Server Error) status code.