Issues setting an activity to ReRun inside a Cireson PowerShell Activity
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?
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
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...
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
@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
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?
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
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.
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.
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.
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
@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 ;)
Yes. They are a pain. You could try to override it?
https://techcommunity.microsoft.com/t5/system-center-blog/disabling-workflows-with-overrides/ba-p/343652
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 :)