Fred,

    I think that would work too. :) Good call.

    If you add an else action that clears 'zint_position' then you
would even be able to clean up the temp field after the parsing too.
:)

--
Carey Matthew Black
Remedy Skilled Professional (RSP)
ARS = Action Request System(Remedy)

Solution = People + Process + Tools
Fast, Accurate, Cheap.... Pick two.
Never ascribe to malice, that which can be explained by incompetence.


On 7/29/06, Grooms, Frederick W <[EMAIL PROTECTED]> wrote:
Question...
Why have Active Links 2 and 3 as separate ALs?

New Active Link:  // assuming your only care about \ as a file separator

Run If : 'ProdlistFileLocation_FILENAME' LIKE "%\%"
Action #1:
 Set zint_position = STRSTR($ProdlistFileLocation_FILENAME$, "\")
Action #2:
 Set 'ProdlistFileLocation_FILENAME' =
     SUBSTR($ProdlistFileLocation_FILENAME$, $zint_position$+1)
 // The +1 is to also strip the separator that was found
Action #3:
 GOTO:   <execution order for this Active Link>

Fred


-----Original Message-----
From: Action Request System discussion list(ARSList)
[mailto:[EMAIL PROTECTED] On Behalf Of Carey Matthew Black
Sent: Friday, July 28, 2006 9:51 AM
To: arslist@ARSLIST.ORG
Subject: Re: Set path from local PC. Almost there...

Mathieu,

    I do not know. I am (not yet) using Oracle so it is hard for me to
even test it out.

    Personally I would not use RDBMS specific solutions unless there was
no other way to achieve the business needs.

I would do as Joe DeSouza (and others if memory serves) has suggested
and using STRSTR repeatedly to find the position of the last "\", "/"
character. So let me outline what I would do...


***************************
'ProdlistFileLocation' = $536880933$
'ProdlistFileLocation_PATH' = $ ???  $
'ProdlistFileLocation_FILENAME' = $ ???  $ 'zint_position' = $ ???  $


Active Link:
Action#1
Run Process
PERFORM-ACTION-ADD-ATTACHMENT 536880933

Action#2
Set Field
  'ProdlistFileLocation_PATH' = $ProdlistFileLocation$
  'ProdlistFileLocation_FILENAME' = $ProdlistFileLocation$


Active link #2:
// assuming your only care about \ as a file separator

Run If : ('ProdlistFileLocation_FILENAME' LIKE "%"+"\"+"%") Action #1:
zint_position = STRSTR($ProdlistFileLocation_FILENAME$, "\")

Active link #3:
Run If:  'zint_position' > 0
Action #1:
'ProdlistFileLocation_FILENAME' =
SUBSTR($ProdlistFileLocation_FILENAME$, $zint_position$+1) // The +1 is
to also strip the separator that was found Action #2:
    GOTO:   <execution order for Active Link #2>
   // note this could also have be done inside an Active Link guide with
a GOTO Guide LABEL action too.


// When the active links are done looping you should end up with a
'ProdlistFileLocation_FILENAME' value of just the file name.

// Lastly... you need more more active link to "strip" the file name
from the path part.

Active link #4:
No run if is really needed. It should be safe to do this action at any
point. (unless your path has the exact file name (with extension) as
part of the path. :)
Action#1
Set Field
'ProdlistFileLocation_PATH' = REPLACE($ProdlistFileLocation_PATH$,
$ProdlistFileLocation_FILENAME$, $NULL$)

***************************

HTH.
--
Carey Matthew Black
Remedy Skilled Professional (RSP)

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at http://www.wwrug.org

Reply via email to