Create subflow in workflow studio
Use subflows to configure conditions that are applied on the invoice and raise an exception.
시작하기 전에
Role required: admin
This video shows you how to create subflow in workflow studio.
프로시저
-
Navigate to Workflow Studio > New > Subflows.
The subflow page appears.
- Enter the Subflow name.
- Enter the Description.
- Choose the Application as Accounts Payable Invoice Processing in the drop-down list.
- Click Build subflow.
-
Configure Inputs and Outputs for Subflow.
Example: In Subflows, you must fetch the invoice record based on sys_id. Traverse through the invoice record and check if the condition business owner or legal entity is empty. If the condition matches, then the system raises an exception.
- In the Inputs area, enter Label as invoice Sysids.
- Enter Name as invoice_sysids.
- The Type drop-down is auto-populated with String.
- Select Done.
-
In the header area, click Flow variables.
The Flow variables pop-up appears.
- Enter Label as Condition result.
- Enter Name as Condition result.
- Choose Type as True/False.
- Select Save.
-
In Actions area, perform the following steps:
- Select Action as Look Up Records from the drop-down list.
- In the Table field, search forinvoice [sn_shop_invoice].
- Configure the Conditions as sys_id is one of invoice SysIDs.
- In Actions > Accounts Payable Invoice Processing > Look Up Records.
- Select Table as Invoice [sn_shop_invoice]
- Set the Conditions > SysID > is one of > Subflows- Inputs > invoice Sysids.
- Select Done.
- Create Flow logic > For Each item in > Look Up Records > Invoice Records > Done.
- Select If > Condition1 > For Each > Invoice Record > Business owner > is empty.
- Select If > Condition2 > For Each > Invoice Record > Legal entity > is empty.
-
Select then >
icon.
- Click Done.
- Add a flow logic as Set Flow variable.
- Choose Condition result from the drop-down list.
- Select the Data check-box.
- Select Done.
- Add a Flow logic as Set Flow variables.
- Choose Condition result from the drop-down list.
- Select Done.
- Select Save.
- Choose Action > Accounts Payable Invoice Processing > Generate Exception and Line Exceptions from the drop-down list.
- Choose Condition result as Flow Variable.
- Choose Exception Definition Record as Missing BO or LegalEntity.
- Choose the Invoice as For Each > Invoice record.
- Enter the description.
- Select Done.
-
Select Save.
Success message appears as the subflow is saved successfully.
-
Select Publish.
You are prompted with an alert message "Are you sure you want to publish this subflow? Your changes will be applied to all instances where this subflow is being used."The subflow is successfully created.