Artem Maevskij Super Contributor.
Super Contributor.
321 views

Call an automatic transition to a new phase from script

Jump to solution

Hi

Now I have a manual transition for the button on the task panel.

transition.png

How can I make the call this transition from the script (for update SD width SmartEmail action)?

How to get access to the Variable3?

0 Likes
1 Solution

Accepted Solutions
kva
Visitor.

Re: Call an automatic transition to a new phase from script

Jump to solution

var fObj = new SCFile("incidents"); // any other object you need to query and update

var sQuery = "incident.id=\"" + <your number> + "\"";
var rc = fObj.doSelect(sQuery);

if (rc == RC_SUCCESS)

{

<action is here>

}

0 Likes
4 Replies
kva
Visitor.

Re: Call an automatic transition to a new phase from script

Jump to solution

Hi,

you could make workflow backend transition, for e.g. "go.to.review".

In SL you could call a transition to phase "Review":
var G_TO_REVIEW_ACTION = "_wfE:go.to.review"; // workflow backend transition 

....

fObj.doAction(G_TO_REVIEW_ACTION);

sm_gotoreview.jpg

and advice:
- do not use OOB SL "SmartEmailSMAdpater" for your custom purposes, because when for e.g. you update SM, you could loose your customizations

Artem Maevskij Super Contributor.
Super Contributor.

Re: Call an automatic transition to a new phase from script

Jump to solution

Thank you!
I tried to do as you suggest. But it didn't work for me.

I think this is the case "fObj.doAction (G_TO_REVIEW_ACTION);"
What should be fObj?
How do scripts interact with "processes" and "rules"?

0 Likes
Nick_Karpushkin Respected Contributor.
Respected Contributor.

Re: Call an automatic transition to a new phase from script

Jump to solution

Hi Artem!

To press a button that is a manula transition in your workflow you can use doAction("<command_name>")

You can find the <command_name> in Details Tab of the corresponding transition.

 

To trigger the automatic transition you need to update you record so that it would fit the condition for the appropriate automatic transition and then call doAction("save"). This should do the trick.

HTH

kva
Visitor.

Re: Call an automatic transition to a new phase from script

Jump to solution

var fObj = new SCFile("incidents"); // any other object you need to query and update

var sQuery = "incident.id=\"" + <your number> + "\"";
var rc = fObj.doSelect(sQuery);

if (rc == RC_SUCCESS)

{

<action is here>

}

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.