Regular Project Unarchiving Workflow

Some workflows directly interact with iGrafx projects. If the workflow you are implementing interacts with a project, please make sure to setup this workflow. To ensure these workflows run smoothly, the project must be unarchived and available.

⚠️ A project is automatically archived if it has not been used for 15 days.

If you attempt to use a project that is archived, the workflow will fail.
To prevent this, we can set up an automated process that unarchives the project once every 7 days (or at any desired interval).

In order to do that, we will need the Confluent Datagen Kafka Connector. You can find this connector here.

You can also find the documentation here

Download it, unzip it and place it in the docker-compose/connect-plugins/ directory.

We also need the Camel HTTP Secured Sink Kafka Connector, which can be found here. For this connector to work correctly, we also need the Camel Kamelet jar. You can find it here.

Place both the Camel connector and the Kamelet JAR in the docker-compose/connect-plugins/ directory.

You may find the documentation for the camel connector here

Now that we are ready, we can create the workflow.

First, lets setup the datagen connector:

CREATE SOURCE CONNECTOR WEEKLY_TRIGGER WITH (
  'connector.class' = 'io.confluent.kafka.connect.datagen.DatagenConnector',
  'kafka.topic' = 'secured-http-trigger',
  'quickstart' = 'pageviews',
  'max.interval' = 604800000,
  'iterations' = -1,
  'tasks.max' = '1',

  -- Force string output instead of structured JSON
  'value.converter' = 'org.apache.kafka.connect.storage.StringConverter'
);

This connector will send a message in string format to the given kafka topic once every 7 days. This value is in millisecond and can be changed if necessary. This message will be used as the trigger by the Camel connector.

Once ready, execute this connector.

Next, lets setup the camel connector. The Camel connector listens to the same topic (secured-http-trigger) and sends an authenticated HTTP PUT request to unarchive the project.

CREATE SINK CONNECTOR UNARCHIVE_PROJECT_HTTP WITH (
  'connector.class' = 'org.apache.camel.kafkaconnector.httpsecuredsink.CamelHttpsecuredsinkSinkConnector',
  'tasks.max' = '1',
  'topics' = 'secured-http-trigger',

  -- HTTP Config
  'camel.kamelet.http-secured-sink.url' = '<API URL>/pub/projects/<Project ID>/unarchive',
  'camel.kamelet.http-secured-sink.method' = 'PUT',

  -- OAuth2 Auth Config
  'camel.kamelet.http-secured-sink.oauth2ClientId' = '<Workgroup ID>',
  'camel.kamelet.http-secured-sink.oauth2ClientSecret' = '<Workgroup Key>',
  'camel.kamelet.http-secured-sink.oauth2TokenEndpoint' = '<Authentication URL>/protocol/openid-connect/token',

  'value.converter' = 'org.apache.kafka.connect.storage.StringConverter'
);

Replace the API URL, Workgroup ID, Workgroup Key and Authentication URL with your own credentials that can be found in the iGrafx workgroup settings Open API page.

Replace the Project ID with the project that you want to unarchive.

The value.converter ensures compatibility between connectors by sending messages in plain string format.

Note that it uses the same topic as the datagen connector and the Camel connector performs the unarchive request.

This connector can also be used to run other routes. To do that simply replace the endpoint URL and its method before running the connector.

Once both connectors are running, your workflow will automatically unarchive the project every 7 days, ensuring it remains active and ready for other automated processes.