> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Creating a new activity and adding it to your workflow

> Add a Capture Data utility step to your Pega case workflow and create the CaptureData activity with the pages, classes, parameters, and local variables.

Next, you need to create a new activity and add it to your workflow.

1. In **Dev Studio**, open the case type that you created earlier.

2. On the **Workflow** tab, click **Add life cycle**.

3. Create a first stage with a *Collect Information* step. This step will open the dialog box where files can be added.

   <Frame>
     <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega5.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=8b436cd2d9111798240cdd92d9a6d8c6" alt="Screenshot of the Workflow tab in Pega Dev Studio showing the case life cycle with a single Collect Information stage that contains a Collect Information step." width="581" height="362" data-path="images/flexi-capture/connectors/Pega5.png" />
   </Frame>

4. Create a *Process* stage, add any step to this stage (e.g. *Change stage*), and click **Save**.

   <Frame>
     <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega6.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=43cb73291785c60573f05f08f93965d6" alt="Screenshot of the Workflow tab in Pega Dev Studio showing the case life cycle with a Collect Information stage and a Process stage that contains a Change stage step." width="635" height="217" data-path="images/flexi-capture/connectors/Pega6.png" />
   </Frame>

5. Next, click **Records → Process → Flow** to open the list of flows and double-click the *Process\_Flow* flow for the case type that you created earlier.

   <Frame>
     <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega7.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=5cd6edec274217796ad20f4d6e80061b" alt="Screenshot of the Flow instances list in Pega Dev Studio showing the pyStartCase, Process_Flow, and CollectInformation_Flow flows for the case type." width="969" height="223" data-path="images/flexi-capture/connectors/Pega7.png" />
   </Frame>

6. Replace the *Change stage* step with a *Utility* step.

   <Frame>
     <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega23.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=630270234941f44e9b7fd4fb20d66b3c" alt="Screenshot of the Process_Flow diagram in Pega Dev Studio showing the shape menu with Utility selected and the resulting flow with a Utility shape between the Start and End nodes." width="1050" height="436" data-path="images/flexi-capture/connectors/Pega23.png" />
   </Frame>

7. Double-click the **Utility** item to open its properties. Change the name of the item to *Capture Data.* In the **Rule** field, type *CaptureData* to create a new activity with this name and click the  icon next to this field.

   <Frame>
     <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega49.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=ec34a8bea0bcef37862e848b6c1cbe40" alt="Screenshot of the Utility step properties in Pega Dev Studio showing the name set to Capture Data, the rule type Activity selected, and CaptureData entered in the Rule field." width="499" height="217" data-path="images/flexi-capture/connectors/Pega49.png" />
   </Frame>

8. In the window that opens, click **Create and open**.

9. On the **Pages & Classes** tab, create the following three objects:

| **Page name**  | **Class**            |
| -------------- | -------------------- |
| Case           | Work-                |
| Attachment     | Data-WorkAttach-File |
| AttachmentInfo | Data-WorkAttach-File |

<Frame>
  <img src="https://mintcdn.com/abbyy/KEmWsO92hkr7eybZ/images/flexi-capture/connectors/Pega11.png?fit=max&auto=format&n=KEmWsO92hkr7eybZ&q=85&s=e98c02de75fcac36ea1ae3514a1dc9b5" alt="Screenshot of the Pages & Classes tab of the CaptureData activity in Pega Dev Studio showing the Case, Attachment, and AttachmentInfo pages mapped to the Work- and Data-WorkAttach-File classes." width="959" height="227" data-path="images/flexi-capture/connectors/Pega11.png" />
</Frame>

10. On the **Parameters** tab, create the following three parameters:

| **Name**      | **Data type** |
| ------------- | ------------- |
| CaseId        | String        |
| jsonData      | String        |
| executionMode | String        |

<Frame>
  <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega31.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=c26312f4b0556614bc3f271afc80bdc8" alt="Screenshot of the Parameters tab of the CaptureData activity in Pega Dev Studio showing the CaseId, jsonData, and executionMode String parameters." width="1309" height="342" data-path="images/flexi-capture/connectors/Pega31.png" />
</Frame>

11. Create the following three local variables:

| **Name**    | **Data type** |
| ----------- | ------------- |
| LinkedRefTo | String        |
| Id          | String        |
| Index       | Integer       |

<Frame>
  <img src="https://mintcdn.com/abbyy/Xgx3EG8BZs5YQjIJ/images/flexi-capture/connectors/Pega32.png?fit=max&auto=format&n=Xgx3EG8BZs5YQjIJ&q=85&s=0a086f31fab450012abed0c47813b4e2" alt="Screenshot of the local variables section of the CaptureData activity in Pega Dev Studio showing the LinkedRefTo, Id, and Index variables with their String and Integer data types." width="610" height="278" data-path="images/flexi-capture/connectors/Pega32.png" />
</Frame>
