-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathProcessLogGenerator.py
More file actions
135 lines (111 loc) · 5.28 KB
/
ProcessLogGenerator.py
File metadata and controls
135 lines (111 loc) · 5.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
import random
import datetime
import uuid
def generate_sap_event_log(num_entries):
# Customized activities for the Death Star project
activities = [
"Strategic Empire Analysis During Death Star Study Phase",
"Developing Business Case for Death Star Project Proposal",
"Architecting Intergalactic Superweapon Solution",
"Planning Major Construction Phase for Orbital Battle Station",
"Mitigating Risks in Death Star's Troubled Project Areas",
"Initiating New Galactic Domination Program",
"Creating Work Breakdown Structure for Superlaser Development",
"Determining Resource Dependencies Across Star Systems",
"Sequencing Intergalactic Construction Activities",
"Scheduling Imperial Fleet Mobilization for Material Transport",
"Implementing Risk Management for Rebel Incursion Scenarios",
"Preparing Detailed Activity List for Imperial Engineering Corps"
]
# Resources relevant to the Star Wars universe
resources = [
"Darth Vader", "Emperor Palpatine", "Grand Moff Tarkin",
"Imperial Droid #1", "Imperial Engineer", "Stormtrooper Squad Leader",
"Imperial Fleet Commander", "TIE Fighter Pilot"
]
# Start date for the project
start_date = datetime.datetime(3, 1, 1) # Galactic Standard Calendar
# Initialize the list for log entries
log_entries = []
for _ in range(num_entries):
# Random date within a specified timeframe
days_offset = random.randint(0, 364)
event_date = start_date + datetime.timedelta(days=days_offset)
# Random activity and resource
activity = random.choice(activities)
resource = random.choice(resources)
# Additional attributes and status information
additional_attributes = "Location: Unknown sector of the galaxy"
status_info = random.choice(["Pending", "Completed", "In Progress"])
# Synthetic SAP log entry
log_entry = {
"Case ID": str(uuid.uuid4()),
"Event ID": str(uuid.uuid4()),
"Timestamp": event_date.strftime("%Y-%m-%d %H:%M:%S"),
"Activity": activity,
"Resource": resource,
"Additional Attributes": additional_attributes,
"Status Information": status_info,
"Data Payload": f"{activity} executed by {resource}. Status: {status_info}."
}
log_entries.append(log_entry)
return log_entries
# Generate 10 synthetic SAP event log entries
synthetic_sap_logs = generate_sap_event_log(3)
print(synthetic_sap_logs)
def generate_material_procurement_log(num_entries):
# Define materials and suppliers for the Death Star project
materials = [
"Durasteel Plating", "Hyperdrive Components", "Turbolaser Cannons",
"Deflector Shields", "Tractor Beam Projectors", "Kyber Crystals"
]
suppliers = [
"Kuat Drive Yards", "Sienar Fleet Systems", "Corellian Engineering Corporation",
"BlasTech Industries", "Arakyd Industries", "Imperial Armory"
]
# Define activities related to material procurement
activities = [
"Material Order Placement", "Supplier Contract Negotiation",
"Delivery Schedule Coordination", "Quality Inspection of Materials",
"Inventory Management", "Emergency Resupply Request"
]
# Define resources involved in material procurement
resources = [
"Imperial Logistics Officer", "Procurement Droid", "Imperial Supply Captain",
"Quality Control Specialist", "Imperial Quartermaster", "Fleet Supply Officer"
]
# Start date for material procurement activities
start_date = datetime.datetime(3, 1, 1) # Galactic Standard Calendar
# Initialize the list for log entries
log_entries = []
for _ in range(num_entries):
# Random date within a specified timeframe
days_offset = random.randint(0, 364)
event_date = start_date + datetime.timedelta(days=days_offset)
# Random activity, material, supplier, and resource
activity = random.choice(activities)
material = random.choice(materials)
supplier = random.choice(suppliers)
resource = random.choice(resources)
# Additional attributes and status information
additional_attributes = f"Material: {material}, Supplier: {supplier}"
status_info = random.choice(["Order Placed", "In Transit", "Delivered", "Delayed"])
# Data payload
payload = f"{activity} for {material} with {supplier}. Handled by {resource}. Status: {status_info}."
# Synthetic SAP log entry for material procurement
log_entry = {
"Case ID": str(uuid.uuid4()),
"Event ID": str(uuid.uuid4()),
"Timestamp": event_date.strftime("%Y-%m-%d %H:%M:%S"),
"Activity": activity,
"Resource": resource,
"Additional Attributes": additional_attributes,
"Status Information": status_info,
"Data Payload": payload
}
log_entries.append(log_entry)
return log_entries
# Example usage: generate_material_procurement_log(10) will generate 10 log entries
# Note: Running this function will produce different outputs each time due to the randomization.
synthetic_sap_logs = generate_material_procurement_log(3)
print(synthetic_sap_logs)