Problem passing dataslot to another process

Posted by peter.oxheden@exicom.se on 12-Sep-2017 03:24

We're trying to make our processes as simple as possible to build, so we have a few "building stone" processes, that the "main processes" (which we want as simple as possible) use to actually do the "intelligent bits", with the main process just passing down a minimum of parameters to get the "right" intelligent bits done.

 

One of the parameters I want to send down is WorkstepName. Say that ProcessA has an activity in which it calls to ProcessB three times. In ProcessA the first Activity that calls to ProcessB is named "InitReportX", the second time the activity for ProcessB is named "InitReportY" and the third time the activity for ProcessB is named "InitReportZ". ProcessA passes a parameter to ProcessB exactly which report it is to initiate (X, Y or Z) and ProcessB does exactly the same thing otherwise, just passing that parameter on through a Webservice to get the correct report initiated. (ProcessB is also used similarly in ProcessC, D, E and F for any number of reports and so on).

 

We want ProcessA to send down WorkstepName in each case to ProcessB, so that ProcessB can hand over also "InitReportX", "InitReportY" or "InitReportZ" to the webservice. I have in ProcessB made a Character dataslop CopWorkstepName and when I call ProcessB from ProcessA I have added WorkstepName to the Dataslots, but cast to be called CopWorkstepName in ProcessB instead - I see it in the "Input to Sub-Process" field as CopWorkstepName.

 

I thought this would work, but it doesn't. The Webservice receives ? for this value and when I write it in the log it says <UNKNOWN> ...

 

I do the exact same thing (or so I really think, anyway ...) with ProcessInstanceId - and that one gets through just fine.

 

Sending WorkstepName from ProcessB to the Webservice directly works, but then it'll be "StartJob" for all three, as that's what that particular activity is called in ProcessB, but the exchange with the webservice works.

 

I can get around it by creating a CopWorkstepName in ProcessA as well and manually assigning it the specific value I want for each of the three times and send that one to ProcessB, but I really would like to avoid it, since it's an extra step prone to be forgotten when building lots of processes and we want to use ProcessB OFTEN kind of thing ...

 

I even tried assigning CopWorkstepName TO WorkstepName in the BeforeActivation script of the activities that calls ProcessB, but that fails too.

 

Any input would be appreciated! I'm still very new at BPM and maybe it's just something very simple I don't understand yet. :)

 

- Peter

All Replies

Posted by Karthikeyan Bhaskaran on 12-Sep-2017 08:27

Hello Peter,

To use the value of WorkstepName, continue to use the CopWorkstepName dataslot to store the value of the WorkstepName, and use it as input to the ProcessB Subprocess workstep created in ProcessA.

Only thing missing appears to be a way to pass the value from ProcessA being passed to ProcessB.

The Before Activation script piece is necessary - please post a screenshot of the Logic tab used in your approach.

One way that I found to be working is:

In ProcessA:

- Use a Before Activation > Other > Custom > Custom Script (one line) as follows:

   jst.putDataSlot("CopWorkstepName",jst.getWorkstepName());

- In the Subprocess workstep ProcessB, use CopWorkstepName as the Input Dataslot.

- Save and Publish.

In ProcessB:

- Create a CHAR dataslot CopWorkstepName in the ProcessB.

- Add this dataslot on some workstep to verify if the correct workstepname from ProcessA has been transmitted.

Use this dataslot for the conditional operations you wish to perform from the ProcessB. You can add the field on any of the worksteps to verify that the correct ProcessA workstepname has been passed.

Hope this addresses your requirement.

Posted by peter.oxheden@exicom.se on 12-Sep-2017 09:29

Hello!

 

First, thank you kindly for helping me with this, it's much appreciated!

 

This worked very well in getting the workstepname to the CopWorkstepName dataslot. I wonder why it didn't work to use the Set Dataslot logic to set CopWorkstepName to the System Dataslot WorkstepName, but since this did work, that doesn't really matter. :)

 

However, while this works (again, thank you!), it's not optimal, as it requires a separate dataslot and then for each subprocess that we want to send the logging information to it would require adding this extra script. And since in some of our "main processes" we have up to 20 accesses to various subprocesses (in the more extreme cases) that feels like a lot of extra work and bound to be forgotten.

 

Is there no way to do this as I am already able to do with ProcessInstanceId? With ProcessInstanceId I can just add that to the list of dataslots to send directly to ProcessB. In the Dataslot Property form of the activity that "is" ProcessB in ProcessA I have added ProcessInstanceId. Then I have changed the "Input to Sub-Process" value to "CopProcessInstanceId", so that ProcessB "receives" ProcessInstanceId "as" "CopProcessInstanceId". This works just fine. I don't have a separate dataslot for it in ProcessA or anything. If I could do the same with WorkstepName that would really simplify the processbuilding. And since WorkstepName is a system dataslot just like ProcessInstanceId it feels like it "should" work in the same way.

 

We're currently on 11.5 by the way, if that makes any difference?

 

Again, thank you for your help!

 

- Peter

Posted by Karthikeyan Bhaskaran on 15-Sep-2017 04:17

Hello Peter,

Would like to take a look at your application itself. Can you log a Support case?

(If you are not registered for our Support portal, please try registering via page progresslink.progress.com - Register link under the login box.)

There might be some issues with the script generated by Graphical editor. The other half of the problem, where ProcessInstanceID is getting passed through but not Workstepname needs to be checked.

Posted by peter.oxheden@exicom.se on 18-Sep-2017 03:28

We've logged a support case for it now. Thank you!

This thread is closed