Trigger message programmatically

Parent Previous Next

It's often required to send workflow messages to IYOPRO process instances. To do that IYOPRO offers three mechanisms.

  1. Send Workflow Message using the IYOPRO API
  2. Send Workflow Message by Url
  3. Send Workflow Message by Web Service


The first method is described in the IYOPRO API section.



Send Workflow Message by Url

To send a Workflow Message by Url, IYOPRO provides the IYOPROSendWorkflowMessage.aspx component. You may specify the following sets of parameters to complete the message:


The target may be specified in three different ways:


To running process instance

This mode is used to send a workflow message to a known process instance


You may specify the following url parameters:

instance

The guid of the targeted process instance.

diagramid

Specify the id of the workflow diagram, to which the message will be send

ctrlid

Specify the id of the diagram control in the diagram, to which the message will be send

message

Optional, base64 encoded message which may be read by the workflow instance

backlink

Optional, base64 encoded email address which may be read by the workflow instance


Sample:

https://www.iyopro.com/iyopro/IYOPROSendWorkflowMessage.aspx?instance=1025dee0-4722-4121-914b-0c0425379202&DiagramId=9897&CtrlId=60



To new process instance

This mode is used to create a new process instance which immediately receives the specified message


You may specify the following url parameters:

projectid

Specify the id of the workflow project, to which the message will be send

diagramid

Specify the id of the workflow diagram of the project, to which the message will be send

ctrlid

Specify the id of the diagram control in the diagram, to which the message will be send

message

This is an optional, base64 encoded message which may be read by the workflow instance

backlink

This is an optional, base64 encoded email address which may be read by the workflow instance


Sample:

https://www.iyopro.com/iyopro/IYOPROSendWorkflowMessage.aspx?ProjectId=56443&DiagramId=9897&CtrlId=60


Determine existing process instance

This mode is used to determine a running process instance by specifying a process instance attribute which matches a given value.


You may specify the following url parameters:

diagramid

Specify the id of the workflow diagram of the project, to which the message will be send

ctrlid

Specify the id of the diagram control in the diagram, to which the message will be send

message

This is an optional, base64 encoded message which may be read by the workflow instance

backlink

This is an optional, base64 encoded email address which may be read by the workflow instance

instancename

Specify the name of the process instance. All running instances with the given name will be searched

instanceattributename

Specify the name of the process instance attribute

instanceattributevalue

Specify the value, which must match to the instance attribute.


Sample:

https://www.iyopro.com/iyopro/IYOPROSendWorkflowMessage.aspx?DiagramId=9897&CtrlId=60&InstanceName=Orders&InstanceAttributeName=OrderNo&InstanceAttributeValue=4711



Send Workflow Message by Web Service

To send a Workflow Message by Url, IYOPRO provides the IYOPROSendWorkflowMessage.asmx component. You may specify the following sets of parameters to complete the message:


projectid

Specify the id of the workflow project, to which the message will be send

diagramid

Specify the id of the workflow diagram of the project, to which the message will be send

ctrlid

Specify the id of the diagram control in the diagram, to which the message will be send

message

This is an optional message which may be read by the workflow instance

backlink

This is an optional, base64 encoded email address which may be read by the workflow instance

instancename

Specify the name of the process instance. All running instances with the given name will be searched

instanceattributename

Specify the name of the process instance attribute

instanceattributevalue

Specify the value, which must match to the instance attribute.


The meaning of the parameters are the same as when specified by the URL-Version of this component.



Results when sending a workflow message

Depending on the system configuration IYOPRO responds with a HTML page containing a description of the call result or a structured result information.

The structured result information comprises of the HTTP status code and description, as well as the custom X-IYOPRO-STATE reply header.

If the call was successful the HTTP state 200 (OK) is returned. The X-IYOPRO-STATE header will contain one of the following values:


RESUMED

The execution of the process instance was resumed

STARTED

A new process instance was started

PROCESSED

XML message was processed

                       

If the call fails, it can either fail with status code 400 (bad request) or internal server error (500) in case of an exception during the request processing.

The X-IYOPRO-STATE header will contain one of the following values:


NOTUNIQUE

The specified process instance is not unique

NOTFOUND.WORKFLOW

No matching workflow found or the workflow is not available or was removed

NOTFOUND.INSTANCE

The appropriate process instance is not available

NOTFOUND.DIAGRAM

The appropriate process diagram could not be determined

NOTFOUND.CONTROL

The appropriate process element could not be determined

NOTFOUND.FINISHED

The appropriate process instance has already been finished

NOTFOUND.MESSAGEFLOW

The specified link does not reference a message flow



ERROR.CONTENTFORMAT

XML body invalid

ERROR.MESSAGEDATA

Invalid XML message data


If the call is successful or if the X-IYOPRO-STATE contains the value "NOTFOUND.FINISHED", the structured result information additionally contains the X-IYOPRO-INSTANCEID reply header.

The X-IYOPRO-INSTANCEID will contain the process instance ID.