cancel
Showing results for 
Search instead for 
Did you mean: 

Running XMC workflow scripts in pc for testing

Running XMC workflow scripts in pc for testing

Jose_Chaves
New Contributor II

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

1 ACCEPTED SOLUTION

Ludovico_Steven
Extreme Employee
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.

View solution in original post

4 REPLIES 4

Ludovico_Steven
Extreme Employee
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.

Hi,

The file is password protected.

Regards,
José Chaves

Password is "emc"
Need to set that when emailing it, else it gets clobbered by email virus checking!

Thanks, Ludovico

 

That is exactly what I was looking for.

Regards,
José Chaves

GTM-P2G8KFN