yuuvis® RAD Q&A

0 votes
by (1.2k points)

Hello,

I'm trying to call a process from another process with ModelID like here:
https://developer.enaio.org/redline/display/DD/BPM Server-Side Scripting#BPMServer-SideScripting-StartaProcessWithinanEventScript

=====
// You can start a process and put some process parameter to it. The following example uses the parameters 'firstname' and 'lastname'.
// Additionally you can put an object to the process. The process engine will put it into the process file.
// The context variable will be the body of the request later.

var context = {

data: {
    firstname: 'Ada',
    lastname: 'Lovelace'
},
contents: {
    0: {
        id: '7F822BD2065744CBA85736FD5A10179B',
        type: 'Image'
    }}

};

// Define a post request, set the endpoint and put a query parameter and the defined body object. Then execute.
var res = $.http.post().path('/service/bpm/process')

.query('modelid', '310FCE1DC0A04247A793FBDEB5DA32F6')
.body(context)
.execute();

=====

That works, but if I log the $ object, I dont see the context that I sent. Can you tell me please, where I can find it?

Thank you!

Best regards,
Georgii

1 Answer

0 votes
by
selected by
 
Best answer

Hi Georgii,
I ask because I am not sure if I understand correctly. The start of a process from event script works for you? The question is how to log the context while starting the subprocess?

I think to log the $ object is not the right way. If you change the log level to DEBUG you get an log output such:
log('execute http; method:' + $method + ', path:' + $path + ', header: ' + JSON.stringify($header) + ', pathParams: ' + JSON.stringify($param) + ', queryParam: ' + JSON.stringify($query) + ', body: ' + JSON.stringify($body) + ', raw: ' + $raw);

May be this is your solution?

Logging: https://developer.enaio.org/redline/display/DD/BPM Server-Side Scripting#BPMServer-SideScripting-Logging

by (1.2k points)
Hi Christian,
Thank you for your answer. What I meant is:
If I start a process from another process, how can I send parameters and attach new files to it?
by
This works like you describe,
var res = $.http
  .post()
  .service('dms')  --> is default
  .path('/service/bpm/process')
...
I think thats ok. And your context object seems also be good.
You have to ensure, that the model is in an active state and has the same input parameters you want to set. The object type of given file content must be the same.
Please check:
- model state
- input parameters
- object type of file and possible rules on it

Take a look on the rest-ws monitor on <dms-service>:8080/rest-ws

May be the force with you :-)
by (1.2k points)
Yeah, that was it. Input parameters and file type/quantity.
Thank you!

Related questions

...