Actually, that is what I do when I write XMC/XIQ-SE Python scripts (or individual workflow Python activities).
I have this code at the beginning of my code:
##########################################################
try:
emc_vars
execution = 'xmc'
except: # If not running on XMC Jython...
# These lines only needed to run XMC Python script locally (on my laptop)
# They can also be pasted to XMC, but will not execute
import sys
import json
import java.util
import emc_cli # Own local replica
import emc_nbi # Own local replica
import emc_results # Own local replica
execution = 'dev'
if len(sys.argv) > 1: # Json file as 1st argv
emc_vars = json.load(open(sys.argv[1]))
else:
emc_vars = json.load(open('emc_vars.json'))
##########################################################
And I use the attached bogus classes which simply read the emc_vars or CLI command output directly from a json file I edit.
Original Message:
Sent: 01-06-2022 17:01
From: Jose Chaves
Subject: Running XMC workflow scripts in pc for testing
Hi,
I'm creating some workflows in XMC and I would like to run them on my PC first just for testing.
Is there a class or functions that I can import just to simulate the script and check for errors, even if it is just syntax error, before running it on the XMC?
Regards,
José Chaves