Home Powershell Activity

Issues setting an activity to ReRun inside a Cireson PowerShell Activity

Ryan_KennedyRyan_Kennedy Customer IT Monkey ✭
Hello,

I am having issues setting a previous activity back to ReRun within a Cireson PowerShell Activity.
The workflow I have looks something like this:

CiresonPSAct1
MA1
CiresonPSAct2
MA2

In the CiresonPSAct2 I am setting MA1 to rerun.
This does happen - MA1 goes to ReRun / In Progress and CiresonPSAct2 goes to Pending.
BUT MA2 also goes to In Progress.. So Once the ReRun on MA1 is Complete, CiresonPSAct2 never becomes In Progress..
I have tried to set MA2 to Pending within CiresonPSAct2 but it only goes to In Progress once the activity completes...

I have previously done this running a powershell script from a runbook and never had any issues but it just doesn't seem to work with the Cireson PowerShell Activities ...
Has anyone had an issue like this before?


I basically just get the class instance of the activity and run :
$MA1 | %{$_.Status= "ActivityStatusEnum.Rerun";$_} | Update-SCClassInstance

Have also tried getting the activity object and using
$MA1 | set-scsmobject -property Status -value "ActivityStatusEnum.Rerun"


Thanks for any help you can give,

Ryan

Answers

  • Justin_WorkmanJustin_Workman Cireson Support Super IT Monkey ✭✭✭✭✭
    Hey Ryan,
    I'm glad to see someone using PS Activities.  I think they're a little unsung.  I'm experimenting with this in my lab now.  I'll get back with you on this shortly... :)
  • Ryan_KennedyRyan_Kennedy Customer IT Monkey ✭
    Did you end up testing this @Justin_Workman? Has anyone else had this issue?
  • Adam_DzyackyAdam_Dzyacky Product Owner Contributor Monkey ✭✭✭✭✭
    I can second this as I was recently experimenting with these. A rerun or an invocation/on-demand execution provides no actual re-run of the Cireson P$A. But rerunning runbooks (SCO or SMA) works as you cite works without issue.

  • Ryan_Kennedy1Ryan_Kennedy1 Customer IT Monkey ✭
    It also seems that if you have a Sequential Activity with a PowerShell Activity followed by a MA inside of it, if you skip the MA in the PowerShell Activity , once the PowerShell Activity completes, the MA changes state from Skipped to In Progress ..... I think this was working okay without the Sequential Activity but definitely not working with it... If I Skip the MA , put a sleep of 5 minutes in, then the PowerShell Activity completes, it still puts the MA In Progress ..
  • Ryan_Kennedy1Ryan_Kennedy1 Customer IT Monkey ✭
    Has anyone else had this issue / does anyone know a way around this?
  • Justin_WorkmanJustin_Workman Cireson Support Super IT Monkey ✭✭✭✭✭
    @Ryan_Kennedy1 - I still want to look at this.  I just haven't got around to it...I'm sorry :frowning:

  • Thorsten_MewesThorsten_Mewes Customer IT Monkey ✭

    Hi there everyone,

    old story but i just ran into this issue for the first time. Using a PSA to rerun MA and seeing exact same behaviour as Ryan descriped above. Started searching around and found this thread. Wondering if anyone came up with a solution to this? Would be great to hear from you!

    Best regards

    Thorsten

  • Simon_ZeinhoferSimon_Zeinhofer Customer Ninja IT Monkey ✭✭✭✭

    @Thorsten_Mewes opened an Incident last week about this issue ;) We have the same situation with 2 Delay Activities, where the second one (directly after the PSA) stays In Progress although the Delay Activity before has been set to In Progress as well

  • Thorsten_MewesThorsten_Mewes Customer IT Monkey ✭

    Hey @Simon_Zeinhofer , good to know :-)

    @Adam_Dzyacky Maybe some input from you guys would help? Maybe any known workarounds came up since this is a really old issue?

  • Geoff_RossGeoff_Ross Cireson Consultant O.G.

    Hi All,

    I'm not 100% following Simons use case so I will go and look up his ticket but its the build it SCSM behaviour that when an activity completes, the next one will go into InProgress.

    Fighting against that behaviour is always a struggle.
    Can you change your process and rather then rerunning, insert a new MA for when the step needs repeating.

    Or another MA after the PSA that is just a place-holder to hold up proceeding to MA2 until we're ready. It can be unassigned and the PSA can complete it if the conditions are such that we are ready to proceed.

    Geoff

  • Simon_ZeinhoferSimon_Zeinhofer Customer Ninja IT Monkey ✭✭✭✭

    Hy Geoff,

    the thing is, that normally, when an activity gets set to rerun, all activities after this activity go back to pending, even if they are already completed. I tested this in the test system.

  • Thorsten_MewesThorsten_Mewes Customer IT Monkey ✭

    Hi @Geoff_Ross, same with me. If we set an activity to rerun via scsm console everything is working fine. We see that behaviour as described by Simon only if we set rerun via PSA.

  • Simon_ZeinhoferSimon_Zeinhofer Customer Ninja IT Monkey ✭✭✭✭

    I guess the difference here is, that the PSA goes to completed directly before the activity will be set to rerun. So the workflow sets the following activty to In Progress before setting the first activity to In Progress. So the workflow processes the first activity, but not the second.

    When you use the rerun in the console or in the portal, the PSA or any following activity should be completed or In progress already, so the workflow can handle that. When the workflow has ran and afterwards another activity is set to In progress, the workflow won't handle this activity anymore.

    Just my guess, but it would explain the behavior.

  • Geoff_RossGeoff_Ross Cireson Consultant O.G.

    Hi Simon,

    Thats exactly it. Two workflow are both running very quickly after each other.
    The re-run workflow is settings subsequent activities back to pending, but then the normal activity flow workflow is setting the activity following the PSA to InProgress as its the "next" activity.

    I don't know how you can work around that normal activity flow workflow

    Geoff

  • Simon_ZeinhoferSimon_Zeinhofer Customer Ninja IT Monkey ✭✭✭✭

    @Geoff_Ross I feared it was an SCSM issue and not an issue with the DA or PSA :(
    Tbh SCSM workflows are a Pain in the ass very often and I don't know how many "repair" workflows we have already for all this stuff :D
    Seems like I have to rebuild the template a bit now ;)

  • Simon_ZeinhoferSimon_Zeinhofer Customer Ninja IT Monkey ✭✭✭✭

    I didn't know that's possible :O
    But tbh I guess such an override requires knowledge which I don't have - seems like something I will definitely try to learn and build knowledge about :)

Sign In or Register to comment.