Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
hewstone

Veteran
Registered:
Posts: 118
Reply with quote  #1 
Hi there,

Is there a way to initiate a process using C# coding?

I am using a 'server opteration' button which has lots of server side scripts, and what I want to do is to open up another process/form after those scripts have run.

Many thanks in advance for your help.
0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #2 
Raise a flag to start another process.

You cannot 'open it' for the user, however.

__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
ryansaul

Member
Registered:
Posts: 16
Reply with quote  #3 
You can use the Mstm library to flag a new process to open:
Mstm.RaiseFlag("MyProcessFlag", folderid, myList);

If you want to open the flagged process.. then you will need to trigger the flag; then get the latest flagged processes folder id then open the new folder.
I do this with 3 buttons calling eachother in sequence (reasoning for 3 is you need timers between to ensure the correct sequence is followed).
One button creates the flag; which then has a timer which calls a button which gets the latest folder id created; which then has a timer which calls a client side button which opens the new process form.
0
chsantosh

Member
Registered:
Posts: 14
Reply with quote  #4 
Good Afternoon Ryansaul,
I am looking for the functionality that you mentioned below. Is there a way you could point me to a sample of what you are mentioning below.

Thank you for your time,
Santosh

__________________
Santosh
0
ryansaul

Member
Registered:
Posts: 16
Reply with quote  #5 

Hi Santosh,

The user clicks a button which is client side which is like follows:

----
triggerFlag();


function triggerFlag() { 
document.getElementById('btnCreateFlag').click();  //calls button with server script creating flag
setTimeout(getNewFolderID, 1500); //a timer to get the new flagged folders id
}

function getNewFolderID() { 
document.getElementById('btnGetLatestID').click();  //calls server side button to get new id created
setTimeout(openLink, 1500); //a timer to open the new folder
}

function openLink() {  

var strFolderID = eworkGetField("subProcessID"); //get the new folder id
  var theURL=window.location.href; //get the current url
  var thePos = theURL.indexOf("Metastorm");
  theURL=theURL.substring(0,thePos); //get the http and server name
  theURL="theURL+"/eFolder.aspx?FolderID="+strFolderID //create the new folder url
  window.open(finalStr, "_blank", 'fullscreen=0' ); //open url
}

 



Quote:
Originally Posted by chsantosh
Good Afternoon Ryansaul,
I am looking for the functionality that you mentioned below. Is there a way you could point me to a sample of what you are mentioning below.

Thank you for your time,
Santosh
0
chsantosh

Member
Registered:
Posts: 14
Reply with quote  #6 
Thank you for the prompt response. This is handy. What I am looking for is to open a form tied to a user action in a process from an admin form. I tried using a flag with a parameter which is needed by the target form. I tried different ways but still did not make any progress yet. I am not trying to open a sub process. Would that matter? Can I use this technic for initiating a regular process?

Thanks,
Santosh

__________________
Santosh
0
ryansaul

Member
Registered:
Posts: 16
Reply with quote  #7 
Hi,

I use this to create new processes and then open them from a button on a form.
I have done this on forms so one process can initiate another new process.
I cant see why this wouldnt work from an admin form as the same principle applies.

The flag action would need to be from the start of your process to a stage in order for the flag to create a new folder.

Cheers.
0
chsantosh

Member
Registered:
Posts: 14
Reply with quote  #8 
Thank you again for the prompt response.

Can you help me with the

document.getElementById('btnGetLatestID').click();  //calls server side button to get new id created

How do I retrieve the new folderID?

Thank you so much for your valuable time,

Santosh


__________________
Santosh
0
chsantosh

Member
Registered:
Posts: 14
Reply with quote  #9 
Ryansaul,
I am assuming that I need to query efolder table to get me the efolderid where the parent is the current folderid....Is this the right way to do this? Please let me know if there is a better way.

Thanks,
Santosh

__________________
Santosh
0
ryansaul

Member
Registered:
Posts: 16
Reply with quote  #10 
Quote:
Originally Posted by chsantosh
Ryansaul,
I am assuming that I need to query efolder table to get me the efolderid where the parent is the current folderid....Is this the right way to do this? Please let me know if there is a better way.

Thanks,
Santosh


Yes; immediately after the flag I run the next button which is server side to get the latest folderid for the newly created process from the efolder table.
This is why I have a delay timer on the buttons to ensure that the new entry has been added before retrieving the new folderid.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!