fdmContext in a custom script

Hello everyone,

I'm faced with a problem on a custom in FDMEE script.

I have a custom jython script that calls an ODI scenario. My problem is how to move the POV selected in fdm to the ODI scenario? I need to get information from the period inside my ODI package.

POV_Selected.PNG

How can I achieve this?

Thank you very much!!!

Best regards

Eduardo Almeida

Your other question is that fdmContext will not be initialized in a custom script. If you need to get the FDMEE period in the scenario ODI, you must configure a custom script parameter that evaluates to FDMEE period POV as input that you can then recover in your script that is customized by using the following API - fdmAPI.getCustomScriptParameterValue ("ParameterName")

You'd then this value as a variable argument to the ODI scenario

Tags: Business Intelligence

Similar Questions

  • Error: Import module XLRD in a custom script FDMEE

    Hello Experts,

    I'm trying to import a python "xlrd" module in a custom Script FDMEE. But he doesn't always lift error "No Module name xlrd".

    I tried to import the module by changing the path sys:

    Here is the code I tried:

    ===========================================================================================

    import sys

    "custModlePath = r'fdmContext ["INBOXDIR"] +"\\Excel_Sample\\xlrd""

    sys. Path.Append (custModlePath)

    import xlrd

    path = fdmContext ["INBOXDIR"] + "\\Excel_Sample\\."

    pathout = fdmContext ["INBOXDIR"] + "\\Excel_Sample\\Out."

    Book = xlrd.open_workbook (path)

    data_sheet = book.sheet_by_name ("Report")

    #data_sheet = book.sheet_by_index (3)

    start_row_count = 7

    end_row_count = data_sheet.nrows

    MyFile = open (fdmContext ["INBOXDIR"] + "\\Excel_Sample\\Out\\mapping.csv",'w")

    #myfile = open('SG\OUT\mapping.txt','w')

    all in start_row_count < end_row_count:

    #print data_sheet.row_values (i)

    lines = data_sheet.row_values (start_row_count)

    for the line data_sheet.row_values (start_row_count):

    MyFile.Write (STR (Line))

    MyFile.Write(",")

    MyFile.Write ("\n")

    start_row_count = start_row_count + 1

    MyFile.Close)

    =============================================================================================

    ERROR:

    2016-01-27 01:18:11, 294 FATAL [AIF]: error in CommProcess.executeCustomScript

    Traceback (most recent call changed):

    File "< string >", line 191, in executeCustomScript

    File '< string >", line 486, in executeCustomScript

    Folder "< string >", line 528, in executeJythonScript

    File "E:\FDMEE/data/scripts/custom/EXCEL_TO_CSV.py", line 6, < module >

    import xlrd

    ImportError: No module named xlrd

    2016-01-27 01:18:11, 336 DEBUG [AIF]: the connection of fdmAPI was closed.

    ===========================================================================================

    Appreciate your help!

    Thank you

    Ishti

    Hello

    I was able to get it working after some changes.

    Version compatible with Jython 2.5.1 FDMEE xlrd is xlrd 0.7.4

    Xlrd record is required to be placed inside the FDMEE server and the path is required to be updated in the script.

    Below the script just in case someone needs it:

    ===============================================================================================

    import sys

    custModlePath = fdmContext ["INBOXDIR"] + "\\Excel_Sample" # path in which is placed the folder xlrd

    sys. Path.Append (custModlePath)

    import xlrd

    path = fdmContext ["INBOXDIR"] + "\\Excel_Sample\\Mapping.xls" # path to the Source file

    pathout = fdmContext ["INBOXDIR"] + "\\Excel_Sample\\Out\\" # path to the .csv file

    Book = xlrd.open_workbook (path)

    data_sheet = book.sheet_by_name ("Report")

    start_row_count = 7

    end_row_count = data_sheet.nrows

    MyFile = open (pathout + "mapping.csv", "w" ")

    everything start_row_count<>

    lines = data_sheet.row_values (start_row_count)

    for the line data_sheet.row_values (start_row_count):

    MyFile.Write (STR (Line))

    MyFile.Write(",")

    MyFile.Write ("\n")

    start_row_count = start_row_count + 1

    MyFile.Close)

    =====================================================================================================

    Thank you

    Ishtique

  • Custom script in RPO making empty columns in the line items during the training.

    Hello friends,

    its URGENT! need help.

    We have a requirement of the company in the case of the currency 'EUR', it should delete the dot (.) and replace the comma (,) with dot (.) and other currencies it must remove the comma from columns, quantity, price per unit and Total.

    For example:

    For "EUR" 2.123,00 and it must convert it to 2123.00 and 2.123 must convert 2123.

    "USD" 2.123,00 to convert to 2.12300 and 2 123 to convert to 2123.

    This requirement, we wrote a custom script User Exit (UserExitLineItemValidate) function and call that function in line item validation.

    but after having formed the invoices for currency 'EUR' by supervised and learning check (SLV), it removes the values in the column quantity, unit price and Total.

    and if we remove the script, train and then reapply custom script it works but not always.

    My Script:

    Public Sub UserExitLineItemsValidate (pWorkdoc As SCBCdrPROJLib.SCBCdrWorkdoc, pValid As Boolean)

    ' User exit is called at the end of the Document_Validate on the class "bills".

    Dim strQuantity As String

    Dim strUnitPrice As String

    Dim strTotal As String

    Dim lngRow As Long

    Dim pTable As SCBCdrTable

    Set pTable = pWorkdoc.Fields ("LineItems"). Table (pWorkdoc.Fields("LineItems"). ActiveTableIndex)

    If fnIsVerifier and pWorkdoc.Fields ("Currency"). Text = "EUR" Then

    For lngRow = 0 To pTable.RowCount - 1


    strUnitPrice = pTable.CellText ("unit price", lngRow)

    If InStr (strUnitPrice, ".") > 0 and InStr (strUnitPrice, ",") > 0 Then

    strUnitPrice = Replace(strUnitPrice,".","")

    strUnitPrice = Replace(strUnitPrice,",",".")

    pTable.CellText ("unit price", lngRow) = strUnitPrice

    ElseIf InStr (strUnitPrice, ",") > 0 Then

    strUnitPrice = Replace(strUnitPrice,",",".")

    pTable.CellText ("unit price", lngRow) = strUnitPrice

    End If

    strTotal = pTable.CellText ('Total', lngRow)

    If InStr (strTotal, ".") > 0 and InStr (strTotal, ",") > 0 Then

    strTotal = Replace(strTotal,".","")

    strTotal = Replace(strTotal,",",".")

    pTable.CellText ('Total', lngRow) = strTotal

    ElseIf InStr (strTotal, ",") > 0 Then

    strTotal = Replace(strTotal,",",".")

    pTable.CellText ('Total', lngRow) = strTotal

    End If

    strQuantity = pTable.CellText ("quantity", lngRow)

    If InStr (strQuantity, ".") > 0 Then

    strQuantity = Replace(strQuantity,".","")

    End If

    If InStr (strQuantity, ",") > 0 Then

    strQuantity = Replace(strQuantity,",",".")

    End If

    pTable.CellText ("quantity", lngRow) = strQuantity

    Next LngRow

    On the other

    For lngRow = 0 To pTable.RowCount - 1

    strTotal = pTable.CellText ('Total', lngRow)

    If InStr (strTotal, ",") > 0 Then

    strTotal = Replace(strTotal,",","")

    pTable.CellText ('Total', lngRow) = strTotal

    End If

    strUnitPrice = pTable.CellText ("unit price", lngRow)

    If InStr (strUnitPrice, ",") > 0 Then

    strUnitPrice = Replace(strUnitPrice,",","")

    pTable.CellText ("unit price", lngRow) = strUnitPrice

    End If

    Next LngRow

    End If

    End Sub

    At a very high level of control, (and I can't currently that take a long time to respond)

    • You do this on EVERY invoice, and not only those that you are sub classification (which means "documents that you are training").  Is your intention to assign all invoices or only those formed?
    • In your code, you have the test as shown condition "If fnIsVerifier and pWorkdoc.Fields("Currency").» Text = "EUR" Then".»  You are in essence saying the system ONLY evaluate this condition if the system determines if the application Verifier is running.  What is the desired effect?  Otherwise if the auditor is never used on this document, and the table of line items is never changed, this code would never trigger.
  • Need help with custom script to rename the layers

    Hello world.

    I need help to write a custom script (because I suck at it) that will allow me to go through all the layers and sous-calques for a specific name ('X') and give it a new specific name ('Y').

    I have had success using the script below, but it does not work on any text layers names where the text layer was previously particularly well-known in 'X' and now changed needs.

    Any help is greatly appreciated.

    * Note: this script was originally used to find any layer with 'Copy' in its name and remove with anything after (to correct the problem of duplication of layers by adding this text).

    This is why the function is named removeCopy. It works for renaming layers also - just not a layer of text unfortunately.

    #target illustrator

    function removeCopy() {}
    If (app.documents.length == 0) return;
    var app.activeDocument = docRef;
    recurseLayers (docRef.layers);
    }
    removeCopy();
    function recurseLayers (objArray) {}
    for (var i = 0; i < objArray.length; i ++) {}
    ObjArr [i] .name = ObjArr [i].name.replace (/ \s*current name\s*\d*/, 'new name');
    If (objArray [i] .layers) recurseLayers (. layers.length > 0 ObjArr [i]);
    }
    }

    I finally found something after searching forums for a week. My confusion was related to the way Illustrator treats real layers against text/path/object "layers." Instead of layers, I had to use the pageItems in the script. The code below works. Thanks to Gustavo for his answer in another thread and Carlos I thank you for this looking too good! You're great to be ready to help models do more advanced things with Illustrator.

    var doc = app.activeDocument;
    var items = doc.pageItems;
    for (var g = 0; g)
        elements [g] .name = elements [g].name.replace ('Century Schoolbook text line', ' MonogramText: Century Schoolbook ");
    };
    App.Redraw ();
  • To access the icons of InDesigns for custom scripts

    Hi all

    I think remember me a moment ago see a PDF file that had all the icons that uses InDesign and an access method and use them in my own custom scripts.

    I went through all my PDF resources which in have accumulated over the years and can't seem to find it. \

    Someone at - it a PDF file that contains this information, or resource online for this?

    Thank you very much


    Roy

    You can find a PDF catalog (Peter Kahrel site):

    Icon catalog

    Jarek

  • Custom scripts does not work in Illustrator CC (2014)

    Some custom scripts that are part of my workflow do not work in the new CC; MultiExporter.jsx and Sprite CSS Generator.jsx.

    When I try to run is titled a modal window rises as if the script is running, but the actual window is only a few pixels maximum and cannot be resized.export-win.png

    sprite-gen-win.png

    They have both worked very well in CC. My scope of javascript is pretty basic, but is there code that needs to be changed to update these to work with the current version?

    Thank you!

    Bob

    It seems that this could be a system issue or a conflict; I uninstalled CC2013 AI and AI CC2014 so clearing out all the prefs, artifact files and folders. Then did a fresh install of CC2014 it has been able to use all my scripts inherited without problem.

  • Simple about how to use custom scripts?

    Y at - it plug-in or what that makes me a separate where window can I click just to use a custom script? Other easy ways are very good.

    In the tools had or has a free plug-in. I think it is called "script of Bay". He

    that's why and should work, I think that, with Illustrator.

    www.in-Tools.com

    Ariel

  • Custom script to generate a number within a range based on a sum

    Hello again,

    I have a question about another custom script, I am creating.

    I currently have a simple script running in a field (field) which creates a sum based on the number of entries in 7 areas (fields R1 - R7) and of a field (field B) that creates an average based on the number of entries in 7 boxes.

    I want to do is to have the field B to the contrary generate a number based on what the sum in the field row added up to.

    For example:

    A total of 7 to 12 in zone 1 would generate a 1 in zone 2.

    A total of 13-17 in area 1 would generate a 2 in zone 2.

    A total of 18-23 in zone 1 would generate a 3 in zone 2.

    And etc..

    I don't know if a custom script is even necessary - but I got bit by a mental block with this one.

    Any help would be greatly appreciated, thank you very much!

    You can use something like this than the calculation script custom field 2:

    If (this.getField("Field_1").valueAsString == "'") event.value = "";

    else {}

    var v1 = + this.getField ("Field 1") .valueAsString;

    If (v1 > = 7 & v1)<=12) event.value="">

    ElseIf (v1 > = 13 & v1)<=17) event.value="">

    ElseIf (v1 > = 18 & v1)<=23) event.value="">

    }

  • Custom script multiload

    Hello

    I know that people are not too eager to distribute free scripts on this forum, because they are difficult to create, but I was hoping someone could give me some advice on how to perform a multiload using a custom script. I managed to do a lot before charge, but I can't get the multiload job and there aren't good examples in the admin or the API docs.

    Here is a copy redacted my script - it fails when it gets to the statement of fStructGetText...

    I look forward to any advice on how to get this working :)

    Thank you!

    Void LoadForecastData()

    Set MPENG = CreateObject ("upsMPLDMw.clsMPLoader")
    MPENG.mInitialize API, SCRIPTENG

    fileName = "\\server\folder\multiload.csv".

    "The step below is one that fails
    MPENG.fStructGetText (fileName)

    "Don't know where to find the ColLoadSet for the second parameter below.
    MPENG.fMultiImportText (filename, ColLS)

    End Sub

    You can create a batch Workbench multiload script. Tools > batch processing

  • Package Foglight - Custom Script Agent, a file?

    All,

    So, I am writing a custom script agent. It requires some bianary custom to be in the same folder. Is it possible to pack these bits in the agent?

    Thank you

    It is a pity that your screenshot does not show the corresponding part of the log file and the log file is not zipped and fastened. Otherwise, maybe your version, platform, and the FMS symptom matching the error described in SupportLink Solution 82250: https://support.quest.com/Search/SolutionDetail.aspx?id=SOL82250&category=Solutions&SKB=1&product=Foglight ?

    If so, an upgrade may be required to resolve the issue.

    Kind regards

    Brian Wheeldon

  • Call the Essbase Calc of custom Script FDMEE script

    Hi Experts,

    In my reuirement, I must run Essbase calc script to export the perticular accounts data and then import these data into FDMEE to load in another planning application.

    I know we can run the Application Esbase calc script fromTarget page and after load. but in my case, executing the script should happen prior to importation.

    Aanybody may suggest an example if I can call the script to calc Essbase to a custom event BefImport script or FDMEE script? an example of the syntax would be useful

    Thank you!

    Hello

    are what version of FDMEE you?

    You have an example document to support FDMEE sample scripts (Doc ID 1613836.1)

    You can have a MAXL command in your batch file to perform the extract

    Example 5

    An example script to calc to perform an Essbase excerpt and then load the file extracted with FDMEE.

    1. Create a batch (.bat) file that performs extract Essbase.
    2. Call the scriptimport BefImport event operating system batch file
      import of subprocesses
      Import shutil
      OS.chdir ("D:\temp\\BatchFiles")
      command = ' D:\temp\BatchFiles\helloworld.bat > helloworld.out '
      p = subprocess. Popen (Command)
      RETCODE = p.wait)
    3. Load using FDMEE HelloWorld.out

    The Jython script can be created in the BefImport Script.

    Then you can have a rule of data loading with a file in it name (Ex: Essbase_Extract_XXXX) where XXXX is that five-year period.

    Your jython script should create this file, so in the case of import, the data is imported

    Keep in mind that it is an output of feature 11.1.2.4 box so if you are in 11.1.2.3.x I wouldn't put a lot of effort in a complex solution

    I hope that this puts you on the right track

  • Custom script to Calc for value selection drop down box

    I have a drop down called "EffectiveDate" with 12 elements (01/01/16; 16/02/01; 01/03/16...-01/12/16).  I need the number of pay periods in the year according to their effective date to fill in a field of text on the left.  Can anyone see why this custom calculation script does not work?

    var v = this.getField("EffectiveDate").value;

    If (v == ' 01/01/16') event.value = 26;

    otherwise if (v == ' 01/02/16') event.value = 24;

    else if (v == ' 01/03/16') event.value = 22;

    else if (v == ' 01/04/16') event.value = 20;

    else if (v == ' 01/05/16') event.value = 18;

    else if (v == ' 01/06/16') event.value = 16;

    else if (v == ' 07/01/16') event.value = 14;

    else if (v == ' 01/08/16') event.value = 11;

    else if (v == ' 09/01/16') event.value = 9;

    else if (v == ' 10/01/16') event.value = 7;

    else if (v == "01/11/16") event.value = 5;

    else if (v == ' 01/12/16') event.value = 3

    else event.value = "";

    * NOTE: I already use the value of exports for a different purpose, so I can't use them for that.

    If the value of exports of "01/01/16" is "1000", then replace this line in your code:

    If (v == ' 01/01/16') event.value = 26;

    With this:

    If (v == "1000") event.value = 26;

  • I need a custom script for the calculation in a PDF form.

    I am working on a form of commissions airport rental cars with exclusions.  Could someone please a custom for the following script?

    R + C = less the sum of (Ea, Eb, Ec)

    Thank you!

    Under the Simple field of tab notation option calculate enter:

    R + C - (Ea + Eb + Ec)

  • ESXi 5.5 check if the custom script is running

    Hello

    I'm working on a solution, as remote custom for ESXi environments.  The only area that I have a problem, is that I need to check if my (running locally on the ESXi host) shutdown script runs in reality or (to avoid running processes in doubles).

    I know that in the ordinary Linux systems I can do things like (ps to the | grep "test.sh" | grep - v 'grep') or (c - stat %X /proc/ pgdump).  This doesn't seem to work on ESXi.

    Recommendations:

    • This must be run locally on the remote site
      • no access to the vCenter Orchestrator
    • No windows
      • The main system that will control the whole process is Debian
    • Do not install any 3rd party on ESXi hosts
    • Do not recommend N.U.T.S or APCUPSD
    • Must be able to check if the script works not the commands in the script
      • The real script runs several commands at different times

    Test configuration:

    1. Create a loop file in /tmp/test.sh

    #! / bin/sh

    I have = 1

    while [[ $i -le 1000000]]

    do

    echo 'Still running.  Step $i'

    ((i = i + 1))

    fact


    1. Make the file executable
      1. chmod + x /tmp/test.sh
    2. Run the test script
    3. Which can run to verify that the script still works?

    Any help is appreciated.

    Thank you

    B

    Ok.  Spend many hours looking for a way to see who "sh" process to run my script, I gave up and continued in the way of what has suggested Alistar.

    Solution: (linux - dirty way to ensure that only one instance of a shell script is running at a time - Stack Overflow)

    Basically, we create a file locking with the PID on the inside.  If the concurrent process give it a shot, they are arrested.  You can also look in the locking file to find the PID, if you want to force the exit, the newspaper, etc...

    For example

    #!/bin/sh
    LOCKFILE=/tmp/lock.txt
    
    if [ -e ${LOCKFILE} ] && kill -0 `cat ${LOCKFILE}`; then
         echo "already running"
         exit
    fi
    
    # Remove the lockfile when process is exited
    trap "rm -f ${LOCKFILE}; exit" INT TERM EXIT
         echo $$ > ${LOCKFILE}
    
    #do stuff
    i=1
    while [[ $i -le 1000000 ]]
         do
              echo "Still running.  Step $i"
              let i=i+1
    done
    
    rm -f ${LOCKFILE}
    
  • Custom script to add cells, but not displaying not 0

    Value 1 Value 2 Total
    5510
    6410
    0
    0

    I cells, similar to above, I want to calculate the total, but the Adobe x format means that there will always be a zero in empty cells. I don't want that.

    I need a script to sum that specifies if the response is 0, to hide.

    I tried searching around, but could not get anything to work.

    Warning, I'm very new to this. I'm looking to use the "Custom calculation Script" box in Adobe, and I can use the JavaScript Document settings as well.

    That's what I ended up finding and using:

    Get the field values as numbers

    var v1 = + getField("1-2").value;

    var v2 = + getField("1-4").value;

    var v3 = + getField("1-6").value;

    var v4 = + getField("1-8").value;

    V5 var = + getField("1-10").value;

    Perform the addition

    var sum = v1 + v2 + v3 + v4 + v5;

    Set this field value

    If (sum! == 0) {}

    Event.Value = sum;

    } else {}

    This field blank

    Event.Value = "";

    }

Maybe you are looking for

  • Seidio extended battery

    If someone else has installed the Seidio extended battery and see the performance of your phone down? mine seems to work more slowly than before.

  • 5 c battery

    My child has a 5 c iPhone, the problem is she she charges all day at 100%, battery works fine until it reaches about 27%, then it just dies. I know that there where a lot of 5 c, which had a battery problem and Apple decided to fix, but my children i

  • Vista - Cannot install KB2378111

    I get an error when you try to install the update of security for Windows Vista for x 64-based systems (KB2378111) error is that it has been configured incorrectly

  • Upgrade to Vista Edition sp2 Home Premium (Italian version) fail - error 0 x 80041010

    I have a Windows Vista Home Premium SP1.When I try to install sp2, after license agreement, the installation fails with "Unknow Error" and this error code: 0 x 80041010.How can I solve? Thank you

  • Impossible to establish a VPN between AG241 and WAG54GP2 tunnel

    Hello This is my first post on this forum and I send my best regards to everyone! I signed up because I have a problem with establishing a VPN tunnel between an AG241 modem/router and a modem/router WAG54GP2 with wireless and VoIP. The scenario is si