Skip to content

jmcparland/sw10_task_trace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task Summarization (Swimlane 10)

This project analyzes Swimlane 10 system data to produce a JSON summary of each Task (Integration), including conditions, triggers, effects, and related application details.

Sample Output

The output is a JSON array of summarized tasks, each including:

  • id, name, disabled, action_type, and parent application
  • io: grouped inputs and outputs by application
  • causes: grouped triggers, buttons, workflow_paths, and widgets
  • effects: grouped imports, Python usage flags, and app references
[
  {
    "id": "azWdQYe0argHwlPm",
    "name": "C1 Link Referenced Records",
    "disabled": false,
    "action_type": "packaged",
    "application": "C1 Cor Alert",
    "io": {
      "inputs": {},
      "outputs": {
        "C1 Cor Alert": [
          "Record Link Status",
          "Link Referenced Records Duration",
          "Linked Alerts",
          "Linked Cases",
          "Found Alerts",
          "Found Cases"
        ]
      }
    },
    "causes": {
      "triggers": [],
      "buttons": [],
      "workflow_paths": [
        {
          "app_name": "C1 Cor Alert",
          "path": {
            "conditions": [
              { "field": "IOC1", "conditionType": "doesNotEqual", "value": null },
              { "field": "IOC2", "conditionType": "doesNotEqual", "value": null },
              { "field": "IOC3", "conditionType": "doesNotEqual", "value": null },
              { "field": "Raw Correlation Keys 2", "conditionType": "doesNotEqual", "value": null },
              { "field": "Correlations Found", "conditionType": "equals", "value": "True" }
            ],
            "action": {
              "node_name": "C1 Link Referenced Records",
              "task_name": "C1 Link Referenced Records"
            }
          }
        }
      ],
      "widgets": []
    },
    "effects": {
      "imports": [],
      "python_driver": false,
      "uses_save": false,
      "uses_patch": false,
      "uses_ApplicationId": false,
      "apps_in_script": [],
      "apps_in_literals": []
    }
  },
  {
    "id": "afZzp3sJk3Ab7arW",
    "name": "Alert Correlation",
    "disabled": false,
    "action_type": "packaged",
    "application": "C1 Cor Alert",
    "io": {
      "inputs": {},
      "outputs": {
        "C1 Cor Alert": [
          "Correlation Tracking IDs",
          "Correlation Execution Duration",
          "Correlations Found",
          "Correlation Data"
        ]
      }
    },
    "causes": {
      "triggers": [],
      "buttons": [],
      "workflow_paths": [
        {
          "app_name": "C1 Cor Alert",
          "path": {
            "conditions": [
              { "field": "IOC1", "conditionType": "doesNotEqual", "value": null },
              { "field": "IOC2", "conditionType": "doesNotEqual", "value": null },
              { "field": "IOC3", "conditionType": "doesNotEqual", "value": null },
              { "field": "Raw Correlation Keys 2", "conditionType": "doesNotEqual", "value": null }
            ],
            "action": {
              "node_name": "Alert Correlation",
              "task_name": "Alert Correlation"
            }
          }
        }
      ],
      "widgets": [
        {
          "app_id": "a429brBe6_oMlNMyw",
          "app_name": "JOE - Test Widget Refs",
          "widget_name": "Widget"
        }
      ]
    },
    "effects": {
      "imports": [],
      "python_driver": false,
      "uses_save": false,
      "uses_patch": false,
      "uses_ApplicationId": false,
      "apps_in_script": [],
      "apps_in_literals": []
    }
  },
  {
    "id": "a9mPE7U29RWjrK5tN",
    "name": "FBT2- Write to All Note Fields",
    "disabled": false,
    "action_type": "python312",
    "application": "C2 Big Text 2",
    "io": {
      "inputs": {},
      "outputs": {}
    },
    "causes": {
      "triggers": [],
      "buttons": [
        "Write to Spare (App: C2 Big Text 2)"
      ],
      "workflow_paths": [],
      "widgets": []
    },
    "effects": {
      "imports": [
        "from swimlane import Swimlane"
      ],
      "python_driver": true,
      "uses_save": true,
      "uses_patch": false,
      "uses_ApplicationId": false,
      "apps_in_script": [],
      "apps_in_literals": [
        "aA5LsjyorIKEY8GRd"
      ]
    }
  }
]

Use

  1. Install dependencies:
    Ensure you have Python 3.12+ and required packages (see requirements.txt).

  2. Run the analysis:
    Set environment variable SWIMLANE_URL or use --url <...>.

    Set environment variable SWIMLANE_TOKEN or use --token <...>.

    python trace_analysis.py > output.json
    

What it Does

  1. Fetches the Swimlane Applications light list for initial name and ID data.
  2. Analyzes Task objects to produce the initial, machine-readable report.
  3. Analyzes the detailed Application and Workflow objects searching for widgets, buttons, and workflow conditions that reference Tasks, augmenting the Task reports.
  4. Produces a more "human-readable" version of the report (example above).

Next Steps

  • Edge cases and fixes.
  • Attempt a "call graph": This task makes a change that may cause that task to run.
  • Integrate with visualization tools for dataflow mapping.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages